You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upgrade custom libc++ to LLVM 19 and add sanitizer support to build_and_test.sh (#3131)
### Description of changes:
Currently, the custom libc++ used for MSAN/TSAN-instrumented builds is
pinned to LLVM 15, and running sanitizer builds requires manually
assembling the correct CMake flags. Additionally, the no-ASM code paths
are not tested under sanitizers in CI.
This change upgrades the custom libc++ from LLVM 15 to LLVM 19.1.7, adds
first-class `--sanitizer` support to `util/build_and_test.sh`, and
introduces new CI jobs that test the no-ASM code paths under ASan and
MSan.
**LLVM 19 upgrade:**
- Update `Dockerfile.al2023` to clone LLVM 19.1.7 (from 15.0.6)
- Bump `CXX_STANDARD` from 20 to 23 for the custom libc++ build (LLVM 19
added `expected.cpp` which requires C++23)
- Expand `util/bot/libcxx-config/__config_site` with required LLVM 19+
configuration macros (`_LIBCPP_HARDENING_MODE`, positive-sense feature
flags, thread API selection, ASan instrumentation flag)
- Add `util/bot/libcxx-config/__assertion_handler` (required by LLVM 19+
which no longer ships a default)
- Update `linux-multi-arch-omnibus.yml` to use the unversioned
`setup-clang.sh`
**Sanitizer support in `build_and_test.sh`:**
- Add `--sanitizer <name>` flag supporting `asan`, `msan`, `tsan`,
`ubsan`, and `cfi`
- Add `--test <binary>` flag to build and run a single test binary
directly
- Auto-clone LLVM (sparse, cached) when MSAN/TSAN need a custom libc++
and `LLVM_PROJECT_HOME` is not set
- Clean the build directory on sanitizer runs to avoid stale
configuration artifacts
**Bug fix:**
- Zero-initialize `res` and `tmp` arrays in `ec_nistp_scalar_mul` to
eliminate MSAN false positives on unused limbs
### Call-outs:
The new `sanitizer-tests` job in `actions-ci.yml` runs ASan and MSan
with `-DOPENSSL_NO_ASM=1` on x86-64 and aarch64. These jobs do **not**
overlap with the existing `sanitizers` job in
`linux-multi-arch-omnibus.yml`, which runs all five sanitizers (ASan,
MSan, TSan, UBSan, CFI) with ASM enabled inside Docker containers on
CodeBuild via `run_posix_sanitizers.sh`. The new jobs specifically cover
the no-ASM code paths under sanitizers, which were previously untested
in CI.
### Testing:
- New `sanitizer-tests` CI matrix covers ASan + MSan (no-ASM) × {x86-64,
aarch64}
- Existing Docker-based omnibus sanitizer jobs updated to use LLVM 19
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and the ISC license.
0 commit comments