It is consumed by the ASan runtime itself, which is loaded first well before main(int, char**) is invoked. In order for ASan to find it, the symbol to it has to be exported. See references to __asan_default_options in https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/asan/asan_flags.cpp. GCC uses the same runtime library as does MSVC.
On Thu, Feb 16, 2023 at 5:38 AM Thomas Stüfe <thomas.stu...@gmail.com> wrote: > I’m curious, why does the options function have to be exported? Who is > consuming it? > > On Wed 15. Feb 2023 at 19:01, Justin King <jck...@openjdk.org> wrote: > >> Update build-related infrastructure to support building with ASan under >> Microsoft Visual C++. >> >> ------------- >> >> Commit messages: >> - Move comment to appropriate location >> - Use elif instead of separate if >> - Only pass -fsanitize=address to linker for Clang/GCC >> - Update asan_default_options.c with MSVC-specific extensions >> - Support using ASan with MSVC >> >> Changes: https://git.openjdk.org/jdk/pull/12580/files >> Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12580&range=00 >> Issue: https://bugs.openjdk.org/browse/JDK-8302599 >> Stats: 25 lines in 2 files changed: 18 ins; 0 del; 7 mod >> Patch: https://git.openjdk.org/jdk/pull/12580.diff >> Fetch: git fetch https://git.openjdk.org/jdk pull/12580/head:pull/12580 >> >> PR: https://git.openjdk.org/jdk/pull/12580 >> > -- [image: Google Logo] Justin King Software Engineer jck...@google.com
smime.p7s
Description: S/MIME Cryptographic Signature