summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2019-06-06 22:31:59 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2019-09-07 12:00:33 +0200
commitd0728b86f03184a4679d173ac9d47b0b5363bfdb (patch)
tree722aa96b95e4fd272cf725b878a63a0fc517941c /bin
parent0cfaf3a959cf45406423279f285da7c9453478ca (diff)
downloadptxdist-d0728b86f03184a4679d173ac9d47b0b5363bfdb.tar.gz
ptxdist-d0728b86f03184a4679d173ac9d47b0b5363bfdb.tar.xz
ptxdist: enable clang with icecc
This is a bit more complicated. The symlink for clang that is passed to icecc-create-env must contain a proper cross-compile prefix. Otherwise, querying 'as' will return the wrong path (host instead of the toolchain 'as'). The same happens for 'objcopy'. In addition icecc-create-env for all releases including 1.2 is broken and resolves the symlink first, so the created environment contains the wrong 'as'. So ptxdist needs a check for this and disable icecc clang support if necessary. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ptxdist21
1 files changed, 20 insertions, 1 deletions
diff --git a/bin/ptxdist b/bin/ptxdist
index 3b230527c..931061efc 100755
--- a/bin/ptxdist
+++ b/bin/ptxdist
@@ -570,10 +570,29 @@ check_compiler_icecc() {
if [ -n "${compiler_prefix}" ]; then
echo "Creating icecc target environment..."
cd "${icecc_dir}/target"
- "${PTXDIST_ICECC_CREATE_ENV}" --gcc \
+ local -a args
+ if [ -e "${wrapper_dir}/real/${compiler_prefix}clang" ]; then
+ args[${#args[@]}]="--clang"
+ args[${#args[@]}]="${wrapper_dir}/real/${compiler_prefix}clang"
+ fi
+ "${PTXDIST_ICECC_CREATE_ENV}" "${args[@]}" --gcc \
"${wrapper_dir}/real/${compiler_prefix}gcc" \
"${wrapper_dir}/real/${compiler_prefix}g++" > /dev/null 2>&1 || \
ptxd_bailout "Failed!"
+ if [ ${#args[*]} -gt 0 ]; then
+ tar --strip-components=2 -xf *.tar.gz usr/bin/as &&
+ ./as --verbose --version > env.log 2>&1 &&
+ ${compiler_prefix}as --verbose --version > real.log 2>&1
+ if ! cmp -s env.log real.log; then
+ echo "Broken icecc-create-env, disabling icecc clang support!"
+ rm *.tar.gz
+ "${PTXDIST_ICECC_CREATE_ENV}" --gcc \
+ "${wrapper_dir}/real/${compiler_prefix}gcc" \
+ "${wrapper_dir}/real/${compiler_prefix}g++" > /dev/null || \
+ ptxd_bailout "Failed!"
+ fi
+ rm as env.log real.log
+ fi
ln -s "${toolchain}" "${icecc_dir}/toolchain"
fi
) &&