summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2012-01-03 21:57:25 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2012-01-03 21:57:25 (GMT)
commitd7761401893497081a3d3542155d0a512a31ef86 (patch)
tree321e01e18920e4ec945ec877a38638cd3f19d5ba
parentb485733f263b6dafdb691fe877bce5c1135ea7c0 (diff)
cc/gcc: build core compilers for canadian
Currently, we rely on an existing external cross-compiler targetting the target, to build the C library. This can pause quite a few problems if that compiler is different from the one we are building, because it could introduce some ABI issues. This patch removes this dependency, by building the core compilers as we do for standard cross, and also by building the binutils and gcc, for running on the build machine. This means we no longer need to offer the cross-sompiler selection in the menuconfig. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
-rw-r--r--config/toolchain.in49
-rw-r--r--scripts/build/cc/gcc.sh16
-rw-r--r--scripts/crosstool-NG.sh.in2
-rw-r--r--steps.mk14
4 files changed, 20 insertions, 61 deletions
diff --git a/config/toolchain.in b/config/toolchain.in
index d661914..cec1e35 100644
--- a/config/toolchain.in
+++ b/config/toolchain.in
@@ -303,55 +303,6 @@ config HOST_SUFFIX
endif # CANADIAN
-if CROSS_NATIVE || CANADIAN
-
-comment "Target system"
-
-config TARGET_PREFIX
- string
- prompt "| Tools prefix (READ HELP!)"
- default ""
- help
- If you have your *target system* tools in a weird location, and/or
- they have an unusual prefix, enter it here.
-
- Usually, you should leave that empty!
-
- Eg.:
- If your *target* gcc is /opt/target-tools/bin/weird-gcc then you
- should enter:
- /opt/target-tools/bin/weird-
-
- If your *target* gcc is /opt/target-tools/bin/weird-gcc and
- /opt/target-tools/bin is in your PATH, you should enter:
- weird-
-
- If your *target* gcc is /opt/target-tools/bin/gcc then you
- should enter (do not forget to add the trailing '/'):
- /opt/target-tools/bin/
-
-config TARGET_SUFFIX
- string
- prompt "| Tools suffix (READ HELP!)"
- default ""
- help
- If your *target system* tools have an unusual suffix, enter it
- here.
-
- Usually, you should leave that empty!
-
- Eg.:
- If your 'default' gcc is gcc 4.3.1, but you also have gcc-3.4.2
- installed as gcc-3.4, then you should enter:
- -3.4
-
- It can happen that some of the tools have a suffix, when others
- don't, eg. you can have 'gcc-3.4' and 'ar'. crosstool-NG accounts
- for that by checking the tools without the suffix in case it can
- not find some of the tool.
-
-endif # CROSS_NATIVE || CANADIAN
-
comment "Misc options"
config TOOLCHAIN_ENABLE_NLS
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
index f177474..8dea3dc 100644
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -76,13 +76,10 @@ do_cc_core_pass_1() {
local -a core_opts
local do_core
- # 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)
+ case "${CT_THREADS}" in
+ nptl)
do_core=y
core_opts+=( "mode=static" )
core_opts+=( "host=${CT_BUILD}" )
@@ -116,21 +113,18 @@ do_cc_core_pass_2() {
core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
core_opts+=( "lang_list=c" )
- # 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,*)
- ;;
- ,nptl)
+ case "${CT_THREADS}" in
+ nptl)
do_core=y
core_opts+=( "mode=shared" )
core_opts+=( "build_libgcc=yes" )
;;
- ,win32)
+ win32)
do_core=y
core_opts+=( "mode=static" )
core_opts+=( "build_libgcc=yes" )
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index c683417..d794743 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -354,7 +354,7 @@ if [ -z "${CT_RESTART}" ]; then
build_mangle="build_"
host_mangle="host_"
target_mangle=""
- install_build_tools_for="BUILD HOST TARGET"
+ install_build_tools_for="BUILD HOST"
;;
*) CT_Abort "No code for '${CT_TOOLCHAIN_TYPE}' toolchain type!"
;;
diff --git a/steps.mk b/steps.mk
index 9822c95..4849898 100644
--- a/steps.mk
+++ b/steps.mk
@@ -14,9 +14,19 @@ help-env::
# ----------------------------------------------------------
# The steps list
+# The _for_build steps are noop for native and cross,
+# but are actual steps for canadian and cross-native.
# Please keep the last line with a '\' and keep the following empy line:
# it helps when diffing and merging.
CT_STEPS := libc_check_config \
+ gmp_for_build \
+ mpfr_for_build \
+ ppl_for_build \
+ cloog_for_build \
+ mpc_for_build \
+ libelf_for_build \
+ binutils_for_build \
+ elf2flt_for_build \
gmp_for_host \
mpfr_for_host \
ppl_for_host \
@@ -31,6 +41,7 @@ CT_STEPS := libc_check_config \
libc_start_files \
cc_core_pass_2 \
libc \
+ cc_for_build \
cc_for_host \
libc_finish \
libelf_for_target \
@@ -39,6 +50,9 @@ CT_STEPS := libc_check_config \
test_suite \
finish \
+# Keep an empty line above this comment, so the last
+# back-slash terminated line works as expected.
+
# Make the list available to sub-processes (scripts/crosstool-NG.sh needs it)
export CT_STEPS