[test][asan][Darwin] Pass -mlinker-version=133 to linker invocation in odr-lto.cpp
authorArthur Eubanks <aeubanks@google.com>
Wed, 19 Oct 2022 23:33:30 +0000 (16:33 -0700)
committerArthur Eubanks <aeubanks@google.com>
Wed, 19 Oct 2022 23:35:43 +0000 (16:35 -0700)
commit97196a2d9282f4508dcf600d298047c910b2763c
treee770bc935b04c52e4e7ea7cd4a467d1fddfb4234
parent55ae180a4cb7fc68b3ac153f07752c8c6a2d92f0
[test][asan][Darwin] Pass -mlinker-version=133 to linker invocation in odr-lto.cpp

When building clang with lld, we don't get a default mlinker-version [1]. This causes us to not pass -lto_library to ld64 [2].
Explicitly pass -mlinker-version=133 so we properly pass -lto_library to ld64 and don't get LLVM bitcode version mismatches due to LTO.

[1] https://github.com/llvm/llvm-project/blob/55ae180a4cb7fc68b3ac153f07752c8c6a2d92f0/clang/CMakeLists.txt#L345
[2] https://github.com/llvm/llvm-project/blob/55ae180a4cb7fc68b3ac153f07752c8c6a2d92f0/clang/lib/Driver/ToolChains/Darwin.cpp#L262-L270
compiler-rt/test/asan/TestCases/Darwin/odr-lto.cpp