summaryrefslogtreecommitdiff
path: root/scripts/build/cc/100-gcc.sh
diff options
context:
space:
mode:
authorRay Donnelly <mingw.android@gmail.com>2014-04-12 12:18:15 (GMT)
committerAlexey Neyman <stilor@att.net>2016-08-23 18:00:27 (GMT)
commit27fed7e5f01495ce25dd605bb031954ed186f614 (patch)
treee9527259ff9e0b2f433b6aa3e5ba67911175c304 /scripts/build/cc/100-gcc.sh
parent098bd01f81b6eea922cb1c4edcd8aff398616641 (diff)
crosstool-NG.sh.in: Don't make lots of symlinks to lib folder
For 4 different folders: ${CT_PREFIX_DIR} ${CT_SYSROOT_DIR} ${CT_SYSROOT_DIR}/usr ${CT_PREFIX_DIR}/${CT_TARGET} .. symlinks from 'lib32' and 'lib64' to 'lib' were created. This was untidy and incorrect for multilib (the bitness of the libraries in 'lib32' and 'lib64' will not be the same) We can not know which folders this toolchain configuration will require at this time so let them be created on-demand instead. Changed by Alexey Neyman: original change removed too much; we still need to create the default directories because the os directories are based off them (e.g. `lib/../lib64'). Signed-off-by: Ray Donnelly <mingw.android@gmail.com> Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts/build/cc/100-gcc.sh')
-rw-r--r--scripts/build/cc/100-gcc.sh74
1 files changed, 43 insertions, 31 deletions
diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh
index 7bb3610..57e46f9 100644
--- a/scripts/build/cc/100-gcc.sh
+++ b/scripts/build/cc/100-gcc.sh
@@ -201,6 +201,9 @@ do_gcc_core_backend() {
local -a core_targets_install
local -a extra_user_config
local arg
+ local dir
+ local flags
+ local osdir
for arg in "$@"; do
eval "${arg// /\\ }"
@@ -560,23 +563,30 @@ do_gcc_core_backend() {
CT_DoExecLog ALL ln -sfv "${CT_TARGET}-gcc${ext}" "${prefix}/bin/${CT_TARGET}-cc${ext}"
fi
- if [ "${CT_MULTILIB}" = "y" ]; then
- if [ "${CT_CANADIAN}" = "y" -a "${mode}" = "baremetal" \
- -a "${host}" = "${CT_HOST}" ]; then
- CT_DoLog WARN "Canadian Cross unable to confirm multilibs configured correctly"
+ if [ "${CT_CANADIAN}" = "y" -a "${mode}" = "baremetal" \
+ -a "${host}" = "${CT_HOST}" ]; then
+ CT_DoLog EXTRA "Canadian Cross unable to confirm multilibs configured correctly"
+ else
+ multilibs=( $( "${prefix}/bin/${CT_TARGET}-gcc" -print-multi-lib ) )
+ if [ ${#multilibs[@]} -ne 0 ]; then
+ CT_DoLog EXTRA "gcc configured with these multilibs (including the default):"
+ for i in "${multilibs[@]}"; do
+ dir="${i%%;*}"
+ flags="${i#*;}"
+ flags=${flags//@/ -}
+ osdir=$( "${prefix}/bin/${CT_TARGET}-gcc" -print-multi-os-directory ${flags} )
+ CT_DoLog EXTRA " '${flags}' --> lib/${dir}/ (gcc) lib/${osdir} (os)"
+ # When building core GCC, create the necessary directories for libc & friends.
+ case "${build_step}" in
+ core1|core2)
+ CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}/lib/${osdir}"
+ CT_DoExecLog ALL mkdir -p "${CT_SYSROOT_DIR}/lib/${osdir}"
+ CT_DoExecLog ALL mkdir -p "${CT_SYSROOT_DIR}/usr/lib/${osdir}"
+ ;;
+ esac
+ done
else
- multilibs=( $( "${prefix}/bin/${CT_TARGET}-gcc" -print-multi-lib \
- |tail -n +2 ) )
- if [ ${#multilibs[@]} -ne 0 ]; then
- CT_DoLog EXTRA "gcc configured with these multilibs (besides the default):"
- for i in "${multilibs[@]}"; do
- dir="${i%%;*}"
- flags="${i#*;}"
- CT_DoLog EXTRA " ${flags//@/ -} --> ${dir}/"
- done
- else
- CT_DoLog WARN "gcc configured for multilib, but none available"
- fi
+ CT_DoLog WARN "no multilib configuration: GCC unusable?"
fi
fi
}
@@ -685,6 +695,9 @@ do_gcc_backend() {
local -a final_LDFLAGS
local tmp
local arg
+ local dir
+ local flags
+ local osdir
for arg in "$@"; do
eval "${arg// /\\ }"
@@ -968,22 +981,21 @@ do_gcc_backend() {
CT_DoExecLog ALL ln -sfv "${CT_TARGET}-gcc${ext}" "${CT_PREFIX_DIR}/bin/${CT_TARGET}-cc${ext}"
fi
- if [ "${CT_MULTILIB}" = "y" ]; then
- if [ "${CT_CANADIAN}" = "y" ]; then
- CT_DoLog WARN "Canadian Cross unable to confirm multilibs configured correctly"
+ if [ "${CT_CANADIAN}" = "y" ]; then
+ CT_DoLog EXTRA "Canadian Cross unable to confirm multilibs configured correctly"
+ else
+ multilibs=( $( "${prefix}/bin/${CT_TARGET}-gcc" -print-multi-lib ) )
+ if [ ${#multilibs[@]} -ne 0 ]; then
+ CT_DoLog EXTRA "gcc configured with these multilibs (including the default):"
+ for i in "${multilibs[@]}"; do
+ dir="${i%%;*}"
+ flags="${i#*;}"
+ flags=${flags//@/ -}
+ osdir=$( "${prefix}/bin/${CT_TARGET}-gcc" -print-multi-os-directory $flags )
+ CT_DoLog EXTRA " '${flags}' --> lib/${dir}/ (gcc) lib/${osdir} (os)"
+ done
else
- multilibs=( $( "${prefix}/bin/${CT_TARGET}-gcc" -print-multi-lib \
- |tail -n +2 ) )
- if [ ${#multilibs[@]} -ne 0 ]; then
- CT_DoLog EXTRA "gcc configured with these multilibs (besides the default):"
- for i in "${multilibs[@]}"; do
- dir="${i%%;*}"
- flags="${i#*;}"
- CT_DoLog EXTRA " ${flags//@/ -} --> ${dir}/"
- done
- else
- CT_DoLog WARN "gcc configured for multilib, but none available"
- fi
+ CT_DoLog WARN "no multilib configuration: GCC unusable?"
fi
fi
}