Add support for building toolchains with gcc-4.4 snapshots.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Mar 26 18:47:34 2009 +0000 (2009-03-26)
changeset 12685594b05bc2d8
parent 1267 ca485f06bfa7
child 1269 17e37102a037
Add support for building toolchains with gcc-4.4 snapshots.
Initial patch by Dmitry PLOTNIKOV: http://sourceware.org/ml/crossgcc/2009-03/msg00053.html
It [the toolchain] uses current ct-ng (nightly snapshot 20090324, latest
release 1.3.2 work also), glibc 2.9 (from CVS), binutils 2.19 and latest
snapshot of GCC 4.4.0 (as of March 20, 2009).

We have successfully built linux kernel 2.6.29 and a lot of other stuff
with this toolchain.

Here's the patch that adds GCC 4.4.0 to the ct-ng menu and enables it to
download a 4.4.0 snapshot from ftp.

Patch was adpated by me, mostly to better fit the configuration layout.

/trunk/scripts/build/cc/gcc.sh | 34 22 12 0 ++++++++++++++++++++++------------
/trunk/config/cc/gcc.in | 35 30 5 0 ++++++++++++++++++++++++++++++-----
2 files changed, 52 insertions(+), 17 deletions(-)
config/cc/gcc.in
scripts/build/cc/gcc.sh
     1.1 --- a/config/cc/gcc.in	Tue Mar 24 17:39:45 2009 +0000
     1.2 +++ b/config/cc/gcc.in	Thu Mar 26 18:47:34 2009 +0000
     1.3 @@ -112,10 +112,39 @@
     1.4      depends on EXPERIMENTAL
     1.5      select CC_GCC_4_3_or_later
     1.6  
     1.7 +config CC_V_4_4_0
     1.8 +    bool
     1.9 +    prompt "4.4.0 snapshot"
    1.10 +    depends on EXPERIMENTAL
    1.11 +    select CC_GCC_4_3_or_later
    1.12 +    select CC_GCC_4_4_snapshot
    1.13 +
    1.14  # CT_INSERT_VERSION_ABOVE
    1.15  # Don't remove above line!
    1.16  endchoice
    1.17  
    1.18 +config CC_GCC_4_3_or_later
    1.19 +    bool
    1.20 +    default n
    1.21 +    select GMP_MPFR
    1.22 +
    1.23 +config CC_GCC_4_4_snapshot
    1.24 +    bool
    1.25 +    default n
    1.26 +
    1.27 +config CC_GCC_4_4_snapshot_date
    1.28 +    string
    1.29 +    prompt "Snapshot date"
    1.30 +    depends on CC_GCC_4_4_snapshot
    1.31 +    help
    1.32 +      Enter the snapshot date in the form YYYYMMDD.
    1.33 +      Snapshots are made every friday, at around 22:30 GMT+1,
    1.34 +      so look at your calendar to find a suitable date.
    1.35 +      
    1.36 +      Also, know that crosstool-NG does *not* carry any patch
    1.37 +      for the gcc-4.4 snapshots. So, you may have to answer
    1.38 +      'y' to CUSTOM_PATCH, and set CUSTOM_PATCH_DIR adequately.
    1.39 +
    1.40  config CC_VERSION
    1.41      string
    1.42      default "3.2.3" if CC_V_3_2_3
    1.43 @@ -138,14 +167,10 @@
    1.44      default "4.3.1" if CC_V_4_3_1
    1.45      default "4.3.2" if CC_V_4_3_2
    1.46      default "4.3.3" if CC_V_4_3_3
    1.47 +    default "4.4-" if CC_V_4_4_0
    1.48  # CT_INSERT_VERSION_STRING_ABOVE
    1.49  # Don't remove above line!
    1.50  
    1.51 -config CC_GCC_4_3_or_later
    1.52 -    bool
    1.53 -    default n
    1.54 -    select GMP_MPFR
    1.55 -
    1.56  config CC_CXA_ATEXIT
    1.57      bool
    1.58      prompt "Use __cxa_atexit"
     2.1 --- a/scripts/build/cc/gcc.sh	Tue Mar 24 17:39:45 2009 +0000
     2.2 +++ b/scripts/build/cc/gcc.sh	Thu Mar 26 18:47:34 2009 +0000
     2.3 @@ -4,15 +4,19 @@
     2.4  
     2.5  # Download gcc
     2.6  do_cc_get() {
     2.7 +    local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}"
     2.8 +
     2.9      # Ah! gcc folks are kind of 'different': they store the tarballs in
    2.10      # subdirectories of the same name! That's because gcc is such /crap/ that
    2.11      # it is such /big/ that it needs being splitted for distribution! Sad. :-(
    2.12      # Arrgghh! Some of those versions does not follow this convention:
    2.13      # gcc-3.3.3 lives in releases/gcc-3.3.3, while gcc-2.95.* isn't in a
    2.14      # subdirectory! You bastard!
    2.15 -    CT_GetFile "gcc-${CT_CC_VERSION}"   \
    2.16 -               {ftp,http}://ftp.gnu.org/gnu/gcc{,{,/releases}/gcc-${CT_CC_VERSION}}     \
    2.17 -               ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/releases/gcc-${CT_CC_VERSION}
    2.18 +    CT_GetFile "gcc-${version}"                                                         \
    2.19 +               {ftp,http}://ftp.gnu.org/gnu/gcc{,{,/releases}/gcc-${version}}           \
    2.20 +               ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/releases/gcc-${version}   \
    2.21 +               ftp://ftp.uvsq.fr/pub/gcc/snapshots/${version}
    2.22 +
    2.23      # Starting with GCC 4.3, ecj is used for Java, and will only be
    2.24      # built if the configure script finds ecj.jar at the top of the
    2.25      # GCC source tree, which will not be there unless we get it and
    2.26 @@ -25,13 +29,16 @@
    2.27  
    2.28  # Extract gcc
    2.29  do_cc_extract() {
    2.30 -    CT_Extract "gcc-${CT_CC_VERSION}"
    2.31 -    CT_Patch "gcc-${CT_CC_VERSION}"
    2.32 +    local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}"
    2.33 +
    2.34 +    CT_Extract "gcc-${version}"
    2.35 +    CT_Patch "gcc-${version}"
    2.36 +
    2.37      # Copy ecj-latest.jar to ecj.jar at the top of the GCC source tree
    2.38 -    if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y"                     \
    2.39 -         -a ! -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/ecj.jar"   \
    2.40 +    if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y"             \
    2.41 +         -a ! -f "${CT_SRC_DIR}/gcc-${version}/ecj.jar" \
    2.42         ]; then
    2.43 -        CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/ecj-latest.jar" "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/ecj.jar"
    2.44 +        CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/ecj-latest.jar" "${CT_SRC_DIR}/gcc-${version}/ecj.jar"
    2.45      fi
    2.46  }
    2.47  
    2.48 @@ -83,6 +90,7 @@
    2.49      local core_prefix_dir
    2.50      local extra_config
    2.51      local lang_opt
    2.52 +    local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}"
    2.53  
    2.54      eval $1
    2.55      eval $2
    2.56 @@ -142,7 +150,7 @@
    2.57      CC_FOR_BUILD="${CT_BUILD}-gcc"                  \
    2.58      CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
    2.59      CT_DoExecLog ALL                                \
    2.60 -    "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure"  \
    2.61 +    "${CT_SRC_DIR}/gcc-${version}/configure"        \
    2.62          --build=${CT_BUILD}                         \
    2.63          --host=${CT_HOST}                           \
    2.64          --target=${CT_TARGET}                       \
    2.65 @@ -174,7 +182,7 @@
    2.66          # so we configure then build it.
    2.67          # Next we have to configure gcc, create libgcc.mk then edit it...
    2.68          # So much easier if we just edit the source tree, but hey...
    2.69 -        if [ ! -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" ]; then
    2.70 +        if [ ! -f "${CT_SRC_DIR}/gcc-${version}/gcc/BASE-VER" ]; then
    2.71              CT_DoExecLog ALL make configure-libiberty
    2.72              CT_DoExecLog ALL make ${PARALLELMFLAGS} -C libiberty libiberty.a
    2.73              CT_DoExecLog ALL make configure-gcc configure-libcpp
    2.74 @@ -184,7 +192,7 @@
    2.75              CT_DoExecLog ALL make ${PARALLELMFLAGS} all-libcpp all-build-libiberty
    2.76          fi
    2.77          # HACK: gcc-4.2 uses libdecnumber to build libgcc.mk, so build it here.
    2.78 -        if [ -d "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/libdecnumber" ]; then
    2.79 +        if [ -d "${CT_SRC_DIR}/gcc-${version}/libdecnumber" ]; then
    2.80              CT_DoExecLog ALL make configure-libdecnumber
    2.81              CT_DoExecLog ALL make ${PARALLELMFLAGS} -C libdecnumber libdecnumber.a
    2.82          fi
    2.83 @@ -226,6 +234,8 @@
    2.84  #------------------------------------------------------------------------------
    2.85  # Build final gcc
    2.86  do_cc() {
    2.87 +    local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}"
    2.88 +
    2.89      # If building for bare metal, nothing to be done here, the static core conpiler is enough!
    2.90      [ "${CT_BARE_METAL}" = "y" ] && return 0
    2.91  
    2.92 @@ -282,7 +292,7 @@
    2.93      CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}"       \
    2.94      LDFLAGS_FOR_TARGET="${CT_TARGET_LDFLAGS}"       \
    2.95      CT_DoExecLog ALL                                \
    2.96 -    "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure"  \
    2.97 +    "${CT_SRC_DIR}/gcc-${version}/configure"        \
    2.98          --build=${CT_BUILD}                         \
    2.99          --host=${CT_HOST}                           \
   2.100          --target=${CT_TARGET}                       \