Skip to content

Commit 61cff90

Browse files
author
serge-sans-paille
committed
[BOLT] Support building bolt when LLVM_LINK_LLVM_DYLIB is ON
This does *not* link with libLLVM, but with static archives instead. Not super-great, but at least the build works, which is probably better than failing. Related to #57551 Differential Revision: https://reviews.llvm.org/D134434
1 parent 8b58711 commit 61cff90

File tree

15 files changed

+28
-0
lines changed

15 files changed

+28
-0
lines changed

bolt/lib/Core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ add_llvm_library(LLVMBOLTCore
2424
ParallelUtilities.cpp
2525
Relocation.cpp
2626

27+
DISABLE_LLVM_LINK_LLVM_DYLIB
2728
LINK_LIBS
2829
${LLVM_PTHREAD_LIB}
2930
)

bolt/lib/Passes/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ add_llvm_library(LLVMBOLTPasses
4545
VeneerElimination.cpp
4646
RetpolineInsertion.cpp
4747

48+
DISABLE_LLVM_LINK_LLVM_DYLIB
49+
4850
LINK_LIBS
4951
${LLVM_PTHREAD_LIB}
5052

bolt/lib/Profile/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ add_llvm_library(LLVMBOLTProfile
77
YAMLProfileReader.cpp
88
YAMLProfileWriter.cpp
99

10+
DISABLE_LLVM_LINK_LLVM_DYLIB
11+
1012
LINK_COMPONENTS
1113
Support
1214
)

bolt/lib/Rewrite/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ add_llvm_library(LLVMBOLTRewrite
3333
MachORewriteInstance.cpp
3434
RewriteInstance.cpp
3535

36+
DISABLE_LLVM_LINK_LLVM_DYLIB
37+
3638
LINK_LIBS
3739
${LLVM_PTHREAD_LIB}
3840
)

bolt/lib/RuntimeLibs/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ add_llvm_library(LLVMBOLTRuntimeLibs
1010
RuntimeLibrary.cpp
1111
HugifyRuntimeLibrary.cpp
1212
InstrumentationRuntimeLibrary.cpp
13+
14+
DISABLE_LLVM_LINK_LLVM_DYLIB
1315
)
1416

1517
target_link_libraries(LLVMBOLTRuntimeLibs

bolt/lib/Target/AArch64/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ set(LLVM_LINK_COMPONENTS
77
add_llvm_library(LLVMBOLTTargetAArch64
88
AArch64MCPlusBuilder.cpp
99

10+
DISABLE_LLVM_LINK_LLVM_DYLIB
11+
1012
DEPENDS
1113
AArch64CommonTableGen
1214
)

bolt/lib/Target/X86/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ add_llvm_library(LLVMBOLTTargetX86
99
X86MCPlusBuilder.cpp
1010
X86MCSymbolizer.cpp
1111

12+
DISABLE_LLVM_LINK_LLVM_DYLIB
13+
1214
DEPENDS
1315
X86CommonTableGen
1416
)

bolt/lib/Utils/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ add_llvm_library(LLVMBOLTUtils
22
CommandLineOpts.cpp
33
Utils.cpp
44

5+
DISABLE_LLVM_LINK_LLVM_DYLIB
6+
57
LINK_LIBS
68
${LLVM_PTHREAD_LIB}
79

bolt/tools/bat-dump/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ set(LLVM_LINK_COMPONENTS
55

66
add_llvm_tool(llvm-bat-dump
77
bat-dump.cpp
8+
9+
DISABLE_LLVM_LINK_LLVM_DYLIB
810
)
911

1012
target_link_libraries(llvm-bat-dump

bolt/tools/driver/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ endif()
1414
add_bolt_tool(llvm-bolt
1515
llvm-bolt.cpp
1616

17+
DISABLE_LLVM_LINK_LLVM_DYLIB
18+
1719
DEPENDS
1820
${BOLT_DRIVER_DEPS}
1921
)

0 commit comments

Comments
 (0)