boot-hello.c (676B)
1 /* Forward declarations only — keeps boot3 staging free of any mes-libc 2 * header tree (formerly /work/in/mes-include) just to satisfy three 3 * stdlib includes. boot4 also uses this source and its musl libc.a 4 * provides the same symbols at link time, so prototypes here only 5 * have to match the call ABI. */ 6 extern int printf (const char *, ...); 7 extern char *strdup (const char *); 8 extern unsigned long strlen (const char *); 9 extern void free (void *); 10 11 int main(int argc, char **argv) { 12 printf("hello from tcc-built libc; argc=%d\n", argc); 13 char *s = strdup("works"); 14 printf("strdup: %s, strlen: %d\n", s, (int) strlen(s)); 15 free(s); 16 return 0; 17 }