comparison sources/sections/gcc.sh @ 1532:a2e491cd0800

Fix source/target confusion that bites Fedora host = target builds. The gcc build exports an LD_LIBRARY_PATH full of target libraries and then calls /bin/sh in the configure stage. If you configure before building, this doesn't cause a problem because the libraries aren't there yet, but c++ has dependencies that trigger a C build before running configuration even if you reorder the steps. On ubuntu this doesn't cause a problem because /bin/sh doesn't link against anything in this LD_LIBRARY PATH, and when building a different architecture the foreign binaries are ignored by the dynamic linker. But on Fedora when host == target /bin/sh links against libgcc_s.so.1 which is in LD_LIBRARY_PATH linked against libc.so.0 which isn't installed on the host, and the attempt to run the shell dies saying it can't find uClibc. The fix is to override the make variable SHELL = sh so it calls ash out of build/host.
author Rob Landley <rob@landley.net>
date Thu, 16 Aug 2012 21:59:27 -0500
parents 4021fb1183d7
children 398efd71a43e
comparison
equal deleted inserted replaced
1531:3b7e8d600c19 1532:a2e491cd0800
88 # ./configure, because gcc's build system is overcomplicated crap, so skip 88 # ./configure, because gcc's build system is overcomplicated crap, so skip
89 # the uClibc++ build first time around and only do it for the canadian cross 89 # the uClibc++ build first time around and only do it for the canadian cross
90 # builds. (The simple cross compiler still needs basic C++ support to build 90 # builds. (The simple cross compiler still needs basic C++ support to build
91 # the C++ libraries with, though.) 91 # the C++ libraries with, though.)
92 92
93 make -j $CPUS configure-target-libstdc++-v3 && 93 make -j $CPUS configure-target-libstdc++-v3 SHELL=sh &&
94 cd "$CROSS_TARGET"/libstdc++-v3/libsupc++ && 94 cd "$CROSS_TARGET"/libstdc++-v3/libsupc++ &&
95 make -j $CPUS && 95 make -j $CPUS &&
96 mv .libs/libsupc++.a "$STAGE_DIR"/cc/lib && 96 mv .libs/libsupc++.a "$STAGE_DIR"/cc/lib &&
97 cd ../../.. || dienow 97 cd ../../.. || dienow
98 fi 98 fi