File tree Expand file tree Collapse file tree 2 files changed +29
-4
lines changed Expand file tree Collapse file tree 2 files changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -640,6 +640,11 @@ if (CLANG_ENABLE_BOOTSTRAP)
640
640
set (BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} /${NEXT_CLANG_STAGE}-bins/ )
641
641
642
642
if (BOOTSTRAP_LLVM_ENABLE_LLD )
643
+ # adding lld to clang-bootstrap-deps without having it enabled in
644
+ # LLVM_ENABLE_PROJECTS just generates a cryptic error message.
645
+ if (NOT "lld" IN_LIST LLVM_ENABLE_PROJECTS )
646
+ message (FATAL_ERROR "LLD is enabled in the boostrap build, but lld is not in LLVM_ENABLE_PROJECTS" )
647
+ endif ()
643
648
add_dependencies (clang-bootstrap-deps lld )
644
649
endif ()
645
650
Original file line number Diff line number Diff line change 1
1
set (CMAKE_BUILD_TYPE RELEASE CACHE STRING "" )
2
2
set (CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "" )
3
3
set (LLVM_BUILD_EXTERNAL_COMPILER_RT ON CACHE BOOL "" )
4
- set (BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "" )
5
4
6
- # Use LLD do have less requirements on system linker, unless we're on an apple
7
- # platform where the system compiler is to be prefered.
8
5
if (APPLE )
6
+ # Use LLD to have fewer requirements on system linker, unless we're on an apple
7
+ # platform where the system compiler is to be preferred.
8
+ set (BOOTSTRAP_LLVM_ENABLE_LLD OFF CACHE BOOL "" )
9
+ set (BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "" )
10
+ elseif (CMAKE_HOST_UNIX )
11
+ # s390/SystemZ is unsupported by LLD, so don't try to enable LTO if it
12
+ # cannot work.
13
+ # We do our own uname business here since the appropriate variables from CMake
14
+ # and llvm are not yet available.
15
+ find_program (CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
16
+ if (CMAKE_UNAME )
17
+ exec_program (${CMAKE_UNAME} ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
18
+ RETURN_VALUE val )
19
+ endif (CMAKE_UNAME )
20
+
21
+ if ("${CMAKE_HOST_SYSTEM_PROCESSOR} " MATCHES "s390" )
22
+ set (BOOTSTRAP_LLVM_ENABLE_LTO OFF CACHE BOOL "" )
9
23
set (BOOTSTRAP_LLVM_ENABLE_LLD OFF CACHE BOOL "" )
10
- else ()
24
+ else ()
25
+ set (BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "" )
11
26
set (BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "" )
27
+ endif ()
28
+
29
+ else ()
30
+ set (BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "" )
31
+ set (BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "" )
12
32
endif ()
13
33
14
34
You can’t perform that action at this time.
0 commit comments