[compiler-rt] 97196a2 - [test][asan][Darwin] Pass -mlinker-version=133 to linker invocation in odr-lto.cpp

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 19 16:36:07 PDT 2022


Author: Arthur Eubanks
Date: 2022-10-19T16:35:43-07:00
New Revision: 97196a2d9282f4508dcf600d298047c910b2763c

URL: https://github.com/llvm/llvm-project/commit/97196a2d9282f4508dcf600d298047c910b2763c
DIFF: https://github.com/llvm/llvm-project/commit/97196a2d9282f4508dcf600d298047c910b2763c.diff

LOG: [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

Added: 
    

Modified: 
    compiler-rt/test/asan/TestCases/Darwin/odr-lto.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/asan/TestCases/Darwin/odr-lto.cpp b/compiler-rt/test/asan/TestCases/Darwin/odr-lto.cpp
index e1e454be077fa..55953d33940a8 100644
--- a/compiler-rt/test/asan/TestCases/Darwin/odr-lto.cpp
+++ b/compiler-rt/test/asan/TestCases/Darwin/odr-lto.cpp
@@ -5,7 +5,7 @@
 
 // RUN: %clangxx_asan -DPART=0 -c %s -o %t-1.o -flto -mllvm -asan-use-private-alias
 // RUN: %clangxx_asan -DPART=1 -c %s -o %t-2.o -flto -mllvm -asan-use-private-alias
-// RUN: %clangxx_asan %t-1.o %t-2.o -o %t -flto
+// RUN: %clangxx_asan %t-1.o %t-2.o -o %t -flto -mlinker-version=133
 // RUN: %run %t 2>&1 | FileCheck %s
 
 #include <stdio.h>


        


More information about the llvm-commits mailing list