Add libclang-rt and sanitizer verification workflow #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #5
Summary
This PR ensures all Clang-based Docker images (versions 14–22) include the required compiler-rt (libclang-rt) runtime libraries and adds a GitHub Actions workflow that verifies key sanitizers (Address, Undefined, and Thread where available) for both Clang and GCC.
Background / Problem
Issue #5 reported that builds using
-fsanitize=address
with Clang 19 failed to link due to missing ASan runtime archives, with the linker even searching paths referring to an older LLVM version (e.g. clang/16). That indicates:Without the correct runtime libraries (ASan, UBSan, TSan, etc.), sanitizer-enabled builds fail at link time, undermining CI reliability for projects depending on these images.
Changes in This PR
clang++
(via update-alternatives or symlinks) matches the installed runtime set.Rationale
Embedding the proper runtime libraries directly in each image and continuously validating them prevents late surprises in downstream CI pipelines. This “fail early” approach is especially important for projects that rely on sanitizers for memory safety and UB diagnostics.
Reproduction (Before Fix)
clang19
image.-fsanitize=address
and build with Clang 19.libclang_rt.asan-*.a
under an incorrect version path.Validation (After Fix)
clang19
(or other) image.-fsanitize=address
.Testing Performed
/usr/lib/llvm-<ver>/lib/clang/<ver>/lib/linux/
.clang++ --version
aligns with installed runtime path.Maintenance Notes
Possible Follow-ups (Not Included Here)
Related Issue
Closes #5 (missing ASan runtime libraries in Clang images).
Feedback welcome—especially on: