RFR: 8347347: Build fails undefined symbol: __asan_init by clang17

SendaoYan syan at openjdk.org
Wed Jan 15 07:56:09 UTC 2025


Hi all,
This PR fix the bugs which build fails "undefined symbol: __asan_init" by clang17 with configure parameter "--enable-asan".
With clang, [-static-libsan is the default](https://github.com/google/sanitizers/issues/1086#issuecomment-509775957), -shared-libsan forces the linker to use the shared asan run-time. And with [gcc there is no this issue](https://github.com/google/sanitizers/issues/1169#issuecomment-558947352).
This PR append `-shared-libasan` link flags to `ASAN_LDFLAGS` will fix the make failure. The change has been verified locally, risk is low.

-------------

Commit messages:
 - 8347347: Build fails undefined symbol: __asan_init by clang17
 - 8347347: Build fails undefined symbol: __asan_init by clang17

Changes: https://git.openjdk.org/jdk/pull/23124/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23124&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8347347
  Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/23124.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23124/head:pull/23124

PR: https://git.openjdk.org/jdk/pull/23124


More information about the build-dev mailing list