summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2021-05-21 08:10:53 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2021-05-21 08:23:24 +0200
commita17f1ce2ec28aa5b38ea4969c6694ce0f1437ad8 (patch)
treec019cc61d547f16ceda13cab0929d543c29b12ab
parentb6c48ecdeac72c2e10def7f3d4efdd90ad56313d (diff)
downloadOSELAS.Toolchain-a17f1ce2ec28aa5b38ea4969c6694ce0f1437ad8.tar.gz
OSELAS.Toolchain-a17f1ce2ec28aa5b38ea4969c6694ce0f1437ad8.tar.xz
cross-gcc*: only use icerun for newer versions
Old icerun versions don't work with relative paths to the executable. So test this and disable icerun in this case. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--rules/cross-gcc-first.make2
-rw-r--r--rules/cross-gcc.make2
-rw-r--r--scripts/lib/ptxd_make_icecc_check.sh29
3 files changed, 31 insertions, 2 deletions
diff --git a/rules/cross-gcc-first.make b/rules/cross-gcc-first.make
index ebd4709..4879c10 100644
--- a/rules/cross-gcc-first.make
+++ b/rules/cross-gcc-first.make
@@ -65,7 +65,7 @@ CROSS_GCC_FIRST_MAKE_ENV := \
ifdef PTXDIST_ICECC
CROSS_GCC_FIRST_MAKE_ENV += \
- STAGE_CC_WRAPPER=icerun
+ STAGE_CC_WRAPPER=$(PTXDIST_ICERUN)
endif
# ----------------------------------------------------------------------------
diff --git a/rules/cross-gcc.make b/rules/cross-gcc.make
index 4faa421..95e1a2d 100644
--- a/rules/cross-gcc.make
+++ b/rules/cross-gcc.make
@@ -153,7 +153,7 @@ CROSS_GCC_MAKE_ENV := \
ifdef PTXDIST_ICECC
CROSS_GCC_MAKE_ENV += \
- STAGE_CC_WRAPPER=icerun
+ STAGE_CC_WRAPPER=$(PTXDIST_ICERUN)
endif
CROSS_GCC_MAKE_OPT := \
diff --git a/scripts/lib/ptxd_make_icecc_check.sh b/scripts/lib/ptxd_make_icecc_check.sh
new file mode 100644
index 0000000..63f4c65
--- /dev/null
+++ b/scripts/lib/ptxd_make_icecc_check.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+#
+# Copyright (C) 2021 by Michael Olbrich <m.olbrich@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+
+ptxd_make_icecc_check() {
+ local sysroot_host
+
+ if [ -z "${PTXDIST_ICECC}" ]; then
+ return
+ fi
+
+ # old icerun versions cannot handle relative paths
+ sysroot_host="$(ptxd_get_ptxconf PTXCONF_SYSROOT_HOST)" &&
+ sysroot_host=".${sysroot_host#${PTXDIST_WORKSPACE}}"
+ ln -s /bin/true "${sysroot_host}/bin/test-icerun" &&
+ icerun "${sysroot_host}/bin/test-icerun" || {
+ echo "Disabling broken icerun!"
+ unset PTXDIST_ICERUN
+ }
+ rm -f "${sysroot_host}/bin/test-icerun"
+}
+
+ptxd_make_icecc_check
+