View Single Post
Old 08-12-2012, 08:58 AM   #172
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Hmm...
The static build dynamic link of tcc-next-unreleased posted in the DIT-KeK thread:

Code:
(armv6l:1) /home # tcc -run un.c
This program was called with "un.c".
The command had no other arguments.
(armv6l:1) /home # tcc -run un.c junk
This program was called with "un.c".
argv[-1094246539] = argv[%d] = %s
But that build has some strange ideas about the standard libraries, the posted code needs to be changed to run under the DIY-KeK build:
Code:
(armv6l:1) /home # cat un.c
/* #include "stdio.h" */
/* #include <stdlib.h> */
int main(int argc, char **argv) {
int count;
printf ("This program was called with \"%s\".\n", argv[0]);
if (argc > 1)
for (count = 1; count < argc; count++)
printf("argv[%d] = %s\n", count, argv[count]);
else
printf("The command had no other arguments.\n");
return 0;
}
That first line change - I don't know why the author was expecting stdio.h to be in the current directory ;
The second line change - That is part of the changes required for tcc-next-release.

I haven't looked to see if it is an error in tcc or an intended feature to have (some) of the standard libraries built-in and blow up if the external libraries are used.

Last edited by knc1; 08-12-2012 at 09:02 AM.
knc1 is offline   Reply With Quote