Greetings,
It would appear that tcc doesn't support .symver assembler directive.
FreeBSD uses it for the __sym_compat macro invocation for an old qsort
interface:
#if defined(__generic) || defined(__cplusplus)
void __qsort_r_compat(void *, size_t, size_t, void *,
int (*)(void *, const void *, const void *));
__sym_compat(qsort_r, __qsort_r_compat, FBSD_1.0);
#endif
Where __sym_compat is defined in cdefs.h:
#define __sym_compat(sym,impl,verid) \
__asm__(".symver " #impl ", " #sym "@" #verid)
I get this error when building tcc:
/usr/include/stdlib.h:353: error: unknown opcode '.symver'
(which corresponds to the line the above appears at).
If I have this code in cdefs.h:
#ifdef __TINYC__
#define __sym_compat(a,b,c)
#else
/* The above define */
#endif
That solves the problem. Since I have a FreeBSD commit access, I can
easily fix this. In fact, I'm going through FreeBSD's cdefs.h trying
to clean things up. I'd like to not break tcc, but it looks like it's
starting out broken and I'd like to fix that as part of this... The
above hack is the 'obvious' fix, but I thought I'd ask here to see if
the wisdom of this crowd exceeds my quick and dirty somewhat ugly hack.
Running the tests, btw, shows things are close, but not quite right.
Two tests are failing:
Test: 108_constructor...
Test: 126_bound_global...