Skip to content

Commit ca8adf2

Browse files
committed
CI: force clang-15 resource dir so generic-linux x86_64 build succeeds
All targets pass now except generic linux x86_64, which kept hitting the clang-14 emmintrin.h SSE2 bug even with LIBCLANG_PATH pointed at libclang-15. Reading clang-sys confirmed why: the offending header comes from the clang *resource directory* (builtin headers), whose resolution is independent of which libclang shared object loads — so on Ubuntu's split layout bindgen still picked clang-14's headers. Pin the resource dir to clang-15 via BINDGEN_EXTRA_CLANG_ARGS=-resource-dir=$(clang-15 -print-resource-dir), which forces emmintrin.h to the fixed copy. aarch64 and the Bref/macOS legs already pass and are untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R3vgA3Q6PR9VQn8X5pLcMR
1 parent ea718d4 commit ca8adf2

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,18 @@ jobs:
4848
- run: sudo apt-get update && sudo apt-get install -y clang-15 libclang-15-dev
4949
- name: Build
5050
run: |
51-
# Point bindgen at libclang-15 specifically (the runner also ships
52-
# libclang-14; a wrong/empty LIBCLANG_PATH silently falls back to it
53-
# and re-triggers the emmintrin bug). Locate the real .so by version.
51+
# The clang-14 emmintrin.h SSE2 bug is triggered by the *resource
52+
# directory* (the compiler's builtin headers), not by which libclang
53+
# loads — so pointing LIBCLANG_PATH at v15 isn't enough; bindgen still
54+
# picks up clang-14's headers. Force clang-15's resource dir via
55+
# bindgen's extra-args env, which pins emmintrin.h to the fixed copy.
5456
dir="$(dirname "$(find /usr/lib /usr/lib64 -name 'libclang-15.so*' -print -quit 2>/dev/null)")"
5557
[ -n "$dir" ] && [ "$dir" != "." ] || { echo "::error::libclang-15 not found"; exit 1; }
56-
echo "Using LIBCLANG_PATH=$dir"
57-
LIBCLANG_PATH="$dir" cargo build --release
58+
export LIBCLANG_PATH="$dir"
59+
export BINDGEN_EXTRA_CLANG_ARGS="-resource-dir=$(clang-15 -print-resource-dir)"
60+
echo "LIBCLANG_PATH=$LIBCLANG_PATH"
61+
echo "BINDGEN_EXTRA_CLANG_ARGS=$BINDGEN_EXTRA_CLANG_ARGS"
62+
cargo build --release
5863
- name: Stage artifact
5964
run: |
6065
mkdir -p dist

0 commit comments

Comments
 (0)