Use ${CT_CC} instead of gcc ...

... when refering to target's compiler.

Signed-off-by: Alexey Neyman <stilor@att.net>
This commit is contained in:
Alexey Neyman 2017-01-13 21:24:16 -08:00
parent d34a6bd8a0
commit c1612e9295
8 changed files with 33 additions and 33 deletions

View File

@ -166,7 +166,7 @@ CT_DoArchUClibcHeaderDir() {
# If it is non-default multilib, add a suffix with architecture (reported by gcc)
# to the headers installation path.
if [ -n "${cflags}" ]; then
eval "${dir_var}="$( ${CT_TARGET}-gcc -print-multiarch ${cflags} )
eval "${dir_var}="$( ${CT_TARGET}-${CT_CC} -print-multiarch ${cflags} )
fi
}
@ -177,6 +177,6 @@ CT_DoArchMUSLHeaderDir() {
# If it is non-default multilib, add a suffix with architecture (reported by gcc)
# to the headers installation path.
if [ -n "${cflags}" ]; then
eval "${dir_var}="$( ${CT_TARGET}-gcc -print-multiarch ${cflags} )
eval "${dir_var}="$( ${CT_TARGET}-${CT_CC} -print-multiarch ${cflags} )
fi
}

View File

@ -168,7 +168,7 @@ cc_gcc_multilib_housekeeping() {
"directly; will use build-compiler for housekeeping."
# Since we cannot run the desired compiler, substitute build-CC with the assumption
# that the host-CC is configured in the same way.
cc="${CT_BUILDTOOLS_PREFIX_DIR}/bin/${CT_TARGET}-gcc"
cc="${CT_BUILDTOOLS_PREFIX_DIR}/bin/${CT_TARGET}-${CT_CC}"
fi
# sed: prepend dashes or do nothing if default is empty string
@ -646,7 +646,7 @@ do_gcc_core_backend() {
if [ "${CT_BARE_METAL},${CT_CANADIAN}" = "y,y" ]; then
repair_cc="CC_FOR_BUILD=${CT_BUILD}-gcc \
CXX_FOR_BUILD=${CT_BUILD}-g++ \
GCC_FOR_TARGET=${CT_TARGET}-gcc"
GCC_FOR_TARGET=${CT_TARGET}-${CT_CC}"
else
repair_cc=""
fi
@ -711,16 +711,16 @@ do_gcc_core_backend() {
CT_DoExecLog ALL make install-{pdf,html}-gcc
fi
# Create a symlink ${CT_TARGET}-cc to ${CT_TARGET}-gcc to always be able
# Create a symlink ${CT_TARGET}-cc to ${CT_TARGET}-${CT_CC} to always be able
# to call the C compiler with the same, somewhat canonical name.
# check whether compiler has an extension
file="$( ls -1 "${prefix}/bin/${CT_TARGET}-gcc."* 2>/dev/null || true )"
file="$( ls -1 "${prefix}/bin/${CT_TARGET}-${CT_CC}."* 2>/dev/null || true )"
[ -z "${file}" ] || ext=".${file##*.}"
if [ -f "${prefix}/bin/${CT_TARGET}-gcc${ext}" ]; then
CT_DoExecLog ALL ln -sfv "${CT_TARGET}-gcc${ext}" "${prefix}/bin/${CT_TARGET}-cc${ext}"
if [ -f "${prefix}/bin/${CT_TARGET}-${CT_CC}${ext}" ]; then
CT_DoExecLog ALL ln -sfv "${CT_TARGET}-${CT_CC}${ext}" "${prefix}/bin/${CT_TARGET}-cc${ext}"
fi
cc_gcc_multilib_housekeeping cc="${prefix}/bin/${CT_TARGET}-gcc" \
cc_gcc_multilib_housekeeping cc="${prefix}/bin/${CT_TARGET}-${CT_CC}" \
host="${host}"
}
@ -1153,15 +1153,15 @@ do_gcc_backend() {
CT_DoExecLog ALL make install-{pdf,html}-gcc
fi
# Create a symlink ${CT_TARGET}-cc to ${CT_TARGET}-gcc to always be able
# Create a symlink ${CT_TARGET}-cc to ${CT_TARGET}-${CT_CC} to always be able
# to call the C compiler with the same, somewhat canonical name.
# check whether compiler has an extension
file="$( ls -1 "${CT_PREFIX_DIR}/bin/${CT_TARGET}-gcc."* 2>/dev/null || true )"
file="$( ls -1 "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${CT_CC}."* 2>/dev/null || true )"
[ -z "${file}" ] || ext=".${file##*.}"
if [ -f "${CT_PREFIX_DIR}/bin/${CT_TARGET}-gcc${ext}" ]; then
CT_DoExecLog ALL ln -sfv "${CT_TARGET}-gcc${ext}" "${prefix}/bin/${CT_TARGET}-cc${ext}"
if [ -f "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${CT_CC}${ext}" ]; then
CT_DoExecLog ALL ln -sfv "${CT_TARGET}-${CT_CC}${ext}" "${prefix}/bin/${CT_TARGET}-cc${ext}"
fi
cc_gcc_multilib_housekeeping cc="${prefix}/bin/${CT_TARGET}-gcc" \
cc_gcc_multilib_housekeeping cc="${prefix}/bin/${CT_TARGET}-${CT_CC}" \
host="${host}"
}

View File

@ -40,9 +40,9 @@ do_debug_duma_build() {
libs="${libs# }"
CT_DoLog EXTRA "Building libraries '${libs}'"
CT_DoExecLog ALL \
make HOSTCC="${CT_BUILD}-gcc" \
CC="${CT_TARGET}-gcc" \
CXX="${CT_TARGET}-gcc" \
make HOSTCC="${CT_BUILD}-gcc" \
CC="${CT_TARGET}-${CT_CC}" \
CXX="${CT_TARGET}-g++" \
RANLIB="${CT_TARGET}-ranlib" \
DUMA_CPP="${DUMA_CPP}" \
${libs}

View File

@ -31,7 +31,7 @@ do_debug_strace_build() {
CT_DoLog EXTRA "Configuring strace"
CT_DoExecLog CFG \
CFLAGS_FOR_BUILD="-I ${CT_BUILD_DIR}/build-strace-headers" \
CC="${CT_TARGET}-gcc" \
CC="${CT_TARGET}-${CT_CC}" \
CPP="${CT_TARGET}-cpp" \
LD="${CT_TARGET}-ld" \
"${CT_SRC_DIR}/strace-${CT_STRACE_VERSION}/configure" \

View File

@ -252,7 +252,7 @@ do_libc_backend_once() {
# but they are not passed by configure. Thus, pass everything in CC instead.
CT_DoExecLog CFG \
BUILD_CC=${CT_BUILD}-gcc \
CC="${CT_TARGET}-gcc ${glibc_cflags}" \
CC="${CT_TARGET}-${CT_CC} ${glibc_cflags}" \
AR=${CT_TARGET}-ar \
RANLIB=${CT_TARGET}-ranlib \
"${CONFIG_SHELL}" \
@ -362,11 +362,11 @@ do_libc_backend_once() {
# However, since we will never actually execute its code,
# it doesn't matter what it contains. So, treating '/dev/null'
# as a C source file, we produce a dummy 'libc.so' in one step
CT_DoExecLog ALL "${CT_TARGET}-gcc" ${multi_flags} \
-nostdlib \
-nostartfiles \
-shared \
-x c /dev/null \
CT_DoExecLog ALL "${CT_TARGET}-${CT_CC}" ${multi_flags} \
-nostdlib \
-nostartfiles \
-shared \
-x c /dev/null \
-o "${startfiles_dir}/libc.so"
fi # threads == nptl
fi # libc_mode = startfiles

View File

@ -126,7 +126,7 @@ do_libc_backend_once() {
obj/crt/crt1.o obj/crt/crti.o obj/crt/crtn.o
CT_DoLog EXTRA "Installing C library start files"
CT_DoExecLog ALL cp -av obj/crt/crt*.o "${multi_root}${multilib_dir}"
CT_DoExecLog ALL ${CT_TARGET}-gcc -nostdlib \
CT_DoExecLog ALL ${CT_TARGET}-${CT_CC} -nostdlib \
-nostartfiles -shared -x c /dev/null -o "${multi_root}${multilib_dir}/libc.so"
fi
if [ "${libc_mode}" = "final" ]; then

View File

@ -197,7 +197,7 @@ do_libc_backend_once() {
# libm.so is needed for ppc, as libgcc is linked against libm.so
# No problem to create it for other archs.
CT_DoLog EXTRA "Building dummy shared libs"
CT_DoExecLog ALL "${CT_TARGET}-gcc" -nostdlib -nostartfiles \
CT_DoExecLog ALL "${CT_TARGET}-${CT_CC}" -nostdlib -nostartfiles \
-shared ${multi_flags} -x c /dev/null -o libdummy.so
CT_DoLog EXTRA "Installing start files"
@ -470,7 +470,7 @@ do_libc_ldso_fixup() {
multilib_dir="/lib/${multi_os_dir}"
CT_SanitizeVarDir multilib_dir
CT_DoExecLog ALL "${CT_TARGET}-gcc" -o test-ldso ../test-ldso.c ${multi_flags}
CT_DoExecLog ALL "${CT_TARGET}-${CT_CC}" -o test-ldso ../test-ldso.c ${multi_flags}
if [ -r "test-ldso.gdb" ]; then
binary="test-ldso.gdb"
else

View File

@ -1621,7 +1621,7 @@ CT_IterateMultilibs() {
# If gcc is not configured for multilib, it still prints a single line
# for the default settings
multilibs=( $("${CT_TARGET}-gcc" -print-multi-lib 2>/dev/null) )
multilibs=( $("${CT_TARGET}-${CT_CC}" -print-multi-lib 2>/dev/null) )
CT_DoExecLog ALL rm -rf "sysroot-check"
for multilib in "${multilibs[@]}"; do
# GCC makes the distinction between:
@ -1657,8 +1657,8 @@ CT_IterateMultilibs() {
# multi_os_dir_gcc.
multi_flags=$( echo "${multilib#*;}" | sed -r -e 's/@/ -/g;' )
multi_dir="${multilib%%;*}"
multi_os_dir=$( "${CT_TARGET}-gcc" -print-multi-os-directory ${multi_flags} )
multi_root=$( "${CT_TARGET}-gcc" -print-sysroot ${multi_flags} )
multi_os_dir=$( "${CT_TARGET}-${CT_CC}" -print-multi-os-directory ${multi_flags} )
multi_root=$( "${CT_TARGET}-${CT_CC}" -print-sysroot ${multi_flags} )
root_suffix="${multi_root#${CT_SYSROOT_DIR}}"
CT_DoExecLog ALL mkdir -p "sysroot-check${root_suffix}"
if [ -e "sysroot-check${root_suffix}/seen" ]; then
@ -1677,10 +1677,10 @@ CT_IterateMultilibs() {
for multilib in "${multilibs[@]}"; do
multi_flags=$( echo "${multilib#*;}" | sed -r -e 's/@/ -/g;' )
multi_dir="${multilib%%;*}"
multi_os_dir=$( "${CT_TARGET}-gcc" -print-multi-os-directory ${multi_flags} )
multi_os_dir=$( "${CT_TARGET}-${CT_CC}" -print-multi-os-directory ${multi_flags} )
multi_os_dir_gcc="${multi_os_dir}"
multi_root=$( "${CT_TARGET}-gcc" -print-sysroot ${multi_flags} )
multi_target=$( "${CT_TARGET}-gcc" -print-multiarch ${multi_flags} )
multi_root=$( "${CT_TARGET}-${CT_CC}" -print-sysroot ${multi_flags} )
multi_target=$( "${CT_TARGET}-${CT_CC}" -print-multiarch ${multi_flags} )
root_suffix="${multi_root#${CT_SYSROOT_DIR}}"
# If GCC did not report the target tuple (i.e. this configuration is not