cannot statically link against musl anymore 12 August 2018, 20:11:33 After a recent update, binaries statically linked with the musl-gcc wrapper stopped working for me.Here is a minimal example:Quote$ cat test.cint main(void) { return 0; }$ musl-gcc -static test.c$ ./a.outSegmentation faultSo it links, but all produced binaries crash right away.gdb shows, upon running a.out:QuoteProgram received signal SIGSEGV, Segmentation fault.0x000000000040140f in static_init_tls ()As for dynamic linking (which I don't want/need, but maybe it gives a hint),Quote$ musl-gcc -no-pie test.cworks, whileQuote$ musl-gcc test.c/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/crtbegin.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__'can not be used when making a PIE object/usr/bin/ld: final link failed: nonrepresentable section on outputcollect2: error: ld returned 1 exit statusI think the latter used to work, but could be wrong. But as stated, it is the static linking that I need to fix.
Re: cannot statically link against musl anymore Reply #1 – 13 August 2018, 19:38:26 And the next evening shows an update for musl (as well as binutils), and now things work again. Thank Y'all, devs, you keep impressing me! (And sorry for any inconvenience caused by my impatient concerns.)
Re: cannot statically link against musl anymore Reply #2 – 13 August 2018, 21:12:50 We do it on purpose, otherwise our forum would be empty :-) 1 Likes