summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2011-07-17 20:43:07 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2011-07-17 20:43:07 (GMT)
commit33cdb19ed527cc633fcb6058c38deb14e716ac90 (patch)
tree4c89f42dcb16bf6f8e9c6e5a9e41d06346451ed7
parent40dda92f5777b5491b4cd52c81ca4e7f6fc05ddf (diff)
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" <yann.morin.1998@anciens.enib.fr>
-rw-r--r--scripts/build/cc/gcc.sh25
1 files changed, 16 insertions, 9 deletions
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[@]}"
}
#------------------------------------------------------------------------------