From 972d23085638565bb061ca36ba829174e5dedf53 Mon Sep 17 00:00:00 2001 From: Jaromir Capik Date: Nov 05 2015 16:54:43 +0000 Subject: Fix for early stage2 SIGSEGV + 32-bit TARGET rework --- diff --git a/STAGE1-glibc b/STAGE1-glibc index 50e57ec..f9ee5ba 100644 --- a/STAGE1-glibc +++ b/STAGE1-glibc @@ -31,7 +31,7 @@ mcd $BUILDDIR/glibc # prefill glibc cache echo libc_cv_forced_unwind=yes > config.cache echo libc_cv_c_cleanup=yes >> config.cache -echo libc_cv_ctors_header=yes >> config.cache +#echo libc_cv_ctors_header=yes >> config.cache echo ac_cv_header_cpuid_h=yes >> config.cache echo libc_cv_gcc_builtin_expect=yes >> config.cache @@ -45,17 +45,14 @@ make DESTDIR=$ROOTFS $J ARCH=${KARCH} cross-compiling=yes install mv mathdef.h.new mathdef.h ) -# If we are building x86_64, then the 32-bit multilib libgcc -# will also need 32-bit headers. -if [ "$TARGET" = "x86_64-linux-gnu" ]; then +# 32-bit multilib libgcc needs 32-bit headers +if [ ! "$TARGET32" = "" ]; then old_CC=$CC old_CXX=$CC export CC="$TARGET-gcc -m32" export CXX="$TARGET-g++ -m32" - TARGET32=i686-pc-linux-gnu - GLIBCARGS="--prefix=/usr --with-headers=$ROOTFS/usr/include --enable-kernel=2.6.32 diff --git a/STAGE1-glibc-headers b/STAGE1-glibc-headers index a8969d3..f1dad9e 100644 --- a/STAGE1-glibc-headers +++ b/STAGE1-glibc-headers @@ -26,7 +26,7 @@ mcd $BUILDDIR/glibc-stage1 # prefill glibc cache echo libc_cv_forced_unwind=yes > config.cache echo libc_cv_c_cleanup=yes >> config.cache -echo libc_cv_ctors_header=yes >> config.cache +#echo libc_cv_ctors_header=yes >> config.cache echo ac_cv_header_cpuid_h=yes >> config.cache echo libc_cv_gcc_builtin_expect=yes >> config.cache @@ -52,18 +52,16 @@ done $TARGET-gcc -nostdlib -nostartfiles -shared -x c /dev/null\ -o $ROOTFS/usr/lib${SUFFIX}/libc.so -# If we are building x86_64, then the 32-bit multilib libgcc -# will also need stub 32-bit libraries. -if [ "$TARGET" = "x86_64-linux-gnu" ]; then + +# 32-bit multilib libgcc needs stub 32-bit libraries +if [ ! "$TARGET32" = "" ]; then old_CC=$CC old_CXX=$CC export CC="$TARGET-gcc -m32" export CXX="$TARGET-g++ -m32" - TARGET32="i686-pc-linux-gnu" + # setup 32-bit glibc headers - # This path MUST be relative, not absolute - GV=$(cd $SRC; echo glibc-2*) GLIBCARGS="--prefix=/usr --with-headers=$ROOTFS/usr/include --enable-kernel=2.6.32 @@ -86,7 +84,7 @@ if [ "$TARGET" = "x86_64-linux-gnu" ]; then # prefill glibc cache echo libc_cv_forced_unwind=yes > config.cache echo libc_cv_c_cleanup=yes >> config.cache - echo libc_cv_ctors_header=yes >> config.cache + #echo libc_cv_ctors_header=yes >> config.cache echo ac_cv_header_cpuid_h=yes >> config.cache echo libc_cv_gcc_builtin_expect=yes >> config.cache