@@ -171,19 +171,6 @@ endif
171
171
# it is then impossible to call non-asserts LLVM libraries (like out-of-tree backends)
172
172
LLVM_CMAKE += -DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF
173
173
174
- ifeq ($(BUILD_CUSTOM_LIBCXX ) ,1)
175
- LLVM_LDFLAGS += -Wl,-rpath,$(build_libdir )
176
- LLVM_CPPFLAGS += -I$(build_includedir )
177
- # We don't want to link to libc++ while trying to build it, so we define these
178
- # flags separately so that we can still pass them to the main LLVM build
179
- LLVM_LIBCXX_LDFLAGS := -lc++ -lc++abi
180
- ifeq ($(USEICC ) ,1)
181
- LLVM_LDFLAGS += -no_cpprt
182
- endif # USEICC
183
- else
184
- LLVM_LIBCXX_LDFLAGS :=
185
- endif # BUILD_CUSTOM_LIBCXX
186
-
187
174
LLVM_CMAKE += -DCMAKE_C_FLAGS="$(LLVM_CPPFLAGS ) $(LLVM_CFLAGS ) " \
188
175
-DCMAKE_CXX_FLAGS="$(LLVM_CPPFLAGS ) $(LLVM_CXXFLAGS ) "
189
176
ifeq ($(OS ) ,Darwin)
@@ -211,88 +198,14 @@ $(llvm_python_workaround):
211
198
ln -sf $(llvm_python_location ) " $@ /python" && \
212
199
ln -sf $(llvm_python_location ) -config " $@ /python-config"
213
200
214
- ifeq ($(BUILD_CUSTOM_LIBCXX ) ,1)
215
-
216
- # Take a snapshot of the CMake flags before linking to -lc++ and -lc++abi
217
- # These are added to the LLVM CMake flags further down
218
- LLVM_CMAKE_LIBCXX := $(LLVM_CMAKE ) \
219
- -DCMAKE_EXE_LINKER_FLAGS="$(LLVM_LDFLAGS ) " \
201
+ LLVM_CMAKE += -DCMAKE_EXE_LINKER_FLAGS="$(LLVM_LDFLAGS ) " \
220
202
-DCMAKE_SHARED_LINKER_FLAGS="$(LLVM_LDFLAGS ) "
221
203
222
- ifeq ($(USEICC ) ,1)
223
- LIBCXX_EXTRA_FLAGS := -Bstatic -lirc -Bdynamic
224
- endif
225
-
226
- # These libraries require unwind.h from the libunwind dependency
227
- ifeq ($(USE_SYSTEM_LIBUNWIND ) ,0)
228
- ifeq ($(OS ) ,Darwin)
229
- BUILT_UNWIND := $(build_prefix ) /manifest/llvmunwind
230
- else
231
- BUILT_UNWIND := $(build_prefix ) /manifest/unwind
232
- endif # Darwin
233
- else
234
- BUILT_UNWIND :=
235
- endif # Building libunwind
236
-
237
- $(LIBCXX_ROOT_DIR ) /libcxx : $(LLVM_LIBCXX_TAR ) | $(LLVM_SRC_DIR ) /source-extracted
238
- $(LIBCXX_ROOT_DIR ) /libcxxabi : $(LLVM_LIBCXXABI_TAR ) | $(LLVM_SRC_DIR ) /source-extracted
239
- $(LLVM_BUILD_DIR ) /libcxx-build/Makefile : | $(LIBCXX_ROOT_DIR ) /libcxx $(LIBCXX_ROOT_DIR ) /libcxxabi $(BUILT_UNWIND )
240
- mkdir -p $(dir $@ )
241
- cd $(dir $@ ) && \
242
- $(CMAKE ) -G " Unix Makefiles" $(CMAKE_COMMON ) $(LLVM_CMAKE_LIBCXX ) -DLIBCXX_CXX_ABI=libcxxabi -DLIBCXX_CXX_ABI_INCLUDE_PATHS=" $( LIBCXX_ROOT_DIR) /libcxxabi/include" $(LIBCXX_ROOT_DIR ) /libcxx -DCMAKE_SHARED_LINKER_FLAGS=" $( LDFLAGS) -L$( build_libdir) $( LIBCXX_EXTRA_FLAGS) "
243
- $(LLVM_BUILD_DIR ) /libcxxabi-build/Makefile : | $(LIBCXX_ROOT_DIR ) /libcxxabi $(LIBCXX_ROOT_DIR ) /libcxx $(BUILT_UNWIND )
244
- mkdir -p $(dir $@ )
245
- cd $(dir $@ ) && \
246
- $(CMAKE ) -G " Unix Makefiles" $(CMAKE_COMMON ) $(LLVM_CMAKE_LIBCXX ) -DLLVM_ABI_BREAKING_CHECKS=" WITH_ASSERTS" -DLLVM_PATH=" $( LLVM_SRC_DIR) " $(LIBCXX_ROOT_DIR ) /libcxxabi -DLIBCXXABI_CXX_ABI_LIBRARIES=" $( LIBCXX_EXTRA_FLAGS) " -DCMAKE_CXX_FLAGS=" $( LLVM_CPPFLAGS) $( LLVM_CXXFLAGS) -std=c++11"
247
- $(LLVM_BUILD_DIR ) /libcxxabi-build/lib/libc++abi.so.1.0 : $(LLVM_BUILD_DIR ) /libcxxabi-build/Makefile $(LIBCXX_ROOT_DIR ) /libcxxabi/.git/HEAD
248
- $(MAKE ) -C $(LLVM_BUILD_DIR ) /libcxxabi-build
249
- touch -c $@
250
- $(build_libdir ) /libc++abi.so.1.0 : $(LLVM_BUILD_DIR ) /libcxxabi-build/lib/libc++abi.so.1.0
251
- $(MAKE ) -C $(LLVM_BUILD_DIR ) /libcxxabi-build install
252
- touch -c $@
253
- # Building this library installs these headers, which breaks other dependencies
254
- -rm -rf $(build_includedir ) /c++
255
- $(LLVM_BUILD_DIR ) /libcxx-build/lib/libc++.so.1.0 : $(build_libdir ) /libc++abi.so.1.0 $(LLVM_BUILD_DIR ) /libcxx-build/Makefile $(LIBCXX_ROOT_DIR ) /libcxx/.git/HEAD
256
- $(MAKE ) -C $(LLVM_BUILD_DIR ) /libcxx-build
257
- $(build_libdir ) /libc++.so.1.0 : $(LLVM_BUILD_DIR ) /libcxx-build/lib/libc++.so.1.0
258
- $(MAKE ) -C $(LLVM_BUILD_DIR ) /libcxx-build install
259
- touch -c $@
260
- # Building this library installs these headers, which breaks other dependencies
261
- -rm -rf $(build_includedir ) /c++
262
- get-libcxx : $(LIBCXX_ROOT_DIR ) /libcxx
263
- get-libcxxabi : $(LIBCXX_ROOT_DIR ) /libcxxabi
264
- install-libcxxabi : $(build_libdir ) /libc++abi.so.1.0
265
- install-libcxx : $(build_libdir ) /libc++.so.1.0
266
- endif # BUILD_CUSTOM_LIBCXX
267
-
268
- # We want to be able to clean without having to pass BUILD_CUSTOM_LIBCXX=1, so define these
269
- # outside of the conditional above, can't use `LIBCXX_ROOT_DIR` since that might come from
270
- # the monorepo.
271
- clean-libcxx :
272
- -$(MAKE ) -C $(LLVM_BUILD_DIR ) /libcxx-build clean
273
- clean-libcxxabi :
274
- -$(MAKE ) -C $(LLVM_BUILD_DIR ) /libcxxabi-build clean
275
- distclean-libcxx :
276
- -rm -rf $(LLVM_LIBCXX_TAR ) $(LLVM_SRC_DIR ) /projects/libcxx $(LLVM_BUILD_DIR ) /libcxx-build
277
- distclean-libcxxabi :
278
- -rm -rf $(LLVM_LIBCXXABI_TAR ) $(LLVM_SRC_DIR ) /projects/libcxxabi $(LLVM_BUILD_DIR ) /libcxxabi-build
279
-
280
-
281
- # We want to ensure that the libcxx linking flags don't get passed to the libcxx build, since it will
282
- # error on a fresh build
283
- LLVM_CMAKE += -DCMAKE_EXE_LINKER_FLAGS="$(LLVM_LDFLAGS ) $(LLVM_LIBCXX_LDFLAGS ) " \
284
- -DCMAKE_SHARED_LINKER_FLAGS="$(LLVM_LDFLAGS ) $(LLVM_LIBCXX_LDFLAGS ) "
285
-
286
204
# change the SONAME of Julia's private LLVM
287
205
# i.e. libLLVM-6.0jl.so
288
206
# see #32462
289
207
LLVM_CMAKE += -DLLVM_VERSION_SUFFIX:STRING="jl"
290
208
291
- ifeq ($(BUILD_CUSTOM_LIBCXX ) ,1)
292
- LIBCXX_DEPENDENCY := $(build_libdir ) /libc++abi.so.1.0 $(build_libdir ) /libc++.so.1.0
293
- get-llvm : get-libcxx get-libcxxabi
294
- endif
295
-
296
209
# Apply version-specific LLVM patches sequentially
297
210
LLVM_PATCH_PREV :=
298
211
define LLVM_PATCH
@@ -365,7 +278,7 @@ endif
365
278
# declare that all patches must be applied before running ./configure
366
279
$(LLVM_BUILDDIR_withtype ) /build-configured : | $(LLVM_PATCH_PREV )
367
280
368
- $(LLVM_BUILDDIR_withtype ) /build-configured : $(SRCCACHE ) /$(LLVM_SRC_DIR ) /source-extracted | $(llvm_python_workaround ) $( LIBCXX_DEPENDENCY )
281
+ $(LLVM_BUILDDIR_withtype ) /build-configured : $(SRCCACHE ) /$(LLVM_SRC_DIR ) /source-extracted | $(llvm_python_workaround )
369
282
mkdir -p $(dir $@ )
370
283
cd $(dir $@ ) && \
371
284
export PATH=$(llvm_python_workaround ) :" $$ PATH" && \
@@ -407,7 +320,7 @@ $(eval $(call staged-install, \
407
320
llvm,$$(LLVM_SRC_DIR)/build_$$(LLVM_BUILDTYPE), \
408
321
LLVM_INSTALL,,,))
409
322
410
- clean-llvm : clean-libcxx clean-libcxxabi
323
+ clean-llvm :
411
324
-rm $(LLVM_BUILDDIR_withtype ) /build-configured $(LLVM_BUILDDIR_withtype ) /build-compiled
412
325
-$(MAKE ) -C $(LLVM_BUILDDIR_withtype ) clean
413
326
0 commit comments