cc/gcc: install the core compilers in the build-tools dir

There really is no good reason to install the core compilers in their
own places, one for each pass. We can install them with the other
build tools.

Also, this implies that:
 - there are fewer directories to save/restore
 - there are fewer symlinks to create for binutils
 - the PATH is shorter

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
This commit is contained in:
Yann E. MORIN" 2012-01-01 17:49:44 +01:00
parent ad1aa7079e
commit e960f66953
5 changed files with 12 additions and 37 deletions

View File

@ -134,15 +134,11 @@ do_binutils() {
# are not executable on the build machine.
case "${CT_TOOLCHAIN_TYPE}" in
cross|native)
mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/bin"
mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/bin"
mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/bin"
mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/bin"
mkdir -p "${CT_BUILDTOOLS_PREFIX_DIR}/${CT_TARGET}/bin"
mkdir -p "${CT_BUILDTOOLS_PREFIX_DIR}/bin"
for t in "${binutils_tools[@]}"; do
ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_STATIC_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_SHARED_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_BUILDTOOLS_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_BUILDTOOLS_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
done 2>&1 |CT_DoLog ALL
;;
*) ;;

View File

@ -64,15 +64,11 @@ do_elf2flt() {
# are not executable on the build machine.
case "${CT_TOOLCHAIN_TYPE}" in
cross|native)
mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/bin"
mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/bin"
mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/bin"
mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/bin"
mkdir -p "${CT_BUILDTOOLS_PREFIX_DIR}/${CT_TARGET}/bin"
mkdir -p "${CT_BUILDTOOLS_PREFIX_DIR}/bin"
for t in elf2flt flthdr; do
ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_STATIC_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_SHARED_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_BUILDTOOLS_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_BUILDTOOLS_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
done 2>&1 |CT_DoLog ALL
;;
*) ;;

View File

@ -71,7 +71,7 @@ do_cc_core_pass_1() {
core_opts+=( "mode=static" )
core_opts+=( "host=${CT_HOST}" )
core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
core_opts+=( "prefix=${CT_CC_CORE_STATIC_PREFIX_DIR}" )
core_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
;;
*)
@ -100,12 +100,12 @@ do_cc_core_pass_2() {
# In case we're NPTL, build the shared core gcc and the target libgcc.
# In any other case, build the static core gcc and, if using gcc-4.3+,
# also build the target libgcc.
core_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
case "${CT_BARE_METAL},${CT_CANADIAN},${CT_THREADS}" in
y,*,*)
do_core=y
core_opts+=( "host=${CT_HOST}" )
core_opts+=( "mode=static" )
core_opts+=( "prefix=${CT_CC_CORE_STATIC_PREFIX_DIR}" )
core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
;;
@ -116,7 +116,6 @@ do_cc_core_pass_2() {
core_opts+=( "host=${CT_HOST}" )
core_opts+=( "build_libgcc=yes" )
core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
core_opts+=( "prefix=${CT_CC_CORE_SHARED_PREFIX_DIR}" )
core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
;;
,,win32)
@ -125,7 +124,6 @@ do_cc_core_pass_2() {
core_opts+=( "host=${CT_HOST}" )
core_opts+=( "build_libgcc=yes" )
core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
core_opts+=( "prefix=${CT_CC_CORE_STATIC_PREFIX_DIR}" )
core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
;;
*)
@ -133,7 +131,6 @@ do_cc_core_pass_2() {
core_opts+=( "mode=static" )
core_opts+=( "host=${CT_HOST}" )
core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
core_opts+=( "prefix=${CT_CC_CORE_STATIC_PREFIX_DIR}" )
core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
if [ "${CT_CC_GCC_4_3_or_later}" = "y" ]; then
core_opts+=( "build_libgcc=yes" )

View File

@ -162,11 +162,6 @@ CT_COMPLIBS_DIR="${CT_BUILD_DIR}/static"
# Compute test suite install directory
CT_TEST_SUITE_DIR=${CT_INSTALL_DIR}/test-suite
# Note: we'll always install the core compiler in its own directory, so as to
# not mix the two builds: core and final.
CT_CC_CORE_STATIC_PREFIX_DIR="${CT_BUILD_DIR}/${CT_CC}-core-static"
CT_CC_CORE_SHARED_PREFIX_DIR="${CT_BUILD_DIR}/${CT_CC}-core-shared"
# We must ensure that we can restart if asked for!
if [ -n "${CT_RESTART}" -a ! -d "${CT_STATE_DIR}" ]; then
CT_DoLog ERROR "You asked to restart a non-restartable build"
@ -239,10 +234,6 @@ CT_DoExecLog ALL mkdir -p "${CT_CONFIG_DIR}"
CT_DoExecLog ALL mkdir -p "${CT_INSTALL_DIR}"
CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}"
CT_DoExecLog ALL mkdir -p "${CT_COMPLIBS_DIR}"
if [ -z "${CT_CANADIAN}" ]; then
CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}"
CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}"
fi
# Only create the state dir if asked for a restartable build
[ -n "${CT_DEBUG_CT_SAVE_STEPS}" ] && CT_DoExecLog ALL mkdir -p "${CT_STATE_DIR}"
@ -457,13 +448,12 @@ if [ -z "${CT_RESTART}" ]; then
# Carefully add paths in the order we want them:
# - first try in ${CT_PREFIX_DIR}/bin
# - then try in ${CT_CC_CORE_SHARED_PREFIX_DIR}/bin
# - then try in ${CT_CC_CORE_STATIC_PREFIX_DIR}/bin
# - then try the buildtools dir
# - fall back to searching user's PATH
# Of course, neither cross-native nor canadian can run on BUILD,
# so don't add those PATHs in this case...
case "${CT_TOOLCHAIN_TYPE}" in
cross) export PATH="${CT_BUILDTOOLS_PREFIX_DIR}/bin:${CT_PREFIX_DIR}/bin:${CT_CC_CORE_SHARED_PREFIX_DIR}/bin:${CT_CC_CORE_STATIC_PREFIX_DIR}/bin:${PATH}";;
cross) export PATH="${CT_PREFIX_DIR}/bin:${CT_BUILDTOOLS_PREFIX_DIR}/bin:${PATH}";;
canadian) export PATH="${CT_BUILDTOOLS_PREFIX_DIR}/bin:${PATH}";;
*) ;;
esac

View File

@ -1148,8 +1148,6 @@ CT_DoSaveState() {
CT_DoTarballIfExists "${CT_BUILDTOOLS_PREFIX_DIR}" "${state_dir}/buildtools_dir"
CT_DoTarballIfExists "${CT_COMPLIBS_DIR}" "${state_dir}/complibs_dir"
CT_DoTarballIfExists "${CT_CONFIG_DIR}" "${state_dir}/config_dir"
CT_DoTarballIfExists "${CT_CC_CORE_STATIC_PREFIX_DIR}" "${state_dir}/cc_core_static_prefix_dir"
CT_DoTarballIfExists "${CT_CC_CORE_SHARED_PREFIX_DIR}" "${state_dir}/cc_core_shared_prefix_dir"
CT_DoTarballIfExists "${CT_PREFIX_DIR}" "${state_dir}/prefix_dir" --exclude '*.log'
CT_DoLog STATE " Saving log file"
@ -1180,8 +1178,6 @@ CT_DoLoadState(){
CT_DoLog ${CT_LOG_LEVEL_MAX} "Restoring state at step '${state_name}', as requested."
CT_DoExtractTarballIfExists "${state_dir}/prefix_dir" "${CT_PREFIX_DIR}"
CT_DoExtractTarballIfExists "${state_dir}/cc_core_shared_prefix_dir" "${CT_CC_CORE_SHARED_PREFIX_DIR}"
CT_DoExtractTarballIfExists "${state_dir}/cc_core_static_prefix_dir" "${CT_CC_CORE_STATIC_PREFIX_DIR}"
CT_DoExtractTarballIfExists "${state_dir}/config_dir" "${CT_CONFIG_DIR}"
CT_DoExtractTarballIfExists "${state_dir}/complibs_dir" "${CT_COMPLIBS_DIR}"
CT_DoExtractTarballIfExists "${state_dir}/buildtools_dir" "${CT_BUILDTOOLS_PREFIX_DIR}"