Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions clang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,24 +108,26 @@
# Allow clang to find our own GCC. Notice the cat does not expand variables because
# we want to resolve the environment when we run, not when we build this, to avoid
# relocation issues in case GCC and clang are not built at the same time.
if [ ! "X$GCC_TOOLCHAIN_ROOT" = X ]; then
cat > "$INSTALLROOT/bin-safe/$(clang --print-target-triple)-clang++.cfg" << \EOF
--gcc-toolchain=$GCC_TOOLCHAIN_ROOT
if [ ! "X$GCC_TOOLCHAIN_REVISION" = X ]; then
cat > "$INSTALLROOT/bin-safe/$($INSTALLROOT/bin-safe/clang --print-target-triple)-clang++.cfg" << EOF

Check notice on line 112 in clang.sh

View workflow job for this annotation

GitHub Actions / alidistlint

Double quote to prevent globbing and word splitting. [SC2086]

Check notice on line 112 in clang.sh

View workflow job for this annotation

GitHub Actions / alidistlint

Double quote to prevent globbing and word splitting. [SC2086]
--gcc-toolchain=<CFGDIR>/../../../$GCC_TOOLCHAIN_VERSION-$GCC_TOOLCHAIN_REVISION
EOF
cat > "$INSTALLROOT/bin-safe/$(clang --print-target-triple)-clang.cfg" << \EOF
--gcc-toolchain=$GCC_TOOLCHAIN_ROOT
cat > "$INSTALLROOT/bin-safe/$($INSTALLROOT/bin-safe/clang --print-target-triple)-clang.cfg" << EOF

Check notice on line 115 in clang.sh

View workflow job for this annotation

GitHub Actions / alidistlint

Double quote to prevent globbing and word splitting. [SC2086]

Check notice on line 115 in clang.sh

View workflow job for this annotation

GitHub Actions / alidistlint

Double quote to prevent globbing and word splitting. [SC2086]
--gcc-toolchain=<CFGDIR>/../../../$GCC_TOOLCHAIN_VERSION-$GCC_TOOLCHAIN_REVISION
EOF
cat > "$INSTALLROOT/bin-safe/$(clang --print-target-triple)-clang-cpp.cfg" << \EOF
--gcc-toolchain=$GCC_TOOLCHAIN_ROOT
cat > "$INSTALLROOT/bin-safe/$($INSTALLROOT/bin-safe/clang --print-target-triple)-clang-cpp.cfg" << EOF

Check notice on line 118 in clang.sh

View workflow job for this annotation

GitHub Actions / alidistlint

Double quote to prevent globbing and word splitting. [SC2086]

Check notice on line 118 in clang.sh

View workflow job for this annotation

GitHub Actions / alidistlint

Double quote to prevent globbing and word splitting. [SC2086]
--gcc-toolchain=<CFGDIR>/../../../$GCC_TOOLCHAIN_VERSION-$GCC_TOOLCHAIN_REVISION
EOF
fi

# Check it actually works
cat << \EOF > test.cc
#include <iostream>
EOF
"$INSTALLROOT/bin-safe/clang++" -v -c test.cc

# Because the build of clang happens in $INSTALLROOT, while GCC is
# in WORK_DIR already, relative lookup in the config is broken. Therefore we
# hardcode the position of the toolchain when testing at build time.
"$INSTALLROOT/bin-safe/clang++" ${GCC_TOOLCHAIN_ROOT:+--gcc-toolchain "$GCC_TOOLCHAIN_ROOT"} -v -c test.cc

# Modulefile
mkdir -p etc/modulefiles
Expand Down