summaryrefslogtreecommitdiffstats
path: root/bin/ptxdist
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2019-06-06 22:08:10 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2019-09-07 09:42:39 +0200
commit0cfaf3a959cf45406423279f285da7c9453478ca (patch)
tree03228f4dbe3ddce2138017c8a315565e3d282d39 /bin/ptxdist
parentd5ee00c09b826bbafe9bec2227d5aca7bf3a24bd (diff)
downloadptxdist-0cfaf3a959cf45406423279f285da7c9453478ca.tar.gz
ptxdist-0cfaf3a959cf45406423279f285da7c9453478ca.tar.xz
wrapper: add support for clang with OSELAS.Toolchain
This is a bit complex: Clang does not have default CPU features that can be specified at build-time. Instead the some features are derived from the compiler name (e.g. via a symlink with target triple). Others must be specified on the command-line (e.g. -mfpu=...). The toolchain provides wrapper scripts with the target triple to do this. However, using those is incompatible with icecc, because this only works if the actuall binary is called. So we let the toolchain provide the extra options and call clang directly. And fall back to just the target triple if necessary. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'bin/ptxdist')
-rwxr-xr-xbin/ptxdist11
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/ptxdist b/bin/ptxdist
index cc3253db7..3b230527c 100755
--- a/bin/ptxdist
+++ b/bin/ptxdist
@@ -585,6 +585,9 @@ check_compiler_icecc() {
if [ -n "${compiler_prefix}" ]; then
ptxd_get_path "${icecc_dir}/target"/*.tar.gz &&
export ICECC_VERSION_TARGET="${ptxd_reply}"
+ if tar -tf "${ICECC_VERSION_TARGET}" | grep -q clang; then
+ export PTXDIST_ICECC_CLANG=1
+ fi
fi &&
if "${PTXDIST_ICECC}" --help | grep -q ICECC_REMOTE_CPP; then
export PTXDIST_ICECC_REMOTE_CPP=1
@@ -772,6 +775,14 @@ check_compiler() {
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
+ continue
+ fi
+ ptxd_replace_link "${toolchain}/${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 tool in "${toolchain}/${compiler_prefix}"* ; do
local toolname="$(basename "${tool}")"
if [ ! -e "${wrapper_dir}/${toolname}" ]; then