# HG changeset patch # User "Yann E. MORIN" # Date 1311613440 -7200 # Node ID 79201a2826fdffcd2e68e9702cffa2cfcbb76dcf # Parent 22e495b7bee89d4684b96f3343854009aee71780 cc/gcc: cleanup the frontends A few noop fix-ups: - fix the comments in core pass-1 - commonalise settings that can be Signed-off-by: "Yann E. MORIN" diff -r 22e495b7bee8 -r 79201a2826fd scripts/build/cc/gcc.sh --- a/scripts/build/cc/gcc.sh Sun Jul 24 23:53:14 2011 +0200 +++ b/scripts/build/cc/gcc.sh Mon Jul 25 19:04:00 2011 +0200 @@ -58,15 +58,13 @@ local -a core_opts local do_core - # If we're building for bare metal, build the static core gcc, - # with libgcc. - # In case we're not bare metal and building a canadian compiler, do nothing - # In case we're not bare metal, and we're NPTL, build the static core gcc. - # In any other case, do nothing. - case "${CT_BARE_METAL},${CT_CANADIAN},${CT_THREADS}" in - ,y,*) + # Do nothing for canadian-crosses, we already have a target compiler. + # We only need a pass-1 core gcc if the threading model is NPTL. + # For all other cases, it is not used. + case "${CT_CANADIAN},${CT_THREADS}" in + y,*) ;; - ,,nptl) + ,nptl) do_core=y core_opts+=( "mode=static" ) core_opts+=( "host=${CT_BUILD}" ) @@ -74,8 +72,6 @@ core_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" ) core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) ;; - *) - ;; esac if [ "${do_core}" = "y" ]; then @@ -94,44 +90,34 @@ local -a core_opts local do_core - # In case we're building for bare metal, do nothing, we already have - # our compiler. - # In case we're not bare metal and building a canadian compiler, do nothing - # In case we're NPTL, build the shared core gcc and the target libgcc. - # In any other case, build the static core gcc and, if using gcc-4.3+, - # also build the target libgcc. + # Common options: + core_opts+=( "host=${CT_BUILD}" ) core_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" ) - case "${CT_BARE_METAL},${CT_CANADIAN},${CT_THREADS}" in - y,*,*) - do_core=y - core_opts+=( "host=${CT_BUILD}" ) - core_opts+=( "mode=static" ) - core_opts+=( "complibs=${CT_COMPLIBS_DIR}" ) - core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) + core_opts+=( "complibs=${CT_COMPLIBS_DIR}" ) + core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) + + # Do nothing for canadian-crosses, we already have a target compiler. + # Different conditions are at stake here: + # - In case the threading model is NPTL, we need a shared-capable core + # gcc; in all other cases, we need a static-only core gcc. + # - In case the threading model is NPTL or win32, or gcc is 4.3 or + # later, we need to build libgcc + case "${CT_CANADIAN},${CT_THREADS}" in + y,*) ;; - ,y,*) ;; - ,,nptl) + ,nptl) do_core=y core_opts+=( "mode=shared" ) - core_opts+=( "host=${CT_BUILD}" ) core_opts+=( "build_libgcc=yes" ) - core_opts+=( "complibs=${CT_COMPLIBS_DIR}" ) - core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) ;; - ,,win32) + ,win32) do_core=y core_opts+=( "mode=static" ) - core_opts+=( "host=${CT_BUILD}" ) core_opts+=( "build_libgcc=yes" ) - core_opts+=( "complibs=${CT_COMPLIBS_DIR}" ) - core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) ;; *) do_core=y core_opts+=( "mode=static" ) - core_opts+=( "host=${CT_BUILD}" ) - core_opts+=( "complibs=${CT_COMPLIBS_DIR}" ) - core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) if [ "${CT_CC_GCC_4_3_or_later}" = "y" ]; then core_opts+=( "build_libgcc=yes" ) fi