summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2020-10-08 10:14:36 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2020-10-08 10:14:39 +0200
commit3d011acd3231f45648f6bf9eab9748bb4d9357be (patch)
tree63e1834ae2ea0caa95b7aa6b271e3b21ae2b6528
parent87996101fee3b5f897f68be9f93519e12ca0dd4f (diff)
downloadptxdist-3d011acd3231f45648f6bf9eab9748bb4d9357be.tar.gz
ptxdist-3d011acd3231f45648f6bf9eab9748bb4d9357be.tar.xz
icecc: handle older icecc versionsptxdist-2020.10.0
Older icecc versions can only add gcc or clang to the envronment. So add the gcc arguments first. This way it will always be added but the clang arguments may be ignored. Check the resulting environment to see if clang is present. Skip icecc in the wrapper if clang is not available. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--scripts/lib/ptxd_lib_icecc.sh16
-rwxr-xr-xscripts/wrapper/clang++-wrapper1
-rwxr-xr-xscripts/wrapper/clang-wrapper1
-rwxr-xr-xscripts/wrapper/host-clang++-wrapper1
-rwxr-xr-xscripts/wrapper/host-clang-wrapper1
-rw-r--r--scripts/wrapper/libwrapper.sh15
6 files changed, 27 insertions, 8 deletions
diff --git a/scripts/lib/ptxd_lib_icecc.sh b/scripts/lib/ptxd_lib_icecc.sh
index 06ca99183..98fdd8f42 100644
--- a/scripts/lib/ptxd_lib_icecc.sh
+++ b/scripts/lib/ptxd_lib_icecc.sh
@@ -39,9 +39,10 @@ ptxd_lib_setup_host_icecc() {
args[${#args[@]}]="--clang"
args[${#args[@]}]="${wrapper_dir}/real/clang"
fi
- "${PTXDIST_ICECC_CREATE_ENV}" "${args[@]}" --gcc \
+ "${PTXDIST_ICECC_CREATE_ENV}" --gcc \
"${wrapper_dir}/real/gcc" \
- "${wrapper_dir}/real/g++" > "${PTXDIST_TEMPDIR}/icecc.log" 2>&1 || \
+ "${wrapper_dir}/real/g++" \
+ "${args[@]}" > "${PTXDIST_TEMPDIR}/icecc.log" 2>&1 || \
{
cat "${PTXDIST_TEMPDIR}/icecc.log"
ptxd_bailout "Failed to create icecc host environment!"
@@ -51,6 +52,11 @@ ptxd_lib_setup_host_icecc() {
mv "${PTXDIST_TEMPDIR}/host-gcc-version" "${icecc_dir}/"
fi &&
+ ptxd_get_path "${icecc_dir}/host"/*.tar.gz &&
+ if tar -tf "${ptxd_reply}" | grep -q clang; then
+ export PTXDIST_ICECC_HOST_CLANG=1
+ fi
+
export PTXDIST_ICECC_DIR="${icecc_dir}" &&
if "${PTXDIST_ICECC}" --help | grep -q ICECC_REMOTE_CPP; then
@@ -94,9 +100,9 @@ ptxd_lib_setup_target_icecc() {
args[${#args[@]}]="--clang"
args[${#args[@]}]="${wrapper_dir}/real/${compiler_prefix}clang"
fi
- "${PTXDIST_ICECC_CREATE_ENV}" "${args[@]}" --gcc \
- "${wrapper_dir}/real/${compiler_prefix}gcc" "${gxx}" > \
- "${PTXDIST_TEMPDIR}/icecc.log" 2>&1 || \
+ "${PTXDIST_ICECC_CREATE_ENV}" --gcc \
+ "${wrapper_dir}/real/${compiler_prefix}gcc" "${gxx}" \
+ "${args[@]}" > "${PTXDIST_TEMPDIR}/icecc.log" 2>&1 || \
{
cat "${PTXDIST_TEMPDIR}/icecc.log"
ptxd_bailout "Failed to create icecc target environment!"
diff --git a/scripts/wrapper/clang++-wrapper b/scripts/wrapper/clang++-wrapper
index ae5f97bb0..0aeec2510 100755
--- a/scripts/wrapper/clang++-wrapper
+++ b/scripts/wrapper/clang++-wrapper
@@ -11,6 +11,7 @@ cc_add_target_ld_args
cc_add_fortify
cc_add_pie
cc_add_glibcxx
+clang_check_target_icecc
cxx_add_target_icecc clang
wrapper_exec "$@"
diff --git a/scripts/wrapper/clang-wrapper b/scripts/wrapper/clang-wrapper
index bc4fde9b7..9a9ff6da6 100755
--- a/scripts/wrapper/clang-wrapper
+++ b/scripts/wrapper/clang-wrapper
@@ -11,6 +11,7 @@ cc_add_target_ld_args
cc_add_fortify
cc_add_pie
cc_add_glibcxx
+clang_check_target_icecc
cc_add_target_icecc clang
wrapper_exec "$@"
diff --git a/scripts/wrapper/host-clang++-wrapper b/scripts/wrapper/host-clang++-wrapper
index f45cc1c83..f8142462c 100755
--- a/scripts/wrapper/host-clang++-wrapper
+++ b/scripts/wrapper/host-clang++-wrapper
@@ -9,6 +9,7 @@ cc_check_args "${@}"
cc_add_host_clang
cc_add_host_ld_args
cxx_add_host_extra
+clang_check_host_icecc
cxx_add_host_icecc clang
wrapper_exec "$@"
diff --git a/scripts/wrapper/host-clang-wrapper b/scripts/wrapper/host-clang-wrapper
index 1242cc7e4..e1fa8f297 100755
--- a/scripts/wrapper/host-clang-wrapper
+++ b/scripts/wrapper/host-clang-wrapper
@@ -9,6 +9,7 @@ cc_check_args "${@}"
cc_add_host_clang
cc_add_host_ld_args
cc_add_host_extra
+clang_check_host_icecc
cc_add_host_icecc clang
wrapper_exec "$@"
diff --git a/scripts/wrapper/libwrapper.sh b/scripts/wrapper/libwrapper.sh
index 1eb418699..d86425ac8 100644
--- a/scripts/wrapper/libwrapper.sh
+++ b/scripts/wrapper/libwrapper.sh
@@ -297,9 +297,6 @@ add_icecc_args() {
if [ "${1}" != clang ]; then
add_late_arg "-fno-diagnostics-show-caret"
add_late_arg "-gno-record-gcc-switches"
- elif [ "${PTXDIST_ICECC_CLANG}" != 1 ]; then
- unset PTXDIST_ICECC
- return
fi
if [ "${PTXDIST_ICECC_REMOTE_CPP}" != 1 -o "${ICECC_REMOTE_CPP}" = "0" ]; then
add_late_arg "-Wno-implicit-fallthrough"
@@ -307,6 +304,18 @@ add_icecc_args() {
fi
}
+clang_check_target_icecc() {
+ if [ "${PTXDIST_ICECC_CLANG}" != 1 ]; then
+ unset PTXDIST_ICECC
+ fi
+}
+
+clang_check_host_icecc() {
+ if [ "${PTXDIST_ICECC_HOST_CLANG}" != 1 ]; then
+ unset PTXDIST_ICECC
+ fi
+}
+
cc_add_target_icecc() {
add_icecc_args "${@}"
export ICECC_VERSION="$(echo ${PTXDIST_ICECC_DIR}/target/*.tar.gz)"