# HG changeset patch # User "Yann E. MORIN" # Date 1310935387 -7200 # Node ID a8a65758664f4838771901f5343e934061731406 # Parent aa934ec4b4ee51db9d33f198787d0e61f2b302d9 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 -r aa934ec4b4ee -r a8a65758664f scripts/build/cc/gcc.sh --- a/scripts/build/cc/gcc.sh Sun Jul 17 22:46:47 2011 +0200 +++ b/scripts/build/cc/gcc.sh Sun Jul 17 22:43:07 2011 +0200 @@ -105,17 +105,11 @@ 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 @@ # 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[@]}" } #------------------------------------------------------------------------------