From 33cdb19ed527cc633fcb6058c38deb14e716ac90 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sun, 17 Jul 2011 22:43:07 +0200 Subject: cc/gcc: do not use the core pass-2 to build the baremetal compiler In case we build a baremetal compiler, use the standard passes: - core_cc is used to build the C library; - as such, it is meant to run on build, not host; - the final compiler is meant to run on host; As the current final compiler step can not build a baremetal compiler, call the core backend from the final step. NB: Currently, newlib is built during the start_files pass, so we have to have a core compiler by then... Once we can build the baremetal compiler from the final cc step, then we can move the newlib build to the proper step, and then get rid of the core pass-1 static compiler... Signed-off-by: "Yann E. MORIN" diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh index 850cf6d..08264e3 100644 --- a/scripts/build/cc/gcc.sh +++ b/scripts/build/cc/gcc.sh @@ -105,17 +105,11 @@ do_cc_core_pass_2() { case "${CT_BARE_METAL},${CT_CANADIAN},${CT_THREADS}" in y,*,*) do_core=y - core_opts+=( "mode=baremetal" ) core_opts+=( "host=${CT_HOST}" ) - core_opts+=( "build_libgcc=yes" ) - core_opts+=( "build_libstdcxx=yes" ) + core_opts+=( "mode=static" ) + core_opts+=( "prefix=${CT_CC_CORE_STATIC_PREFIX_DIR}" ) core_opts+=( "complibs=${CT_COMPLIBS_DIR}" ) - core_opts+=( "prefix=${CT_PREFIX_DIR}" ) core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) - if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then - core_opts+=( "build_staticlinked=yes" ) - fi - core_opts+=( "build_manuals=yes" ) ;; ,y,*) ;; ,,nptl) @@ -488,13 +482,26 @@ do_cc_core_backend() { # Build final gcc do_cc() { local -a final_opts + local final_backend final_opts+=( "host=${CT_HOST}" ) final_opts+=( "prefix=${CT_PREFIX_DIR}" ) final_opts+=( "complibs=${CT_COMPLIBS_DIR}" ) final_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) + if [ "${CT_BARE_METAL}" = "y" ]; then + final_opts+=( "mode=baremetal" ) + final_opts+=( "build_libgcc=yes" ) + final_opts+=( "build_libstdcxx=yes" ) + if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then + final_opts+=( "build_staticlinked=yes" ) + fi + final_opts+=( "build_manuals=yes" ) + final_backend=do_cc_core_backend + else + final_backend=do_cc_backend + fi - do_cc_backend "${final_opts[@]}" + "${final_backend}" "${final_opts[@]}" } #------------------------------------------------------------------------------ -- cgit v0.10.2-6-g49f6