From 55304e7036b6212e78dbafad2d9a9a6e9c3ed12b Mon Sep 17 00:00:00 2001 From: Jaromir Capik Date: Thu, 5 Nov 2015 17:54:43 +0100 Subject: [PATCH] Fix for early stage2 SIGSEGV + 32-bit TARGET rework --- STAGE1-glibc | 9 +++------ STAGE1-glibc-headers | 14 ++++++-------- 2 files changed, 9 insertions(+), 14 deletions(-) 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