RFR: JDK-8302599: Extend ASan support to Microsoft Visual C++

Magnus Ihse Bursie ihse at openjdk.org
Thu Feb 16 16:30:31 UTC 2023


On Wed, 15 Feb 2023 17:53:49 GMT, Justin King <jcking at openjdk.org> wrote:

> Update build-related infrastructure to support building with ASan under Microsoft Visual C++.

It basically looks good but need some more polishing.

make/autoconf/jdk-options.m4 line 427:

> 425:       ],
> 426:       IF_ENABLED: [
> 427:         ASAN_CFLAGS="-fsanitize=address"

It seems like more of a coincidence than a obvious fact to base the design on that `-fsanitize=address` happens to work on both ms cl.exe and gcc/clang.

Maybe this is the herald of a new age of compiler switches getting cross-compiler standard names (let's hope!), but I think it still makes more sense to not share CFLAGS between microsoft and clang/gcc.

Or, more concretely: There is no need to define `ASAN_CFLAGS` and `ASAN_LDFLAGS` outside the two toolchain specific clauses.

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

Marked as reviewed by ihse (Reviewer).

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



More information about the build-dev mailing list