Propagate sanitizer flags to static-library test consumers #614

Closed
opened 2026-10-20 16:13:26 +02:00 by erikinkinen · 0 comments
Owner

Goal

Make the advertised ASan/UBSan build option usable by tests and other consumers of AES static libraries.

Reproduction

On unmodified baseline 6ad94c4, configure a fresh Debug build with -DAES_ENABLE_SANITIZERS=ON -DAES_BUILD_TESTS=ON, then build aes_smoketest. Compilation succeeds but linking fails with undefined __asan_init, __asan_register_globals and related runtime symbols. aes_enable_sanitizers marks compile and link options PRIVATE, so static-library consumers do not receive them. The default non-sanitized build still passes.

Discovered while preparing Phase 2 semantic validation after P2-02 (#85).

Steps

  • Propagate sanitizer instrumentation and runtime requirements to static-library consumers when the explicit sanitizer option is enabled.
  • Validate a fresh sanitized Debug build and the complete test suite, including legacy golden fixtures; preserve the normal build.
  • Record compiler commands, sanitizer-linked binaries and test results, then pass all required CI checks before merge.

Done

The sanitizer option links and runs all tests without manual compiler/linker flags or disabling instrumentation. The ordinary build and exact legacy outputs continue to pass.

## Goal Make the advertised ASan/UBSan build option usable by tests and other consumers of AES static libraries. ## Reproduction On unmodified baseline 6ad94c4, configure a fresh Debug build with `-DAES_ENABLE_SANITIZERS=ON -DAES_BUILD_TESTS=ON`, then build `aes_smoketest`. Compilation succeeds but linking fails with undefined `__asan_init`, `__asan_register_globals` and related runtime symbols. `aes_enable_sanitizers` marks compile and link options PRIVATE, so static-library consumers do not receive them. The default non-sanitized build still passes. Discovered while preparing Phase 2 semantic validation after P2-02 (#85). ## Steps - [x] Propagate sanitizer instrumentation and runtime requirements to static-library consumers when the explicit sanitizer option is enabled. - [x] Validate a fresh sanitized Debug build and the complete test suite, including legacy golden fixtures; preserve the normal build. - [x] Record compiler commands, sanitizer-linked binaries and test results, then pass all required CI checks before merge. ## Done The sanitizer option links and runs all tests without manual compiler/linker flags or disabling instrumentation. The ordinary build and exact legacy outputs continue to pass.
erikinkinen added this to the Phase 2 milestone 2026-10-20 16:13:26 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erikinkinen/AES#614
No description provided.