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

Justin King jcking at openjdk.org
Sat Feb 18 18:08:56 UTC 2023


On Thu, 16 Feb 2023 16:27:16 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:

>> Justin King has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update based on review
>>   
>>   Signed-off-by: Justin King <jcking at google.com>
>
> 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.

Updated to what I think you were requesting. PTAL.

> make/autoconf/jdk-options.m4 line 438:
> 
>> 436:         elif test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then
>> 437:           # MSVC produces a warning if you pass -fsanitize=address to the linker.
>> 438:           ASAN_CFLAGS="$ASAN_CFLAGS -Oy-"
> 
> What is the purpose of `/Oy-`? Can you explain it in a short comment?

Added a comment.

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

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



More information about the build-dev mailing list