Improves compatibility with other toolchains, and allows a single TCC build/install to support multiple targets, eg. glibc and musl. Currently the convention is to build/install TCC twice (see eg. tcc-musl on the AUR). A hack[1] allows an existing TCC to partially support glibc and musl, with caveats. For most compilers, to target musl I would run:
cc -nostdinc -nostdlib -Wl,-nostdlib \ -isystem /usr/lib/musl/include -L /usr/lib/musl/lib \ -Wl,-I/lib/ld-musl-`uname -m`.so.1 \ -l:crt1.o -l:crti.o [FILES...] -lc -l:crtn.o These patches allow the above command line to work on TCC (obviously with -ltcc1 appended). [1]: https://git.sr.ht/~remph/misc-scripts/tree/master/item/musl-tcc.sh remph (3): Add -Wl,-I and -Wl,-dynamic-linker options Fix -Wl,-nostdlib behaviour for compatibility with other compilers Process linker directives beginning with a colon libtcc.c | 53 +++++++++++++++++++++++++++++++++++----------------- tcc-doc.texi | 16 +++++++++++++--- tcc.c | 5 ++++- tcc.h | 2 ++ tccelf.c | 4 +++- 5 files changed, 58 insertions(+), 22 deletions(-) -- 2.48.1 _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel