Statically linking (with i686-uclibc-gcc -static) and not making use of any stdio functions seems to always prodiuce programs that segfault. Buildroot was used to build the toolchain, with standard settings. This is probably related to http://lists.uclibc.org/pipermail/uclibc/2008-December/041623.html
http://gcc.gnu.org/PR32219 We can workaround it, but it's not really pretty (using a table to store the addr, and checking that instead seems to work for me. Let me have a look..)
trivial testcase: #include <unistd.h> #include <stdio.h> int main(void) { write(1, "write\n", 6); #ifdef USE_STDIO puts("stdio"); #endif return 0; }
Created attachment 1033 [details] possible fix Please test this patch against master.
Created attachment 1039 [details] possible fix, without pthreads handling
Anders, do you have DOPIC set in your .config?
Created attachment 1735 [details] Alternative fix
(In reply to comment #6) > Created attachment 1735 [details] > Alternative fix applied as 2e53dd645d5348f207cec7f8595969dc566c5a55