cc/gcc: fix thread-less final gcc build
authorArnaud Lacombe <lacombar@gmail.com>
Wed Apr 07 18:35:22 2010 +0200 (2010-04-07)
changeset 18815284cdc29a63
parent 1880 8bb865222229
child 1882 7daf6f84ead6
cc/gcc: fix thread-less final gcc build

If threads are disabled in libc, we don't want to enable them in the
final compiler. Doing so pass the configure stage, but fails latter on
a missing <pthread.h>.

Moreover, we don't want to build libgomp if threads are disabled; its
configure script would fails anyway.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
config/cc/gcc.in
scripts/build/cc/gcc.sh
     1.1 --- a/config/cc/gcc.in	Wed Apr 07 18:35:21 2010 +0200
     1.2 +++ b/config/cc/gcc.in	Wed Apr 07 18:35:22 2010 +0200
     1.3 @@ -62,24 +62,29 @@
     1.4  config CC_V_4_2_4
     1.5      bool
     1.6      prompt "4.2.4"
     1.7 +    select CC_GCC_4_2_or_later
     1.8  
     1.9  config CC_V_4_2_3
    1.10      bool
    1.11      prompt "4.2.3 (OBSOLETE)"
    1.12 +    select CC_GCC_4_2_or_later
    1.13      depends on OBSOLETE
    1.14  
    1.15  config CC_V_4_2_2
    1.16      bool
    1.17      prompt "4.2.2"
    1.18 +    select CC_GCC_4_2_or_later
    1.19  
    1.20  config CC_V_4_2_1
    1.21      bool
    1.22      prompt "4.2.1 (OBSOLETE)"
    1.23 +    select CC_GCC_4_2_or_later
    1.24      depends on OBSOLETE
    1.25  
    1.26  config CC_V_4_2_0
    1.27      bool
    1.28      prompt "4.2.0 (OBSOLETE)"
    1.29 +    select CC_GCC_4_2_or_later
    1.30      depends on OBSOLETE
    1.31  
    1.32  config CC_V_4_1_2
    1.33 @@ -99,15 +104,21 @@
    1.34  
    1.35  endchoice
    1.36  
    1.37 +config CC_GCC_4_2_or_later
    1.38 +    bool
    1.39 +    default n
    1.40 +
    1.41  config CC_GCC_4_3_or_later
    1.42      bool
    1.43      default n
    1.44 +    select CC_GCC_4_2_or_later
    1.45      select CC_GCC_USE_GMP_MPFR
    1.46  
    1.47  config CC_GCC_4_4_or_later
    1.48      bool
    1.49      default n
    1.50      select CC_GCC_4_3_or_later
    1.51 +    select CC_GCC_4_2_or_later
    1.52      select CC_GCC_USE_PPL_CLOOG_MPC
    1.53  
    1.54  config CC_GCC_USE_GMP_MPFR
     2.1 --- a/scripts/build/cc/gcc.sh	Wed Apr 07 18:35:21 2010 +0200
     2.2 +++ b/scripts/build/cc/gcc.sh	Wed Apr 07 18:35:22 2010 +0200
     2.3 @@ -313,6 +313,15 @@
     2.4          extra_config+=("--with-mpc=${CT_PREFIX_DIR}")
     2.5      fi
     2.6  
     2.7 +    if [ "${CT_THREADS}" = "none" ]; then
     2.8 +        extra_config+=("--disable-threads")
     2.9 +        if [ "${CT_CC_GCC_4_2_or_later}" = y ]; then
    2.10 +            extra_config+=("--disable-libgomp")
    2.11 +        fi
    2.12 +    else
    2.13 +        extra_config+=("--enable-threads=posix")
    2.14 +    fi
    2.15 +
    2.16      CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'"
    2.17  
    2.18      # --enable-symvers=gnu really only needed for sh4 to work around a
    2.19 @@ -334,7 +343,6 @@
    2.20          "${extra_config[@]}"                        \
    2.21          --with-local-prefix="${CT_SYSROOT_DIR}"     \
    2.22          --disable-nls                               \
    2.23 -        --enable-threads=posix                      \
    2.24          --enable-symvers=gnu                        \
    2.25          --enable-c99                                \
    2.26          --enable-long-long                          \