@@ -126,6 +126,16 @@ else()
126
126
set (LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "" )
127
127
set (LIBCXX_HARDENING_MODE "none" CACHE STRING "" )
128
128
set (LIBCXX_USE_COMPILER_RT ON CACHE BOOL "" )
129
+ set (COMPILER_RT_BUILD_LIBFUZZER OFF CACHE BOOL "" )
130
+ set (COMPILER_RT_BUILD_PROFILE ON CACHE BOOL "" )
131
+ set (COMPILER_RT_BUILD_SANITIZERS OFF CACHE BOOL "" )
132
+ set (COMPILER_RT_BUILD_XRAY OFF CACHE BOOL "" )
133
+ set (COMPILER_RT_USE_BUILTINS_LIBRARY ON CACHE BOOL "" )
134
+ set (COMPILER_RT_DEFAULT_TARGET_ONLY ON CACHE BOOL "" )
135
+ set (SANITIZER_CXX_ABI "libc++" CACHE STRING "" )
136
+ set (SANITIZER_CXX_ABI_INTREE ON CACHE BOOL "" )
137
+ set (SANITIZER_TEST_CXX "libc++" CACHE STRING "" )
138
+ set (SANITIZER_TEST_CXX_INTREE ON CACHE BOOL "" )
129
139
set (LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "" )
130
140
set (RUNTIMES_CMAKE_ARGS "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13;-DCMAKE_OSX_ARCHITECTURES=arm64|x86_64" CACHE STRING "" )
131
141
endif ()
@@ -165,33 +175,59 @@ endif()
165
175
set (BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "" )
166
176
set (BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "" )
167
177
168
- set (_FUCHSIA_BOOTSTRAP_TARGETS
169
- check-all
170
- check-clang
171
- check-lld
172
- check-llvm
173
- check-polly
174
- llvm-config
175
- clang-test -depends
176
- lld-test -depends
177
- llvm-test -depends
178
- test -suite
179
- test -depends
180
- toolchain-distribution
181
- install -toolchain-distribution
182
- install -toolchain-distribution-stripped
183
- install -toolchain-distribution-toolchain
184
- clang)
185
-
186
- if (FUCHSIA_ENABLE_LLDB)
187
- list (APPEND _FUCHSIA_ENABLE_PROJECTS lldb)
188
- list (APPEND _FUCHSIA_BOOTSTRAP_TARGETS
189
- check-lldb
190
- lldb-test -depends
191
- debugger-distribution
192
- install -debugger-distribution
193
- install -debugger-distribution-stripped
194
- install -debugger-distribution-toolchain)
178
+ if (FUCHSIA_ENABLE_PGO)
179
+ set (BOOTSTRAP_LLVM_BUILD_INSTRUMENTED ON CACHE BOOL "" )
180
+
181
+ set (_FUCHSIA_BOOTSTRAP_TARGETS
182
+ generate-profdata
183
+ stage2
184
+ stage2-toolchain-distribution
185
+ stage2-install -toolchain-distribution
186
+ stage2-install -toolchain-distribution-stripped
187
+ stage2-install -toolchain-distribution-toolchain
188
+ stage2-check-all
189
+ stage2-check-clang
190
+ stage2-check-lld
191
+ stage2-check-llvm
192
+ stage2-check-polly
193
+ stage2-test -suite)
194
+ if (FUCHSIA_ENABLE_LLDB)
195
+ list (APPEND _FUCHSIA_ENABLE_PROJECTS lldb)
196
+ list (APPEND _FUCHSIA_BOOTSTRAP_TARGETS
197
+ stage2-check-lldb
198
+ stage2-debugger-distribution
199
+ stage2-install -debugger-distribution
200
+ stage2-install -debugger-distribution-stripped
201
+ stage2-install -debugger-distribution-toolchain)
202
+ endif ()
203
+ else ()
204
+ set (_FUCHSIA_BOOTSTRAP_TARGETS
205
+ check-all
206
+ check-clang
207
+ check-lld
208
+ check-llvm
209
+ check-polly
210
+ llvm-config
211
+ clang
212
+ clang-test -depends
213
+ lld-test -depends
214
+ llvm-test -depends
215
+ test -suite
216
+ test -depends
217
+ toolchain-distribution
218
+ install -toolchain-distribution
219
+ install -toolchain-distribution-stripped
220
+ install -toolchain-distribution-toolchain)
221
+ if (FUCHSIA_ENABLE_LLDB)
222
+ list (APPEND _FUCHSIA_ENABLE_PROJECTS lldb)
223
+ list (APPEND _FUCHSIA_BOOTSTRAP_TARGETS
224
+ check-lldb
225
+ lldb-test -depends
226
+ debugger-distribution
227
+ install -debugger-distribution
228
+ install -debugger-distribution-stripped
229
+ install -debugger-distribution-toolchain)
230
+ endif ()
195
231
endif ()
196
232
197
233
set (LLVM_ENABLE_PROJECTS ${_FUCHSIA_ENABLE_PROJECTS} CACHE STRING "" )
@@ -200,6 +236,7 @@ set(CLANG_BOOTSTRAP_TARGETS ${_FUCHSIA_BOOTSTRAP_TARGETS} CACHE STRING "")
200
236
get_cmake_property (variableNames VARIABLES )
201
237
foreach (variableName ${variableNames} )
202
238
if (variableName MATCHES "^STAGE2_" )
239
+ list (APPEND EXTRA_ARGS "-D${variableName} =${${variableName} }" )
203
240
string (REPLACE "STAGE2_" "" new_name ${variableName} )
204
241
string (REPLACE ";" "|" value "${${variableName} }" )
205
242
list (APPEND EXTRA_ARGS "-D${new_name} =${value} " )
@@ -209,13 +246,23 @@ endforeach()
209
246
# TODO: This is a temporary workaround until we figure out the right solution.
210
247
set (BOOTSTRAP_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "" )
211
248
249
+ set (LLVM_BUILTIN_TARGETS "default" CACHE STRING "" )
250
+ set (LLVM_RUNTIME_TARGETS "default" CACHE STRING "" )
251
+
212
252
# Setup the bootstrap build.
213
253
set (CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "" )
214
254
set (CLANG_BOOTSTRAP_EXTRA_DEPS
215
255
builtins
216
256
runtimes
217
257
CACHE STRING "" )
218
- set (CLANG_BOOTSTRAP_CMAKE_ARGS
219
- ${EXTRA_ARGS}
220
- -C ${CMAKE_CURRENT_LIST_DIR} /Fuchsia-stage2.cmake
221
- CACHE STRING "" )
258
+ if (FUCHSIA_ENABLE_PGO)
259
+ set (CLANG_BOOTSTRAP_CMAKE_ARGS
260
+ ${EXTRA_ARGS}
261
+ -C ${CMAKE_CURRENT_LIST_DIR} /Fuchsia-stage2-instrumented.cmake
262
+ CACHE STRING "" )
263
+ else ()
264
+ set (CLANG_BOOTSTRAP_CMAKE_ARGS
265
+ ${EXTRA_ARGS}
266
+ -C ${CMAKE_CURRENT_LIST_DIR} /Fuchsia-stage2.cmake
267
+ CACHE STRING "" )
268
+ endif ()
0 commit comments