Skip to content

tests: [diag] resolve add-on against host only (drop orc_rt PlatformJ… #21

tests: [diag] resolve add-on against host only (drop orc_rt PlatformJ…

tests: [diag] resolve add-on against host only (drop orc_rt PlatformJ… #21

Workflow file for this run

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)
ORC=$(find "$SDK/llvm-libs/lib/clang" -name 'liborc_rt-x86_64.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 "llvmdir=$LLVMDIR" >> $GITHUB_OUTPUT
echo "found: CXX=$CXX | ORC=$ORC | LLVMConfig=$LLVMDIR"
- name: Dump cxxabi type_info exports (si vs vmi)
shell: bash
run: |
set -e
SDK=/c/ossia-sdk-x86_64
RO=$(find "$SDK/llvm" -name 'llvm-readobj.exe' | head -1)
for d in $(find "$SDK" -name 'libc++*.dll' | head -3) $(find "$SDK" -name 'libc++abi*.dll' | head -3); do
echo "===== $d ====="
"$RO" --coff-exports "$d" 2>/dev/null | grep -iE "class_type_info|__dynamic_cast|__cxa_" | head -20 || true
done
echo "===== grep across all dlls for vmi/si vtables ====="
for dll in $(find "$SDK" -name '*.dll'); do
if "$RO" --coff-exports "$dll" 2>/dev/null | grep -qE "_ZTVN10__cxxabiv121__vmi_class_type_infoE"; then echo "VMI vtable exported by: $dll"; fi
if "$RO" --coff-exports "$dll" 2>/dev/null | grep -qE "_ZTVN10__cxxabiv120__si_class_type_infoE"; then echo "SI vtable exported by: $dll"; fi
done
- 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 }}"
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
echo " >>> $n init exit=$?"
echo "::endgroup::"
echo "::group::RUN $n (SKIP_INIT)"
SKIP_INIT=1 ./build/jitmin.exe "$ORC" "$n.ll" entry
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"