Don't use -pipe when building glibc>=2.6: ./configure chokes on it.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Aug 12 15:19:45 2007 +0000 (2007-08-12)
changeset 3283241340146dc
parent 327 e016b216eca7
child 329 419d959441ed
Don't use -pipe when building glibc>=2.6: ./configure chokes on it.
(This is because "gcc -pipe --help" doesn't print what it should print).
scripts/build/libc_glibc.sh
     1.1 --- a/scripts/build/libc_glibc.sh	Sun Aug 12 15:18:09 2007 +0000
     1.2 +++ b/scripts/build/libc_glibc.sh	Sun Aug 12 15:19:45 2007 +0000
     1.3 @@ -59,7 +59,7 @@
     1.4      mkdir -p "${CT_BUILD_DIR}/build-libc-headers"
     1.5      cd "${CT_BUILD_DIR}/build-libc-headers"
     1.6  
     1.7 -    CT_DoLog EXTRA "Configuring C library headers"
     1.8 +    CT_DoLog EXTRA "Configuring C library"
     1.9  
    1.10      # The following three things have to be done to build glibc-2.3.x, but they don't hurt older versions.
    1.11      # 1. override CC to keep glibc's configure from using $TARGET-gcc. 
    1.12 @@ -221,7 +221,14 @@
    1.13      extra_config="${extra_config} ${addons_config}"
    1.14  
    1.15      # Add some default CC args
    1.16 -    extra_cc_args="${CT_CFLAGS_FOR_HOST}"
    1.17 +    glibc_version_major=$(echo ${CT_LIBC_VERSION} |sed -r -e 's/^([^\.]+)\..*/\1/')
    1.18 +    glibc_version_minor=$(echo ${CT_LIBC_VERSION} |sed -r -e 's/^[^\.]+\.([^.]+).*/\1/')
    1.19 +    if [ ${glibc_version_major} -ge 2 -a ${glibc_version_minor} -ge 6 ]; then
    1.20 +        # Don't use -pipe: configure chokes on it for glibc >= 2.6.
    1.21 +        extra_cc_args="${CT_CFLAGS_FOR_HOST/-pipe}"
    1.22 +    else
    1.23 +        extra_cc_args="${CT_CFLAGS_FOR_HOST}"
    1.24 +    fi
    1.25      case "${CT_LIBC_EXTRA_CC_ARGS}" in
    1.26          *-mbig-endian*) ;;
    1.27          *-mlittle-endian*) ;;
    1.28 @@ -247,7 +254,7 @@
    1.29      # Please see the comment for the configure step in do_libc().
    1.30  
    1.31      BUILD_CC=${CT_CC_NATIVE}                                        \
    1.32 -    CFLAGS="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} -O"   \
    1.33 +    CFLAGS="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} -O "  \
    1.34      CC="${CT_TARGET}-gcc ${CT_LIBC_EXTRA_CC_ARGS} ${extra_cc_args}" \
    1.35      AR=${CT_TARGET}-ar                                              \
    1.36      RANLIB=${CT_TARGET}-ranlib                                      \
    1.37 @@ -267,8 +274,10 @@
    1.38  
    1.39      #TODO: should check whether slibdir has been set in configparms to */lib64
    1.40      #      and copy the startfiles into the appropriate libdir.
    1.41 +    CT_DoLog EXTRA "Building C library start files"
    1.42      make csu/subdir_lib 2>&1 |CT_DoLog ALL
    1.43  
    1.44 +    CT_DoLog EXTRA "Installing C library start files"
    1.45      if [ "${CT_USE_SYSROOT}" = "y" ]; then
    1.46          cp -fp csu/crt[1in].o "${CT_SYSROOT_DIR}/usr/lib/"
    1.47      else
    1.48 @@ -321,8 +330,13 @@
    1.49  
    1.50  
    1.51      # Add some default CC args
    1.52 -    if [ "${CT_USE_PIPES}" = "y" ]; then
    1.53 -        extra_cc_args="-pipe"
    1.54 +    glibc_version_major=$(echo ${CT_LIBC_VERSION} |sed -r -e 's/^([^\.]+)\..*/\1/')
    1.55 +    glibc_version_minor=$(echo ${CT_LIBC_VERSION} |sed -r -e 's/^[^\.]+\.([^.]+).*/\1/')
    1.56 +    if [ ${glibc_version_major} -ge 2 -a ${glibc_version_minor} -ge 6 ]; then
    1.57 +        # Don't use -pipe: configure chokes on it for glibc >= 2.6.
    1.58 +        extra_cc_args="${CT_CFLAGS_FOR_HOST/-pipe}"
    1.59 +    else
    1.60 +        extra_cc_args="${CT_CFLAGS_FOR_HOST}"
    1.61      fi
    1.62      case "${CT_ARCH_BE},${CT_ARCH_LE}" in
    1.63          y,) extra_cc_args="${extra_cc_args} -mbig-endian";;
    1.64 @@ -363,7 +377,7 @@
    1.65  
    1.66      BUILD_CC=${CT_CC_NATIVE}                                        \
    1.67      CFLAGS="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} -O"   \
    1.68 -    CC="${CT_TARGET}-gcc ${extra_cc_args} ${CT_LIBC_EXTRA_CC_ARGS}" \
    1.69 +    CC="${CT_TARGET}-gcc ${CT_LIBC_EXTRA_CC_ARGS} ${extra_cc_args}" \
    1.70      AR=${CT_TARGET}-ar                                              \
    1.71      RANLIB=${CT_TARGET}-ranlib                                      \
    1.72      "${CT_SRC_DIR}/${CT_LIBC_FILE}/configure"                       \