@@ -28,13 +28,40 @@ rm -f "$LLVM_TAR"
2828cd $HOME
2929curl -L https://github.com/exaloop/seq/releases/download/v0.11.3/seq-$( uname -s | awk ' {print tolower($0)}' ) -$( uname -m) .tar.gz | tar zxvf - -C .sequre/lib/codon/plugins
3030
31- # Use LLVM-codon clang on Linux; system clang on macOS (darwin LLVM tarball has no clang)
31+ # Pick the C/C++ compiler:
32+ # - macOS: Apple's system clang. It knows the SDK sysroot for both the plugin
33+ # build and the standalone launcher. (The LLVM-codon darwin tarball now ships
34+ # a clang too, but it has no default sysroot, so system headers like glob.h
35+ # are not found when building the launcher directly.)
36+ # - Linux: the LLVM-codon clang, to match the bundled LLVM toolchain.
37+ case " $( uname -s) " in
38+ Darwin* )
39+ CC=$( command -v clang)
40+ CXX=$( command -v clang++)
41+ ;;
42+ * )
43+ if [ -f " $OPT /llvm-codon/bin/clang" ]; then
44+ CC=$OPT /llvm-codon/bin/clang
45+ CXX=$OPT /llvm-codon/bin/clang++
46+ else
47+ CC=$( command -v clang)
48+ CXX=$( command -v clang++)
49+ fi
50+ ;;
51+ esac
52+
53+ # On manylinux_2_28 the default toolchain is a gcc-toolset under /opt/rh, which
54+ # the LLVM-codon clang does not auto-detect, so it cannot find libstdc++ (or the
55+ # C++20 headers) when linking the plugin. Point clang at it via a config file,
56+ # matching how Codon builds its own plugins (see exaloop/codon
57+ # .github/build-linux/Dockerfile.linux-x86_64). No-op off manylinux: the glob is
58+ # empty (e.g. on macOS), so no config file is written.
3259if [ -f " $OPT /llvm-codon/bin/clang" ]; then
33- CC= $OPT /llvm-codon/bin/clang
34- CXX= $OPT /llvm-codon/bin/clang++
35- else
36- CC= $( command -v clang)
37- CXX= $( command -v clang++ )
60+ GCC_INSTALL_DIR= $( ls -d /opt/rh/gcc-toolset- * /root/usr/lib/gcc/ * / * 2> /dev/null | sort -V | tail -1 )
61+ if [ -n " $GCC_INSTALL_DIR " ] ; then
62+ echo " --gcc-install-dir= $GCC_INSTALL_DIR " > " $OPT /llvm-codon/bin/clang.cfg "
63+ echo " --gcc-install-dir= $GCC_INSTALL_DIR " > " $OPT /llvm-codon/bin/ clang++.cfg "
64+ fi
3865fi
3966
4067cd $1
0 commit comments