summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/cc/gcc.in.211
-rw-r--r--config/debug/gdb.in9
-rw-r--r--docs/3 - Configuring a toolchain.txt2
-rw-r--r--samples/sh4-unknown-linux-gnu/crosstool.config2
-rw-r--r--scripts/build/cc/100-gcc.sh56
5 files changed, 65 insertions, 15 deletions
diff --git a/config/cc/gcc.in.2 b/config/cc/gcc.in.2
index 73b6a2f..577bf42 100644
--- a/config/cc/gcc.in.2
+++ b/config/cc/gcc.in.2
@@ -47,6 +47,17 @@ config CC_GCC_EXTRA_ENV_ARRAY
Leave blank if you don't know better.
+config CC_GCC_TARGET_FINAL
+ bool
+ prompt "Use the default targets all and install for the final compiler"
+ default n
+ depends on BARE_METAL
+ help
+ The final GCC for a bare metal system is built by the core gcc script.
+ This script does a lot of tricks to build the core gcc, which are not
+ required for the final gcc build. If you set this flag to true, all the
+ tricks are not done and the compiler is build with all/install.
+
config STATIC_TOOLCHAIN
select CC_GCC_STATIC_LIBSTDCXX if CC_GCC_4_4_or_later
diff --git a/config/debug/gdb.in b/config/debug/gdb.in
index 7010259..d0d1aae 100644
--- a/config/debug/gdb.in
+++ b/config/debug/gdb.in
@@ -164,13 +164,15 @@ config GDB_V_6_8a
bool
prompt "6.8a"
+endchoice
+
config GDB_CUSTOM
bool
prompt "Custom gdb"
depends on EXPERIMENTAL
- select GDB_7_2_or_later
-
-endchoice
+ help
+ The choosen gdb version shall be not downloaded. Instead use
+ a custom location to get the source.
config GDB_7_2_or_later
bool
@@ -220,7 +222,6 @@ config GDB_VERSION
default "7.0.1a" if GDB_V_7_0_1a
default "7.0a" if GDB_V_7_0a
default "6.8a" if GDB_V_6_8a
- default "custom" if GDB_CUSTOM
if GDB_CUSTOM
diff --git a/docs/3 - Configuring a toolchain.txt b/docs/3 - Configuring a toolchain.txt
index 2a9c156..b9cbace 100644
--- a/docs/3 - Configuring a toolchain.txt
+++ b/docs/3 - Configuring a toolchain.txt
@@ -15,7 +15,7 @@ will support, the version of the components you want to use, etc... The
value for those options are then stored in a configuration file.
The configurator works the same way you configure your Linux kernel. It is
-assumed you now how to handle this.
+assumed you know how to handle this.
To enter the menu, type:
ct-ng menuconfig
diff --git a/samples/sh4-unknown-linux-gnu/crosstool.config b/samples/sh4-unknown-linux-gnu/crosstool.config
index 3d588c6..ab0cc7a 100644
--- a/samples/sh4-unknown-linux-gnu/crosstool.config
+++ b/samples/sh4-unknown-linux-gnu/crosstool.config
@@ -5,7 +5,7 @@ CT_ARCH_sh=y
CT_ARCH_SH_SH4=y
CT_KERNEL_linux=y
CT_BINUTILS_PLUGINS=y
-CT_LIBC_glibc=y
+CT_CC_GCC_V_4_9_3=y
CT_CC_LANG_CXX=y
CT_DEBUG_gdb=y
# CT_GDB_CROSS_PYTHON is not set
diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh
index 2001ff9..1056221 100644
--- a/scripts/build/cc/100-gcc.sh
+++ b/scripts/build/cc/100-gcc.sh
@@ -100,6 +100,7 @@ do_gcc_core_pass_1() {
core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
core_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
core_opts+=( "lang_list=c" )
+ core_opts+=( "build_step=core1" )
CT_DoStep INFO "Installing pass-1 core C gcc compiler"
CT_mkdir_pushd "${CT_BUILD_DIR}/build-cc-gcc-core-pass-1"
@@ -125,6 +126,7 @@ do_gcc_core_pass_2() {
core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
core_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
core_opts+=( "lang_list=c" )
+ core_opts+=( "build_step=core2" )
# Different conditions are at stake here:
# - In case the threading model is NPTL, we need a shared-capable core
@@ -165,7 +167,7 @@ do_gcc_core_pass_2() {
# mode : build a 'static', 'shared' or 'baremetal' : string : (none)
# host : the machine the core will run on : tuple : (none)
# prefix : dir prefix to install into : dir : (none)
-# complibs : dir where complibs are isntalled : dir : (none)
+# complibs : dir where complibs are installed : dir : (none)
# lang_list : the list of languages to build : string : (empty)
# build_libgcc : build libgcc or not : bool : no
# build_libstdcxx : build libstdc++ or not : bool : no
@@ -174,6 +176,8 @@ do_gcc_core_pass_2() {
# build_manuals : whether to build manuals or not : bool : no
# cflags : cflags to use : string : (empty)
# ldflags : ldflags to use : string : (empty)
+# build_step : build step 'core1', 'core2', 'gcc_build'
+# or 'gcc_host' : string : (none)
# Usage: do_gcc_core_backend mode=[static|shared|baremetal] build_libgcc=[yes|no] build_staticlinked=[yes|no]
do_gcc_core_backend() {
local mode
@@ -188,11 +192,15 @@ do_gcc_core_backend() {
local lang_list
local cflags
local ldflags
+ local build_step
+ local log_txt
local tmp
local -a host_libstdcxx_flags
local -a extra_config
local -a core_LDFLAGS
local -a core_targets
+ local -a core_targets_all
+ local -a core_targets_install
local -a extra_user_config
local -a extra_user_env
local arg
@@ -201,24 +209,40 @@ do_gcc_core_backend() {
eval "${arg// /\\ }"
done
- CT_DoLog EXTRA "Configuring core C gcc compiler"
+ # This function gets called in case of a bare metal compiler for the final gcc, too.
+ case "${build_step}" in
+ core1|core2)
+ CT_DoLog EXTRA "Configuring core C gcc compiler"
+ log_txt="gcc"
+ extra_user_config=( "${CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY[@]}" )
+ ;;
+ gcc_build|gcc_host)
+ CT_DoLog EXTRA "Configuring final gcc compiler"
+ extra_user_config=( "${CT_CC_GCC_EXTRA_CONFIG_ARRAY[@]}" )
+ log_txt="final gcc compiler"
+ if [ "${CT_CC_GCC_TARGET_FINAL}" = "y" ]; then
+ # to inhibit the libiberty and libgcc tricks later on
+ build_libgcc=no
+ fi
+ ;;
+ *)
+ CT_Abort "Internal Error: 'build_step' must be one of: 'core1', 'core2', 'gcc_build' or 'gcc_host', not '${build_step:-(empty)}'"
+ ;;
+ esac
case "${mode}" in
static)
extra_config+=("--with-newlib")
extra_config+=("--enable-threads=no")
extra_config+=("--disable-shared")
- extra_user_config=( "${CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY[@]}" )
;;
shared)
extra_config+=("--enable-shared")
- extra_user_config=( "${CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY[@]}" )
;;
baremetal)
extra_config+=("--with-newlib")
extra_config+=("--enable-threads=no")
extra_config+=("--disable-shared")
- extra_user_config=( "${CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY[@]}" )
;;
*)
CT_Abort "Internal Error: 'mode' must be one of: 'static', 'shared' or 'baremetal', not '${mode:-(empty)}'"
@@ -493,11 +517,23 @@ do_gcc_core_backend() {
core_targets+=( target-libgfortran )
fi
- CT_DoLog EXTRA "Building gcc"
- CT_DoExecLog ALL make ${JOBSFLAGS} ${extra_user_env} "${core_targets[@]/#/all-}"
+ core_targets_all="${core_targets[@]/#/all-}"
+ core_targets_install="${core_targets[@]/#/install-}"
+
+ case "${build_step}" in
+ gcc_build|gcc_host)
+ if [ "${CT_CC_GCC_TARGET_FINAL}" = "y" ]; then
+ core_targets_all=all
+ core_targets_install=install
+ fi
+ ;;
+ esac
+
+ CT_DoLog EXTRA "Building ${log_txt}"
+ CT_DoExecLog ALL make ${JOBSFLAGS} ${extra_user_env} ${core_targets_all}
- CT_DoLog EXTRA "Installing gcc"
- CT_DoExecLog ALL make ${JOBSFLAGS} "${core_targets[@]/#/install-}"
+ CT_DoLog EXTRA "Installing ${log_txt}"
+ CT_DoExecLog ALL make ${JOBSFLAGS} ${extra_user_env} ${core_targets_install}
if [ "${build_manuals}" = "yes" ]; then
CT_DoLog EXTRA "Building the GCC manuals"
@@ -553,6 +589,7 @@ do_gcc_for_build() {
build_final_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
build_final_opts+=( "complibs=${CT_BUILDTOOLS_PREFIX_DIR}" )
build_final_opts+=( "lang_list=$( cc_gcc_lang_list )" )
+ build_final_opts+=( "build_step=gcc_build" )
if [ "${CT_BARE_METAL}" = "y" ]; then
# In the tests I've done, bare-metal was not impacted by the
# lack of such a compiler, but better safe than sorry...
@@ -589,6 +626,7 @@ do_gcc_for_host() {
final_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
final_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
final_opts+=( "lang_list=$( cc_gcc_lang_list )" )
+ final_opts+=( "build_step=gcc_host" )
if [ "${CT_BUILD_MANUALS}" = "y" ]; then
final_opts+=( "build_manuals=yes" )
fi