tests: resolve add-on RTTI from complete static libc++.a (vs orc_rt's… #25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: jitmin | |
| on: | |
| push: | |
| branches: [jit-coff-load-diag] | |
| workflow_dispatch: {} | |
| jobs: | |
| jitmin: | |
| name: jitmin (COFF JIT isolation) | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install sdk37 (lean -- no choco/nsis) | |
| shell: bash | |
| run: | | |
| set -e | |
| mkdir -p /c/ossia-sdk-x86_64 | |
| cd /c/ossia-sdk-x86_64 | |
| curl -L -s https://github.com/ossia/sdk/releases/download/sdk37/sdk-mingw-x86_64.7z -o sdk.7z | |
| 7z x -y sdk.7z >/dev/null | |
| rm -f sdk.7z | |
| - name: Locate toolchain | |
| id: tc | |
| shell: bash | |
| run: | | |
| set -e | |
| SDK=/c/ossia-sdk-x86_64 | |
| CXX=$(find "$SDK/llvm" -name 'clang++.exe' | head -1) | |
| CC=$(find "$SDK/llvm" -name 'clang.exe' | head -1) | |
| # Use llvm-mingw's OWN orc_rt (ABI-matched to the libc++ that compiles | |
| # the add-on + the runtime libc++.dll), NOT the separately-built | |
| # llvm-libs one (clone-llvm LLVM source -> different libc++abi). | |
| ORC=$(find "$SDK/llvm/lib/clang" -path '*windows*' -name 'liborc_rt-x86_64.a' | head -1) | |
| # Complete static libc++ (libc++abi merged in) -- the full cxxabi RTTI. | |
| LIBCXXA=$(find "$SDK/llvm" -path '*x86_64-w64-mingw32*' -name 'libc++.a' | head -1) | |
| LLVMDIR=$(find "$SDK/llvm-libs" -name 'LLVMConfig.cmake' -printf '%h\n' | head -1) | |
| echo "cxx=$CXX" >> $GITHUB_OUTPUT | |
| echo "cc=$CC" >> $GITHUB_OUTPUT | |
| echo "orc=$ORC" >> $GITHUB_OUTPUT | |
| echo "libcxxa=$LIBCXXA" >> $GITHUB_OUTPUT | |
| echo "llvmdir=$LLVMDIR" >> $GITHUB_OUTPUT | |
| echo "found: CXX=$CXX | ORC=$ORC | LIBCXXA=$LIBCXXA | LLVMConfig=$LLVMDIR" | |
| - name: Build jitmin | |
| shell: bash | |
| run: | | |
| set -ex | |
| export PATH="/c/ossia-sdk-x86_64/llvm/bin:$PATH" | |
| cmake -S tests/jit-min -B build -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_C_COMPILER="${{ steps.tc.outputs.cc }}" \ | |
| -DCMAKE_CXX_COMPILER="${{ steps.tc.outputs.cxx }}" \ | |
| -DLLVM_DIR="${{ steps.tc.outputs.llvmdir }}" \ | |
| -DCMAKE_CXX_FLAGS="-stdlib=libc++" | |
| cmake --build build -v | |
| - name: Compile cases + run jitmin (isolation matrix) | |
| shell: bash | |
| run: | | |
| set +e # don't abort the step when jitmin crashes; record every result | |
| export PATH="/c/ossia-sdk-x86_64/llvm/bin:$PATH" | |
| CXX="${{ steps.tc.outputs.cxx }}" | |
| ORC="${{ steps.tc.outputs.orc }}" | |
| LIBCXXA="${{ steps.tc.outputs.libcxxa }}" | |
| for c in tests/jit-min/cases/*.cpp; do | |
| n=$(basename "$c" .cpp) | |
| "$CXX" -target x86_64-w64-windows-gnu -stdlib=libc++ -mcmodel=large -O0 -S -emit-llvm "$c" -o "$n.ll" | |
| echo "::group::RUN $n (init)" | |
| ./build/jitmin.exe "$ORC" "$n.ll" entry "$LIBCXXA" | |
| echo " >>> $n init exit=$?" | |
| echo "::endgroup::" | |
| echo "::group::RUN $n (SKIP_INIT)" | |
| SKIP_INIT=1 ./build/jitmin.exe "$ORC" "$n.ll" entry "$LIBCXXA" | |
| echo " >>> $n skipinit exit=$?" | |
| echo "::endgroup::" | |
| # Native-TLS variant: does JITLink handle COFF .tls without emutls? | |
| case "$n" in c03*|c04*) | |
| "$CXX" -target x86_64-w64-windows-gnu -stdlib=libc++ -fno-emulated-tls \ | |
| -O0 -S -emit-llvm "$c" -o "$n.native.ll" | |
| echo "::group::RUN $n (native-tls, init)" | |
| ./build/jitmin.exe "$ORC" "$n.native.ll" entry | |
| echo " >>> $n native-tls init exit=$?" | |
| echo "::endgroup::" | |
| ;; esac | |
| done | |
| echo "all cases done" |