| Summary: | Compiling host-gcc-final-4.9.3 broken on i386 | ||
|---|---|---|---|
| Product: | buildroot | Reporter: | Bernd Kuhls <bernd> |
| Component: | Other | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | buildroot |
| Priority: | P5 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
Thanks Bernd for the report. This is an issue you already reported in the past, I found your previous report and some related discussion at https://patchwork.ozlabs.org/patch/484002/. Basically, as I understand it, the problem is that uClibc-ng only offers the NPTL thread implementation for x86. But since i386 does not have the necessary instructions to implement NPTL, we only offer the "none" thread implementation, which explains why <pthread.h> is missing. So I think there are really two questions here: 1/ Is it correct that uClibc-ng provides no thread implementation at all for i386. This is something to discuss with Waldemar. 2/ Are we also seeing this <pthread.h> missing problem when building with no threads on i486+. If we also have this problem, then I don't see how the "none" thread implementation can still be useful. (In reply to Thomas Petazzoni from comment #1) > 2/ Are we also seeing this <pthread.h> missing problem when building with no > threads on i486+. If we also have this problem, then I don't see how the "none" > thread implementation can still be useful. I just tested, it also fails with the same error on i486 with thread support disabled. I.E this defconfig: BR2_x86_i486=y BR2_PTHREADS_NONE=y fails to build with: ../../../libgcc/generic-morestack-thread.c:41:21: fatal error: pthread.h: No such file or directory #include <pthread.h> ^ compilation terminated. make[4]: *** [generic-morestack-thread.o] Error 1 make[4]: *** Waiting for unfinished jobs.... make[3]: *** [all-target-libgcc] Error 2 make[2]: *** [all] Error 2 make[1]: *** [/home/test/outputs/i486-nothread/build/host-gcc-final-4.9.3/.stamp_built] Error 2 make: *** [_all] Error 2 After some research, it seems to be an x86 specific issue. The file causing problems is libgcc/generic-morestack-thread.c, which gets included in the build by libgcc/config/t-stack. It is related to the implementation of -fsplit-stack, which is only supported on x86 32/64. So on other architectures, a no thread configuration should still build fine. However, seeing that on a major arch like x86 the nothread support has been broken for a while (-fsplit-stack has been around since gcc 4.6) really makes me wonder if we should continue to support the no thread solution. (In reply to Thomas Petazzoni from comment #3) I also doubt the no-thread option gets used very much. Perhaps the way forward is to deprecate it and then make threads always available, similar to how we did for largefile/IPv6? If i386 support blocks this, then I suggest we drop the i386 variant. i386 support has been deprecated as of https://git.buildroot.net/buildroot/commit/?id=6cb4814c87cb1282b4a1d35e73743e8dd1b12ec5. x86 non-threaded configuration has been fixed as of https://git.buildroot.net/buildroot/commit/?id=2631219f648f4aa13fa36d06a483e4507cb6f3d7. |
When compiling buildroot git master (c6e3511) with this defconfig BR2_x86_i386=y this error occurs: /home/bernd/buildroot/br4_i386/output/build/host-gcc-final-4.9.3/build/./gcc/xgcc -B/home/bernd/buildroot/br4_i386/output/build/host-gcc-final-4.9.3/build/./gcc/ -B/home/bernd/buildroot/br4_i386/output/host/usr/i386-buildroot-linux-uclibc/bin/ -B/home/bernd/buildroot/br4_i386/output/host/usr/i386-buildroot-linux-uclibc/lib/ -isystem /home/bernd/buildroot/br4_i386/output/host/usr/i386-buildroot-linux-uclibc/include -isystem /home/bernd/buildroot/br4_i386/output/host/usr/i386-buildroot-linux-uclibc/sys-include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -O2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -mlong-double-80 -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fpic -mlong-double-80 -I. -I. -I../.././gcc -I../../../libgcc -I../../../libgcc/. -I../../../libgcc/../gcc -I../../../libgcc/../include -DUSE_TLS -o _gcov_ior_profiler.o -MT _gcov_ior_profiler.o -MD -MP -MF _gcov_ior_profiler.dep -DL_gcov_ior_profiler -c ../../../libgcc/libgcov-profiler.c ../../../libgcc/generic-morestack-thread.c:41:21: fatal error: pthread.h: No such file or directory #include <pthread.h> ^ compilation terminated. ../../../libgcc/shared-object.mk:14: recipe for target 'generic-morestack-thread.o' failed make[3]: *** [generic-morestack-thread.o] Error 1 make[3]: *** Waiting for unfinished jobs.... make[3]: Leaving directory '/home/bernd/buildroot/br4_i386/output/build/host-gcc-final-4.9.3/build/i386-buildroot-linux-uclibc/libgcc' Makefile:10153: recipe for target 'all-target-libgcc' failed make[2]: *** [all-target-libgcc] Error 2 make[2]: Leaving directory '/home/bernd/buildroot/br4_i386/output/build/host-gcc-final-4.9.3/build' Makefile:840: recipe for target 'all' failed make[1]: *** [all] Error 2 make[1]: Leaving directory '/home/bernd/buildroot/br4_i386/output/build/host-gcc-final-4.9.3/build' package/pkg-generic.mk:195: recipe for target '/home/bernd/buildroot/br4_i386/output/build/host-gcc-final-4.9.3/.stamp_built' failed make: *** [/home/bernd/buildroot/br4_i386/output/build/host-gcc-final-4.9.3/.stamp_built] Error 2