summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2020-05-05 16:21:56 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2020-05-09 16:11:50 +0200
commit57dd7b5e5cadc944ded2f32b268281f573fdb251 (patch)
tree8e5dcd1855a2befe7a2684b2de55e1f0c947f773
parent64358552ea14ec42462a917cb146a92feb85ce10 (diff)
downloadptxdist-57dd7b5e5cadc944ded2f32b268281f573fdb251.tar.gz
ptxdist-57dd7b5e5cadc944ded2f32b268281f573fdb251.tar.xz
wrapper: handle missing tool while setting up the wrapper
When ptxd_lib_setup_target_wrapper() is used while building toolchains, then g++ (for the first stage cross-compiler) and gdb are not available. Also, remove existing files and links when they are not available for the current toolchain. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--scripts/lib/ptxd_lib_wrapper.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/lib/ptxd_lib_wrapper.sh b/scripts/lib/ptxd_lib_wrapper.sh
index 5eb97327e..4cc170b0b 100644
--- a/scripts/lib/ptxd_lib_wrapper.sh
+++ b/scripts/lib/ptxd_lib_wrapper.sh
@@ -187,12 +187,19 @@ export -f ptxd_lib_setup_toolchain
ptxd_lib_setup_target_wrapper() {
for cc in gcc g++ cpp ld gdb; do
+ if [ ! -e "${toolchain}/${compiler_prefix}${cc}" ]; then
+ rm -f "${wrapper_dir}/real/${compiler_prefix}${cc}" \
+ "${wrapper_dir}/${compiler_prefix}${cc}"
+ continue
+ fi
ptxd_replace_link "${toolchain}/${compiler_prefix}${cc}" "${wrapper_dir}/real/${compiler_prefix}${cc}" &&
ptxd_replace_copy_from_path PTXDIST_PATH "scripts/wrapper/${cc}-wrapper" \
"${wrapper_dir}/${compiler_prefix}${cc}"
done &&
for cc in clang clang++; do
if [ ! -e "${toolchain}/${cc}" ]; then
+ rm -f "${wrapper_dir}/real/${compiler_prefix}${cc}" \
+ "${wrapper_dir}/${compiler_prefix}${cc}"
continue
fi
ptxd_replace_link "${toolchain}/${cc}" "${wrapper_dir}/real/${compiler_prefix}${cc}" &&