1.1 --- a/scripts/build/cc/gcc.sh Sun Jul 24 23:53:14 2011 +0200
1.2 +++ b/scripts/build/cc/gcc.sh Mon Jul 25 19:04:00 2011 +0200
1.3 @@ -58,15 +58,13 @@
1.4 local -a core_opts
1.5 local do_core
1.6
1.7 - # If we're building for bare metal, build the static core gcc,
1.8 - # with libgcc.
1.9 - # In case we're not bare metal and building a canadian compiler, do nothing
1.10 - # In case we're not bare metal, and we're NPTL, build the static core gcc.
1.11 - # In any other case, do nothing.
1.12 - case "${CT_BARE_METAL},${CT_CANADIAN},${CT_THREADS}" in
1.13 - ,y,*)
1.14 + # Do nothing for canadian-crosses, we already have a target compiler.
1.15 + # We only need a pass-1 core gcc if the threading model is NPTL.
1.16 + # For all other cases, it is not used.
1.17 + case "${CT_CANADIAN},${CT_THREADS}" in
1.18 + y,*)
1.19 ;;
1.20 - ,,nptl)
1.21 + ,nptl)
1.22 do_core=y
1.23 core_opts+=( "mode=static" )
1.24 core_opts+=( "host=${CT_BUILD}" )
1.25 @@ -74,8 +72,6 @@
1.26 core_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
1.27 core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
1.28 ;;
1.29 - *)
1.30 - ;;
1.31 esac
1.32
1.33 if [ "${do_core}" = "y" ]; then
1.34 @@ -94,44 +90,34 @@
1.35 local -a core_opts
1.36 local do_core
1.37
1.38 - # In case we're building for bare metal, do nothing, we already have
1.39 - # our compiler.
1.40 - # In case we're not bare metal and building a canadian compiler, do nothing
1.41 - # In case we're NPTL, build the shared core gcc and the target libgcc.
1.42 - # In any other case, build the static core gcc and, if using gcc-4.3+,
1.43 - # also build the target libgcc.
1.44 + # Common options:
1.45 + core_opts+=( "host=${CT_BUILD}" )
1.46 core_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
1.47 - case "${CT_BARE_METAL},${CT_CANADIAN},${CT_THREADS}" in
1.48 - y,*,*)
1.49 - do_core=y
1.50 - core_opts+=( "host=${CT_BUILD}" )
1.51 - core_opts+=( "mode=static" )
1.52 - core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
1.53 - core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
1.54 + core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
1.55 + core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
1.56 +
1.57 + # Do nothing for canadian-crosses, we already have a target compiler.
1.58 + # Different conditions are at stake here:
1.59 + # - In case the threading model is NPTL, we need a shared-capable core
1.60 + # gcc; in all other cases, we need a static-only core gcc.
1.61 + # - In case the threading model is NPTL or win32, or gcc is 4.3 or
1.62 + # later, we need to build libgcc
1.63 + case "${CT_CANADIAN},${CT_THREADS}" in
1.64 + y,*)
1.65 ;;
1.66 - ,y,*) ;;
1.67 - ,,nptl)
1.68 + ,nptl)
1.69 do_core=y
1.70 core_opts+=( "mode=shared" )
1.71 - core_opts+=( "host=${CT_BUILD}" )
1.72 core_opts+=( "build_libgcc=yes" )
1.73 - core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
1.74 - core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
1.75 ;;
1.76 - ,,win32)
1.77 + ,win32)
1.78 do_core=y
1.79 core_opts+=( "mode=static" )
1.80 - core_opts+=( "host=${CT_BUILD}" )
1.81 core_opts+=( "build_libgcc=yes" )
1.82 - core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
1.83 - core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
1.84 ;;
1.85 *)
1.86 do_core=y
1.87 core_opts+=( "mode=static" )
1.88 - core_opts+=( "host=${CT_BUILD}" )
1.89 - core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
1.90 - core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
1.91 if [ "${CT_CC_GCC_4_3_or_later}" = "y" ]; then
1.92 core_opts+=( "build_libgcc=yes" )
1.93 fi