Get rid of the core cc selection. It is now the same as the final compiler.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed Aug 15 10:14:43 2007 +0000 (2007-08-15)
changeset 3310c05f9ea3254
parent 330 447b203edc2e
child 332 44623d725a82
Get rid of the core cc selection. It is now the same as the final compiler.
config/cc.in
config/cc_core_gcc.in
config/cc_gcc.in
scripts/build/binutils.sh
scripts/build/cc_core_gcc.sh
scripts/build/cc_gcc.sh
scripts/build/libc_glibc.sh
scripts/build/libc_uClibc.sh
scripts/crosstool.sh
     1.1 --- a/config/cc.in	Tue Aug 14 20:11:44 2007 +0000
     1.2 +++ b/config/cc.in	Wed Aug 15 10:14:43 2007 +0000
     1.3 @@ -2,47 +2,9 @@
     1.4  
     1.5  menu "C compiler"
     1.6  
     1.7 -comment "Core C Compiler (used to build the C library)"
     1.8 -
     1.9 -config CC_USE_CORE
    1.10 -    bool
    1.11 -    prompt "Use a different core C compiler"
    1.12 -    default n
    1.13 -    help
    1.14 -      Use a different compiler to build the C library than the one
    1.15 -      in the final toolchain.
    1.16 -      
    1.17 -      You can change the compiler used, or only the version used.
    1.18 -
    1.19 -      You most probably don't need that.
    1.20 -
    1.21  choice
    1.22      bool
    1.23 -    prompt "Core C compiler:"
    1.24 -    depends on CC_USE_CORE
    1.25 -
    1.26 -config CC_CORE_GCC
    1.27 -    bool
    1.28 -    prompt "gcc"
    1.29 -
    1.30 -endchoice
    1.31 -
    1.32 -config CC_CORE_VERSION
    1.33 -    string
    1.34 -
    1.35 -config CC_CORE
    1.36 -    string
    1.37 -    default "gcc" if CC_CORE_GCC
    1.38 -
    1.39 -if CC_CORE_GCC && CC_USE_CORE
    1.40 -source config/cc_core_gcc.in
    1.41 -endif
    1.42 -
    1.43 -comment "Final C compiler"
    1.44 -
    1.45 -choice
    1.46 -    bool
    1.47 -    prompt "Final C compiler"
    1.48 +    prompt "C compiler flavour"
    1.49      default CC_GCC
    1.50  
    1.51  config CC_GCC
    1.52 @@ -54,6 +16,11 @@
    1.53      select CC_SUPPORT_ADA
    1.54      select CC_SUPPORT_OBJC
    1.55      select CC_SUPPORT_OBJCXX
    1.56 +    help
    1.57 +      gcc is the full-blown GNU compiler. This is what most people will choose.
    1.58 +      
    1.59 +      gcc sports lots of languages, powerfull code parser, optimised binary output,
    1.60 +      and lots of other features.
    1.61  
    1.62  endchoice
    1.63  
     2.1 --- a/config/cc_core_gcc.in	Tue Aug 14 20:11:44 2007 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,166 +0,0 @@
     2.4 -# Compiler options
     2.5 -
     2.6 -choice
     2.7 -    bool
     2.8 -    prompt "Core gcc version"
     2.9 -
    2.10 -config CC_CORE_V_2_95_3
    2.11 -    bool
    2.12 -    prompt "2.95.3"
    2.13 -    depends on OBSOLETE
    2.14 -
    2.15 -config CC_CORE_V_3_2_3
    2.16 -    bool
    2.17 -    prompt "3.2.3"
    2.18 -    depends on OBSOLETE
    2.19 -
    2.20 -config CC_CORE_V_3_3
    2.21 -    bool
    2.22 -    prompt "3.3"
    2.23 -    depends on OBSOLETE
    2.24 -
    2.25 -config CC_CORE_V_3_3_1
    2.26 -    bool
    2.27 -    prompt "3.3.1"
    2.28 -    depends on OBSOLETE
    2.29 -
    2.30 -config CC_CORE_V_3_3_2
    2.31 -    bool
    2.32 -    prompt "3.3.2"
    2.33 -    depends on OBSOLETE
    2.34 -
    2.35 -config CC_CORE_V_3_3_3
    2.36 -    bool
    2.37 -    prompt "3.3.3"
    2.38 -    depends on OBSOLETE
    2.39 -
    2.40 -config CC_CORE_V_3_3_4
    2.41 -    bool
    2.42 -    prompt "3.3.4"
    2.43 -    depends on OBSOLETE
    2.44 -
    2.45 -config CC_CORE_V_3_3_5
    2.46 -    bool
    2.47 -    prompt "3.3.5"
    2.48 -    depends on OBSOLETE
    2.49 -
    2.50 -config CC_CORE_V_3_3_6
    2.51 -    bool
    2.52 -    prompt "3.3.6"
    2.53 -
    2.54 -config CC_CORE_V_3_4_0
    2.55 -    bool
    2.56 -    prompt "3.4.0"
    2.57 -    depends on OBSOLETE
    2.58 -
    2.59 -config CC_CORE_V_3_4_1
    2.60 -    bool
    2.61 -    prompt "3.4.1"
    2.62 -    depends on OBSOLETE
    2.63 -
    2.64 -config CC_CORE_V_3_4_2
    2.65 -    bool
    2.66 -    prompt "3.4.2"
    2.67 -    depends on OBSOLETE
    2.68 -
    2.69 -config CC_CORE_V_3_4_3
    2.70 -    bool
    2.71 -    prompt "3.4.3"
    2.72 -    depends on OBSOLETE
    2.73 -
    2.74 -config CC_CORE_V_3_4_4
    2.75 -    bool
    2.76 -    prompt "3.4.4"
    2.77 -    depends on OBSOLETE
    2.78 -
    2.79 -config CC_CORE_V_3_4_5
    2.80 -    bool
    2.81 -    prompt "3.4.5"
    2.82 -    depends on OBSOLETE
    2.83 -
    2.84 -config CC_CORE_V_3_4_6
    2.85 -    bool
    2.86 -    prompt "3.4.6"
    2.87 -
    2.88 -config CC_CORE_V_4_0_0
    2.89 -    bool
    2.90 -    prompt "4.0.0"
    2.91 -
    2.92 -config CC_CORE_V_4_0_1
    2.93 -    bool
    2.94 -    prompt "4.0.1"
    2.95 -
    2.96 -config CC_CORE_V_4_0_2
    2.97 -    bool
    2.98 -    prompt "4.0.2"
    2.99 -
   2.100 -config CC_CORE_V_4_0_3
   2.101 -    bool
   2.102 -    prompt "4.0.3"
   2.103 -
   2.104 -config CC_CORE_V_4_0_4
   2.105 -    bool
   2.106 -    prompt "4.0.4"
   2.107 -
   2.108 -config CC_CORE_V_4_1_0
   2.109 -    bool
   2.110 -    prompt "4.1.0"
   2.111 -
   2.112 -config CC_CORE_V_4_1_1
   2.113 -    bool
   2.114 -    prompt "4.1.1"
   2.115 -
   2.116 -config CC_CORE_V_4_1_2
   2.117 -    bool
   2.118 -    prompt "4.1.2"
   2.119 -
   2.120 -config CC_CORE_V_4_2_0
   2.121 -    bool
   2.122 -    prompt "4.2.0"
   2.123 -
   2.124 -config CC_CORE_V_4_2_1
   2.125 -    bool
   2.126 -    prompt "4.2.1"
   2.127 -
   2.128 -# CT_INSERT_VERSION_ABOVE
   2.129 -# Don't remove above line!
   2.130 -endchoice
   2.131 -
   2.132 -config CC_CORE_VERSION
   2.133 -    string
   2.134 -    default "2.95.3" if CC_CORE_V_2_95_3
   2.135 -    default "3.2.3" if CC_CORE_V_3_2_3
   2.136 -    default "3.3" if CC_CORE_V_3_3
   2.137 -    default "3.3.1" if CC_CORE_V_3_3_1
   2.138 -    default "3.3.2" if CC_CORE_V_3_3_2
   2.139 -    default "3.3.3" if CC_CORE_V_3_3_3
   2.140 -    default "3.3.4" if CC_CORE_V_3_3_4
   2.141 -    default "3.3.5" if CC_CORE_V_3_3_5
   2.142 -    default "3.3.6" if CC_CORE_V_3_3_6
   2.143 -    default "3.4.0" if CC_CORE_V_3_4_0
   2.144 -    default "3.4.1" if CC_CORE_V_3_4_1
   2.145 -    default "3.4.2" if CC_CORE_V_3_4_2
   2.146 -    default "3.4.3" if CC_CORE_V_3_4_3
   2.147 -    default "3.4.4" if CC_CORE_V_3_4_4
   2.148 -    default "3.4.5" if CC_CORE_V_3_4_5
   2.149 -    default "3.4.6" if CC_CORE_V_3_4_6
   2.150 -    default "4.0.0" if CC_CORE_V_4_0_0
   2.151 -    default "4.0.1" if CC_CORE_V_4_0_1
   2.152 -    default "4.0.2" if CC_CORE_V_4_0_2
   2.153 -    default "4.0.3" if CC_CORE_V_4_0_3
   2.154 -    default "4.0.4" if CC_CORE_V_4_0_4
   2.155 -    default "4.1.0" if CC_CORE_V_4_1_0
   2.156 -    default "4.1.1" if CC_CORE_V_4_1_1
   2.157 -    default "4.1.2" if CC_CORE_V_4_1_2
   2.158 -    default "4.2.0" if CC_CORE_V_4_2_0
   2.159 -    default "4.2.1" if CC_CORE_V_4_2_1
   2.160 -# CT_INSERT_VERSION_STRING_ABOVE
   2.161 -# Don't remove above line!
   2.162 -
   2.163 -config CC_CORE_EXTRA_CONFIG
   2.164 -    string
   2.165 -    prompt "Core gcc extra config"
   2.166 -    default ""
   2.167 -    depends on CC_USE_CORE && CC_CORE_GCC || ! CC_USE_CORE && CC_GCC
   2.168 -    help
   2.169 -      Extra flags to pass onto ./configure when configuring the core gcc.
     3.1 --- a/config/cc_gcc.in	Tue Aug 14 20:11:44 2007 +0000
     3.2 +++ b/config/cc_gcc.in	Wed Aug 15 10:14:43 2007 +0000
     3.3 @@ -2,7 +2,7 @@
     3.4  
     3.5  choice
     3.6      bool
     3.7 -    prompt "Final gcc version"
     3.8 +    prompt "gcc version"
     3.9  
    3.10  config CC_V_2_95_3
    3.11      bool
    3.12 @@ -95,9 +95,19 @@
    3.13        If you get the missing symbol "__cxa_atexit" when building c++ programs,
    3.14        you might want to try disabling this option.
    3.15  
    3.16 +config CC_CORE_EXTRA_CONFIG
    3.17 +    string
    3.18 +    prompt "Core gcc extra config"
    3.19 +    default ""
    3.20 +    help
    3.21 +      Extra flags to pass onto ./configure when configuring the core gcc.
    3.22 +      
    3.23 +      The core gcc is a stripped down, C-only compiler needed to build
    3.24 +      the C library. Kinda bootstrap gcc, if you wish.
    3.25 +
    3.26  config CC_EXTRA_CONFIG
    3.27      string
    3.28 -    prompt "Final gcc extra config"
    3.29 +    prompt "gcc extra config"
    3.30      default ""
    3.31      help
    3.32        Extra flags to pass onto ./configure when configuring gcc.
     4.1 --- a/scripts/build/binutils.sh	Tue Aug 14 20:11:44 2007 +0000
     4.2 +++ b/scripts/build/binutils.sh	Wed Aug 15 10:14:43 2007 +0000
     4.3 @@ -43,7 +43,7 @@
     4.4      CT_DoLog EXTRA "Installing binutils"
     4.5      make install            2>&1 |CT_DoLog ALL
     4.6  
     4.7 -    # Make those new tools available to the core C compilers to come:
     4.8 +    # Make those new tools available to the core C compilers to come.
     4.9      # Note: some components want the ${TARGET}-{ar,as,ld,strip} commands as
    4.10      # well. Create that.
    4.11      mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/bin"
     5.1 --- a/scripts/build/cc_core_gcc.sh	Tue Aug 14 20:11:44 2007 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,195 +0,0 @@
     5.4 -# This file adds the function to build the core gcc C compiler
     5.5 -# Copyright 2007 Yann E. MORIN
     5.6 -# Licensed under the GPL v2. See COPYING in the root of this package
     5.7 -
     5.8 -do_print_filename() {
     5.9 -    [ "${CT_CC_CORE}" = "gcc" ] || return 0
    5.10 -    echo "gcc-${CT_CC_CORE_VERSION}"
    5.11 -}
    5.12 -
    5.13 -# Download core gcc
    5.14 -do_cc_core_get() {
    5.15 -    # Ah! gcc folks are kind of 'different': they store the tarballs in
    5.16 -    # subdirectories of the same name! That's because gcc is such /crap/ that
    5.17 -    # it is such /big/ that it needs being splitted for distribution! Sad. :-(
    5.18 -    # Arrgghh! Some of those versions does not follow this convention:
    5.19 -    # gcc-3.3.3 lives in releases/gcc-3.3.3, while gcc-2.95.* isn't in a
    5.20 -    # subdirectory! You bastard!
    5.21 -    CT_GetFile "${CT_CC_CORE_FILE}"                                    \
    5.22 -               ftp://ftp.gnu.org/gnu/gcc/${CT_CC_CORE_FILE}            \
    5.23 -               ftp://ftp.gnu.org/gnu/gcc/releases/${CT_CC_CORE_FILE}   \
    5.24 -               ftp://ftp.gnu.org/gnu/gcc
    5.25 -}
    5.26 -
    5.27 -# Extract core gcc
    5.28 -do_cc_core_extract() {
    5.29 -    CT_ExtractAndPatch "${CT_CC_CORE_FILE}"
    5.30 -}
    5.31 -
    5.32 -# Core gcc pass 1
    5.33 -do_cc_core_pass_1() {
    5.34 -    # In case we're NPTL, build the static core gcc;
    5.35 -    # in any other case, do nothing.
    5.36 -    case "${CT_THREADS}" in
    5.37 -        nptl)   do_cc_core_static;;
    5.38 -        *)      ;;
    5.39 -    esac
    5.40 -}
    5.41 -
    5.42 -# Core gcc pass 2
    5.43 -do_cc_core_pass_2() {
    5.44 -    # In case we're NPTL, build the shared core gcc,
    5.45 -    # in any other case, build the static core gcc.
    5.46 -    case "${CT_THREADS}" in
    5.47 -        nptl)   do_cc_core_shared;;
    5.48 -        *)      do_cc_core_static;;
    5.49 -    esac
    5.50 -}
    5.51 -
    5.52 -# Build static core gcc
    5.53 -do_cc_core_static() {
    5.54 -    mkdir -p "${CT_BUILD_DIR}/build-cc-core-static"
    5.55 -    cd "${CT_BUILD_DIR}/build-cc-core-static"
    5.56 -
    5.57 -    CT_DoStep INFO "Installing static core C compiler"
    5.58 -
    5.59 -    CT_DoLog EXTRA "Copying headers to install area of bootstrap gcc, so it can build libgcc2"
    5.60 -    mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/include"
    5.61 -    cp -r "${CT_HEADERS_DIR}"/* "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/include" 2>&1 |CT_DoLog DEBUG
    5.62 -
    5.63 -    CT_DoLog EXTRA "Configuring static core C compiler"
    5.64 -
    5.65 -    extra_config=""
    5.66 -    [ "${CT_ARCH_FLOAT_SW}" = "y" ] && extra_config="${extra_config} --with-float=soft"
    5.67 -    [ -n "${CT_ARCH_ABI}" ]  && extra_config="${extra_config} --with-abi=${CT_ARCH_ABI}"
    5.68 -    [ -n "${CT_ARCH_ARCH}" ] && extra_config="${extra_config} --with-arch=${CT_ARCH_ARCH}"
    5.69 -    [ -n "${CT_ARCH_CPU}" ]  && extra_config="${extra_config} --with-cpu=${CT_ARCH_CPU}"
    5.70 -    [ -n "${CT_ARCH_TUNE}" ] && extra_config="${extra_config} --with-tune=${CT_ARCH_TUNE}"
    5.71 -    [ -n "${CT_ARCH_FPU}" ] && extra_config="${extra_config} --with-fpu=${CT_ARCH_FPU}"
    5.72 -    [ "${CT_CC_CXA_ATEXIT}" = "y" ] && extra_config="${extra_config} --enable-__cxa_atexit"
    5.73 -
    5.74 -    CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
    5.75 -
    5.76 -    # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532)
    5.77 -    CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
    5.78 -    "${CT_SRC_DIR}/${CT_CC_CORE_FILE}/configure"    \
    5.79 -        ${CT_CANADIAN_OPT}                          \
    5.80 -        --host=${CT_HOST}                           \
    5.81 -        --target=${CT_TARGET}                       \
    5.82 -        --prefix="${CT_CC_CORE_STATIC_PREFIX_DIR}"  \
    5.83 -        --with-local-prefix="${CT_SYSROOT_DIR}"     \
    5.84 -        --disable-multilib                          \
    5.85 -        --with-newlib                               \
    5.86 -        ${CC_CORE_SYSROOT_ARG}                      \
    5.87 -        ${extra_config}                             \
    5.88 -        --disable-nls                               \
    5.89 -        --enable-threads=no                         \
    5.90 -        --enable-symvers=gnu                        \
    5.91 -        --enable-languages=c                        \
    5.92 -        --disable-shared                            \
    5.93 -        ${CT_CC_CORE_EXTRA_CONFIG}                  2>&1 |CT_DoLog ALL
    5.94 -
    5.95 -    if [ "${CT_CANADIAN}" = "y" ]; then
    5.96 -        CT_DoLog EXTRA "Building libiberty"
    5.97 -        make ${PARALLELMFLAGS} all-build-libiberty 2>&1 |CT_DoLog ALL
    5.98 -    fi
    5.99 -
   5.100 -    CT_DoLog EXTRA "Building static core C compiler"
   5.101 -    make ${PARALLELMFLAGS} all-gcc 2>&1 |CT_DoLog ALL
   5.102 -
   5.103 -    CT_DoLog EXTRA "Installing static core C compiler"
   5.104 -    make install-gcc 2>&1 |CT_DoLog ALL
   5.105 -
   5.106 -    CT_EndStep
   5.107 -}
   5.108 -
   5.109 -# Build shared core gcc
   5.110 -do_cc_core_shared() {
   5.111 -    mkdir -p "${CT_BUILD_DIR}/build-cc-core-shared"
   5.112 -    cd "${CT_BUILD_DIR}/build-cc-core-shared"
   5.113 -
   5.114 -    CT_DoStep INFO "Installing shared core C compiler"
   5.115 -
   5.116 -    CT_DoLog EXTRA "Copying headers to install area of bootstrap gcc, so it can build libgcc2"
   5.117 -    mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/include"
   5.118 -    cp -r "${CT_HEADERS_DIR}"/* "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/include" 2>&1 |CT_DoLog DEBUG
   5.119 -
   5.120 -    CT_DoLog EXTRA "Configuring shared core C compiler"
   5.121 -
   5.122 -    extra_config=""
   5.123 -    [ "${CT_ARCH_FLOAT_SW}" = "y" ] && extra_config="${extra_config} --with-float=soft"
   5.124 -    [ -n "${CT_ARCH_ABI}" ]  && extra_config="${extra_config} --with-abi=${CT_ARCH_ABI}"
   5.125 -    [ -n "${CT_ARCH_ARCH}" ] && extra_config="${extra_config} --with-arch=${CT_ARCH_ARCH}"
   5.126 -    [ -n "${CT_ARCH_CPU}" ]  && extra_config="${extra_config} --with-cpu=${CT_ARCH_CPU}"
   5.127 -    [ -n "${CT_ARCH_TUNE}" ] && extra_config="${extra_config} --with-tune=${CT_ARCH_TUNE}"
   5.128 -    [ -n "${CT_ARCH_FPU}" ] && extra_config="${extra_config} --with-fpu=${CT_ARCH_FPU}"
   5.129 -    [ "${CT_CC_CXA_ATEXIT}" = "y" ] && extra_config="${extra_config} --enable-__cxa_atexit"
   5.130 -
   5.131 -    CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
   5.132 -
   5.133 -    CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
   5.134 -    "${CT_SRC_DIR}/${CT_CC_CORE_FILE}/configure"    \
   5.135 -        ${CT_CANADIAN_OPT}                          \
   5.136 -        --target=${CT_TARGET}                       \
   5.137 -        --host=${CT_HOST}                           \
   5.138 -        --prefix="${CT_CC_CORE_SHARED_PREFIX_DIR}"  \
   5.139 -        --with-local-prefix="${CT_SYSROOT_DIR}"     \
   5.140 -        --disable-multilib                          \
   5.141 -        ${CC_CORE_SYSROOT_ARG}                      \
   5.142 -        ${extra_config}                             \
   5.143 -        --disable-nls                               \
   5.144 -        --enable-symvers=gnu                        \
   5.145 -        --enable-languages=c                        \
   5.146 -        --enable-shared                             \
   5.147 -        ${CT_CC_CORE_EXTRA_CONFIG}                  2>&1 |CT_DoLog ALL
   5.148 -
   5.149 -    # HACK: we need to override SHLIB_LC from gcc/config/t-slibgcc-elf-ver or
   5.150 -    # gcc/config/t-libunwind so -lc is removed from the link for
   5.151 -    # libgcc_s.so, as we do not have a target -lc yet.
   5.152 -    # This is not as ugly as it appears to be ;-) All symbols get resolved
   5.153 -    # during the glibc build, and we provide a proper libgcc_s.so for the
   5.154 -    # cross toolchain during the final gcc build.
   5.155 -    #
   5.156 -    # As we cannot modify the source tree, nor override SHLIB_LC itself
   5.157 -    # during configure or make, we have to edit the resultant
   5.158 -    # gcc/libgcc.mk itself to remove -lc from the link.
   5.159 -    # This causes us to have to jump through some hoops...
   5.160 -    #
   5.161 -    # To produce libgcc.mk to edit we firstly require libiberty.a,
   5.162 -    # so we configure then build it.
   5.163 -    # Next we have to configure gcc, create libgcc.mk then edit it...
   5.164 -    # So much easier if we just edit the source tree, but hey...
   5.165 -    if [ ! -f "${CT_SRC_DIR}/${CT_CC_CORE_FILE}/gcc/BASE-VER" ]; then
   5.166 -        make configure-libiberty
   5.167 -        make -C libiberty libiberty.a
   5.168 -        make configure-gcc
   5.169 -        make configure-libcpp
   5.170 -        make all-libcpp
   5.171 -    else
   5.172 -        make configure-gcc
   5.173 -        make configure-libcpp
   5.174 -        make configure-build-libiberty
   5.175 -        make all-libcpp
   5.176 -        make all-build-libiberty
   5.177 -    fi 2>&1 |CT_DoLog ALL
   5.178 -    # HACK: gcc-4.2 uses libdecnumber to build libgcc.mk, so build it here.
   5.179 -    if [ -d "${CT_SRC_DIR}/${CT_CC_CORE_FILE}/libdecnumber" ]; then
   5.180 -        make configure-libdecnumber
   5.181 -        make -C libdecnumber libdecnumber.a
   5.182 -    fi 2>&1 |CT_DoLog ALL
   5.183 -    make -C gcc libgcc.mk 2>&1 |CT_DoLog ALL
   5.184 -    sed -r -i -e 's@-lc@@g' gcc/libgcc.mk
   5.185 -
   5.186 -    if [ "${CT_CANADIAN}" = "y" ]; then
   5.187 -        CT_DoLog EXTRA "Building libiberty"
   5.188 -        make ${PARALLELMFLAGS} all-build-libiberty 2>&1 |CT_DoLog ALL
   5.189 -    fi
   5.190 -
   5.191 -    CT_DoLog EXTRA "Building shared core C compiler"
   5.192 -    make ${PARALLELMFLAGS} all-gcc 2>&1 |CT_DoLog ALL
   5.193 -
   5.194 -    CT_DoLog EXTRA "Installing shared core C compiler"
   5.195 -    make install-gcc 2>&1 |CT_DoLog ALL
   5.196 -
   5.197 -    CT_EndStep
   5.198 -}
     6.1 --- a/scripts/build/cc_gcc.sh	Tue Aug 14 20:11:44 2007 +0000
     6.2 +++ b/scripts/build/cc_gcc.sh	Wed Aug 15 10:14:43 2007 +0000
     6.3 @@ -1,4 +1,4 @@
     6.4 -# This file adds the function to build the final gcc C compiler
     6.5 +# This file adds the function to build the gcc C compiler
     6.6  # Copyright 2007 Yann E. MORIN
     6.7  # Licensed under the GPL v2. See COPYING in the root of this package
     6.8  
     6.9 @@ -26,6 +26,178 @@
    6.10      CT_ExtractAndPatch "${CT_CC_FILE}"
    6.11  }
    6.12  
    6.13 +#------------------------------------------------------------------------------
    6.14 +# Core gcc pass 1
    6.15 +do_cc_core_pass_1() {
    6.16 +    # In case we're NPTL, build the static core gcc;
    6.17 +    # in any other case, do nothing.
    6.18 +    case "${CT_THREADS}" in
    6.19 +        nptl)   do_cc_core_static;;
    6.20 +        *)      ;;
    6.21 +    esac
    6.22 +}
    6.23 +
    6.24 +# Core gcc pass 2
    6.25 +do_cc_core_pass_2() {
    6.26 +    # In case we're NPTL, build the shared core gcc,
    6.27 +    # in any other case, build the static core gcc.
    6.28 +    case "${CT_THREADS}" in
    6.29 +        nptl)   do_cc_core_shared;;
    6.30 +        *)      do_cc_core_static;;
    6.31 +    esac
    6.32 +}
    6.33 +
    6.34 +#------------------------------------------------------------------------------
    6.35 +# Build static core gcc
    6.36 +do_cc_core_static() {
    6.37 +    mkdir -p "${CT_BUILD_DIR}/build-cc-core-static"
    6.38 +    cd "${CT_BUILD_DIR}/build-cc-core-static"
    6.39 +
    6.40 +    CT_DoStep INFO "Installing static core C compiler"
    6.41 +
    6.42 +    CT_DoLog EXTRA "Copying headers to install area of bootstrap gcc, so it can build libgcc2"
    6.43 +    mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/include"
    6.44 +    cp -r "${CT_HEADERS_DIR}"/* "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/include" 2>&1 |CT_DoLog DEBUG
    6.45 +
    6.46 +    CT_DoLog EXTRA "Configuring static core C compiler"
    6.47 +
    6.48 +    extra_config=""
    6.49 +    [ "${CT_ARCH_FLOAT_SW}" = "y" ] && extra_config="${extra_config} --with-float=soft"
    6.50 +    [ -n "${CT_ARCH_ABI}" ]  && extra_config="${extra_config} --with-abi=${CT_ARCH_ABI}"
    6.51 +    [ -n "${CT_ARCH_ARCH}" ] && extra_config="${extra_config} --with-arch=${CT_ARCH_ARCH}"
    6.52 +    [ -n "${CT_ARCH_CPU}" ]  && extra_config="${extra_config} --with-cpu=${CT_ARCH_CPU}"
    6.53 +    [ -n "${CT_ARCH_TUNE}" ] && extra_config="${extra_config} --with-tune=${CT_ARCH_TUNE}"
    6.54 +    [ -n "${CT_ARCH_FPU}" ] && extra_config="${extra_config} --with-fpu=${CT_ARCH_FPU}"
    6.55 +    [ "${CT_CC_CXA_ATEXIT}" = "y" ] && extra_config="${extra_config} --enable-__cxa_atexit"
    6.56 +
    6.57 +    CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
    6.58 +
    6.59 +    # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532)
    6.60 +    CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
    6.61 +    "${CT_SRC_DIR}/${CT_CC_FILE}/configure"         \
    6.62 +        ${CT_CANADIAN_OPT}                          \
    6.63 +        --host=${CT_HOST}                           \
    6.64 +        --target=${CT_TARGET}                       \
    6.65 +        --prefix="${CT_CC_CORE_STATIC_PREFIX_DIR}"  \
    6.66 +        --with-local-prefix="${CT_SYSROOT_DIR}"     \
    6.67 +        --disable-multilib                          \
    6.68 +        --with-newlib                               \
    6.69 +        ${CC_CORE_SYSROOT_ARG}                      \
    6.70 +        ${extra_config}                             \
    6.71 +        --disable-nls                               \
    6.72 +        --enable-threads=no                         \
    6.73 +        --enable-symvers=gnu                        \
    6.74 +        --enable-languages=c                        \
    6.75 +        --disable-shared                            \
    6.76 +        ${CT_CC_CORE_EXTRA_CONFIG}                  2>&1 |CT_DoLog ALL
    6.77 +
    6.78 +    if [ "${CT_CANADIAN}" = "y" ]; then
    6.79 +        CT_DoLog EXTRA "Building libiberty"
    6.80 +        make ${PARALLELMFLAGS} all-build-libiberty 2>&1 |CT_DoLog ALL
    6.81 +    fi
    6.82 +
    6.83 +    CT_DoLog EXTRA "Building static core C compiler"
    6.84 +    make ${PARALLELMFLAGS} all-gcc 2>&1 |CT_DoLog ALL
    6.85 +
    6.86 +    CT_DoLog EXTRA "Installing static core C compiler"
    6.87 +    make install-gcc 2>&1 |CT_DoLog ALL
    6.88 +
    6.89 +    CT_EndStep
    6.90 +}
    6.91 +
    6.92 +#------------------------------------------------------------------------------
    6.93 +# Build shared core gcc
    6.94 +do_cc_core_shared() {
    6.95 +    mkdir -p "${CT_BUILD_DIR}/build-cc-core-shared"
    6.96 +    cd "${CT_BUILD_DIR}/build-cc-core-shared"
    6.97 +
    6.98 +    CT_DoStep INFO "Installing shared core C compiler"
    6.99 +
   6.100 +    CT_DoLog EXTRA "Copying headers to install area of bootstrap gcc, so it can build libgcc2"
   6.101 +    mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/include"
   6.102 +    cp -r "${CT_HEADERS_DIR}"/* "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/include" 2>&1 |CT_DoLog DEBUG
   6.103 +
   6.104 +    CT_DoLog EXTRA "Configuring shared core C compiler"
   6.105 +
   6.106 +    extra_config=""
   6.107 +    [ "${CT_ARCH_FLOAT_SW}" = "y" ] && extra_config="${extra_config} --with-float=soft"
   6.108 +    [ -n "${CT_ARCH_ABI}" ]  && extra_config="${extra_config} --with-abi=${CT_ARCH_ABI}"
   6.109 +    [ -n "${CT_ARCH_ARCH}" ] && extra_config="${extra_config} --with-arch=${CT_ARCH_ARCH}"
   6.110 +    [ -n "${CT_ARCH_CPU}" ]  && extra_config="${extra_config} --with-cpu=${CT_ARCH_CPU}"
   6.111 +    [ -n "${CT_ARCH_TUNE}" ] && extra_config="${extra_config} --with-tune=${CT_ARCH_TUNE}"
   6.112 +    [ -n "${CT_ARCH_FPU}" ] && extra_config="${extra_config} --with-fpu=${CT_ARCH_FPU}"
   6.113 +    [ "${CT_CC_CXA_ATEXIT}" = "y" ] && extra_config="${extra_config} --enable-__cxa_atexit"
   6.114 +
   6.115 +    CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
   6.116 +
   6.117 +    CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
   6.118 +    "${CT_SRC_DIR}/${CT_CC_FILE}/configure"         \
   6.119 +        ${CT_CANADIAN_OPT}                          \
   6.120 +        --target=${CT_TARGET}                       \
   6.121 +        --host=${CT_HOST}                           \
   6.122 +        --prefix="${CT_CC_CORE_SHARED_PREFIX_DIR}"  \
   6.123 +        --with-local-prefix="${CT_SYSROOT_DIR}"     \
   6.124 +        --disable-multilib                          \
   6.125 +        ${CC_CORE_SYSROOT_ARG}                      \
   6.126 +        ${extra_config}                             \
   6.127 +        --disable-nls                               \
   6.128 +        --enable-symvers=gnu                        \
   6.129 +        --enable-languages=c                        \
   6.130 +        --enable-shared                             \
   6.131 +        ${CT_CC_CORE_EXTRA_CONFIG}                  2>&1 |CT_DoLog ALL
   6.132 +
   6.133 +    # HACK: we need to override SHLIB_LC from gcc/config/t-slibgcc-elf-ver or
   6.134 +    # gcc/config/t-libunwind so -lc is removed from the link for
   6.135 +    # libgcc_s.so, as we do not have a target -lc yet.
   6.136 +    # This is not as ugly as it appears to be ;-) All symbols get resolved
   6.137 +    # during the glibc build, and we provide a proper libgcc_s.so for the
   6.138 +    # cross toolchain during the final gcc build.
   6.139 +    #
   6.140 +    # As we cannot modify the source tree, nor override SHLIB_LC itself
   6.141 +    # during configure or make, we have to edit the resultant
   6.142 +    # gcc/libgcc.mk itself to remove -lc from the link.
   6.143 +    # This causes us to have to jump through some hoops...
   6.144 +    #
   6.145 +    # To produce libgcc.mk to edit we firstly require libiberty.a,
   6.146 +    # so we configure then build it.
   6.147 +    # Next we have to configure gcc, create libgcc.mk then edit it...
   6.148 +    # So much easier if we just edit the source tree, but hey...
   6.149 +    if [ ! -f "${CT_SRC_DIR}/${CT_CC_FILE}/gcc/BASE-VER" ]; then
   6.150 +        make configure-libiberty
   6.151 +        make -C libiberty libiberty.a
   6.152 +        make configure-gcc
   6.153 +        make configure-libcpp
   6.154 +        make all-libcpp
   6.155 +    else
   6.156 +        make configure-gcc
   6.157 +        make configure-libcpp
   6.158 +        make configure-build-libiberty
   6.159 +        make all-libcpp
   6.160 +        make all-build-libiberty
   6.161 +    fi 2>&1 |CT_DoLog ALL
   6.162 +    # HACK: gcc-4.2 uses libdecnumber to build libgcc.mk, so build it here.
   6.163 +    if [ -d "${CT_SRC_DIR}/${CT_CC_FILE}/libdecnumber" ]; then
   6.164 +        make configure-libdecnumber
   6.165 +        make -C libdecnumber libdecnumber.a
   6.166 +    fi 2>&1 |CT_DoLog ALL
   6.167 +    make -C gcc libgcc.mk 2>&1 |CT_DoLog ALL
   6.168 +    sed -r -i -e 's@-lc@@g' gcc/libgcc.mk
   6.169 +
   6.170 +    if [ "${CT_CANADIAN}" = "y" ]; then
   6.171 +        CT_DoLog EXTRA "Building libiberty"
   6.172 +        make ${PARALLELMFLAGS} all-build-libiberty 2>&1 |CT_DoLog ALL
   6.173 +    fi
   6.174 +
   6.175 +    CT_DoLog EXTRA "Building shared core C compiler"
   6.176 +    make ${PARALLELMFLAGS} all-gcc 2>&1 |CT_DoLog ALL
   6.177 +
   6.178 +    CT_DoLog EXTRA "Installing shared core C compiler"
   6.179 +    make install-gcc 2>&1 |CT_DoLog ALL
   6.180 +
   6.181 +    CT_EndStep
   6.182 +}
   6.183 +
   6.184 +#------------------------------------------------------------------------------
   6.185  # Build final gcc
   6.186  do_cc() {
   6.187      CT_DoStep INFO "Installing final compiler"
     7.1 --- a/scripts/build/libc_glibc.sh	Tue Aug 14 20:11:44 2007 +0000
     7.2 +++ b/scripts/build/libc_glibc.sh	Wed Aug 15 10:14:43 2007 +0000
     7.3 @@ -52,7 +52,7 @@
     7.4  do_libc_headers() {
     7.5      # Only need to install bootstrap glibc headers for gcc-3.0 and above?  Or maybe just gcc-3.3 and above?
     7.6      # See also http://gcc.gnu.org/PR8180, which complains about the need for this step.
     7.7 -    grep -q 'gcc-[34]' "${CT_SRC_DIR}/${CT_CC_CORE_FILE}/ChangeLog" || return 0
     7.8 +    grep -q 'gcc-[34]' "${CT_SRC_DIR}/${CT_CC_FILE}/ChangeLog" 2>/dev/null || return 0
     7.9  
    7.10      CT_DoStep INFO "Installing C library headers"
    7.11  
     8.1 --- a/scripts/build/libc_uClibc.sh	Tue Aug 14 20:11:44 2007 +0000
     8.2 +++ b/scripts/build/libc_uClibc.sh	Wed Aug 15 10:14:43 2007 +0000
     8.3 @@ -53,7 +53,7 @@
     8.4  do_libc_headers() {
     8.5      # Only need to install bootstrap uClibc headers for gcc-3.0 and above?  Or maybe just gcc-3.3 and above?
     8.6      # See also http://gcc.gnu.org/PR8180, which complains about the need for this step.
     8.7 -    grep -q 'gcc-[34]' "${CT_SRC_DIR}/${CT_CC_CORE_FILE}/ChangeLog" || return 0
     8.8 +    grep -q 'gcc-[34]' "${CT_SRC_DIR}/${CT_CC_FILE}/ChangeLog" 2>/dev/null || return 0
     8.9  
    8.10      CT_DoStep INFO "Installing C library headers"
    8.11  
     9.1 --- a/scripts/crosstool.sh	Tue Aug 14 20:11:44 2007 +0000
     9.2 +++ b/scripts/crosstool.sh	Wed Aug 15 10:14:43 2007 +0000
     9.3 @@ -82,12 +82,6 @@
     9.4  # Now, build up the variables from the user-configured options.
     9.5  CT_KERNEL_FILE="${CT_KERNEL}-${CT_KERNEL_VERSION}"
     9.6  CT_BINUTILS_FILE="binutils-${CT_BINUTILS_VERSION}"
     9.7 -if [ "${CT_CC_USE_CORE}" != "y" ]; then
     9.8 -    CT_CC_CORE="${CT_CC}"
     9.9 -    CT_CC_CORE_VERSION="${CT_CC_VERSION}"
    9.10 -    CT_CC_CORE_EXTRA_CONFIG="${CT_CC_EXTRA_CONFIG}"
    9.11 -fi
    9.12 -CT_CC_CORE_FILE="${CT_CC_CORE}-${CT_CC_CORE_VERSION}"
    9.13  CT_CC_FILE="${CT_CC}-${CT_CC_VERSION}"
    9.14  CT_LIBC_FILE="${CT_LIBC}-${CT_LIBC_VERSION}"
    9.15  
    9.16 @@ -97,8 +91,7 @@
    9.17  CT_BUILD_DIR="${CT_TOP_DIR}/targets/${CT_TARGET}/build"
    9.18  CT_DEBUG_INSTALL_DIR="${CT_INSTALL_DIR}/${CT_TARGET}/debug-root"
    9.19  # Note: we'll always install the core compiler in its own directory, so as to
    9.20 -# not mix the two builds: core and final. Anyway, its generic, wether we use
    9.21 -# a different compiler as core, or not.
    9.22 +# not mix the two builds: core and final.
    9.23  CT_CC_CORE_STATIC_PREFIX_DIR="${CT_BUILD_DIR}/${CT_CC}-core-static"
    9.24  CT_CC_CORE_SHARED_PREFIX_DIR="${CT_BUILD_DIR}/${CT_CC}-core-shared"
    9.25  CT_STATE_DIR="${CT_TOP_DIR}/targets/${CT_TARGET}/state"
    9.26 @@ -345,7 +338,6 @@
    9.27  . "${CT_LIB_DIR}/scripts/build/kernel_${CT_KERNEL}.sh"
    9.28  . "${CT_LIB_DIR}/scripts/build/binutils.sh"
    9.29  . "${CT_LIB_DIR}/scripts/build/libc_${CT_LIBC}.sh"
    9.30 -. "${CT_LIB_DIR}/scripts/build/cc_core_${CT_CC_CORE}.sh"
    9.31  . "${CT_LIB_DIR}/scripts/build/cc_${CT_CC}.sh"
    9.32  . "${CT_LIB_DIR}/scripts/build/debug.sh"
    9.33  . "${CT_LIB_DIR}/scripts/build/tools.sh"
    9.34 @@ -354,9 +346,8 @@
    9.35      CT_DoStep INFO "Retrieving needed toolchain components' tarballs"
    9.36      do_kernel_get
    9.37      do_binutils_get
    9.38 -    do_cc_core_get
    9.39 +    do_cc_get
    9.40      do_libc_get
    9.41 -    do_cc_get
    9.42      do_tools_get
    9.43      do_debug_get
    9.44      CT_EndStep
    9.45 @@ -369,9 +360,8 @@
    9.46          CT_DoStep INFO "Extracting and patching toolchain components"
    9.47          do_kernel_extract
    9.48          do_binutils_extract
    9.49 -        do_cc_core_extract
    9.50 +        do_cc_extract
    9.51          do_libc_extract
    9.52 -        do_cc_extract
    9.53          do_tools_extract
    9.54          do_debug_extract
    9.55          CT_EndStep