-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Further improve LLVM building #18606
Changes from 12 commits
f58486e
8a69b26
6050fcc
38ff145
8d3ee7e
8658db1
794bf5f
4b1aac4
821bc06
64c706e
9bad31f
8c684ff
7f4799e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
include $(THIRD_PARTY_DIR)/llvm/Makefile.share-bundled | ||
|
||
# Link statically on Cray systems to avoid problems with | ||
# finding libstdc++ with different PrgEnv compilers. | ||
CHPL_LLVM_DYNAMIC := 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question for reviewer: Given that we weren't linking dynamically before and such linking can lead to rpath issues, should we switch to always statically linking with the bundled LLVM for now until the rpath issues are resolved? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would be fine sticking with static linking for the bundled version. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, that's what I've done |
||
ifneq (, $(findstring cray,$(CHPL_MAKE_HOST_PLATFORM))) | ||
CHPL_LLVM_DYNAMIC := 0 | ||
endif | ||
|
||
# Enable RV and Polly if they are in the source directory | ||
LLVM_RV_FILE = $(LLVM_DIR)/$(LLVM_SUBDIR)/tools/rv/ | ||
LLVM_RV_FILE2 = $(LLVM_DIR)/$(LLVM_SUBDIR)/../rv/ | ||
|
@@ -20,28 +27,20 @@ endif | |
ifdef HAVE_LLVM_CONFIG | ||
ifndef LLVM_LLVM_LIBS | ||
|
||
ifeq ($(LLVM_MAJOR_VERSION),10) | ||
# frontendopenmp seems to be required to link clang in llvm 10 | ||
# but not in earlier or later versions | ||
export LLVM_LLVM_LIBS=$(shell $(LLVM_CONFIG) --ldflags --system-libs --libs bitreader bitwriter frontendopenmp ipo instrumentation option objcarcopts profiledata all-targets coverage coroutines lto) | ||
else | ||
export LLVM_LLVM_LIBS_TMP=$(shell $(LLVM_CONFIG) --ldflags --system-libs --libs bitreader bitwriter ipo instrumentation option objcarcopts profiledata all-targets coverage coroutines lto) | ||
# remove -llibxml2.tbd which seems to appear on some Mac OS X versions | ||
# with LLVM 11. | ||
export LLVM_LLVM_LIBS=$(subst -llibxml2.tbd,,$(LLVM_LLVM_LIBS_TMP)) | ||
endif | ||
export LLVM_LLVM_LIBS_TMP=$(shell $(LLVM_CONFIG) --ldflags --system-libs --libs bitreader bitwriter ipo instrumentation option objcarcopts profiledata all-targets coverage coroutines lto) | ||
# remove -llibxml2.tbd which seems to appear on some Mac OS X versions | ||
# with LLVM 11. | ||
export LLVM_LLVM_LIBS=$(subst -llibxml2.tbd,,$(LLVM_LLVM_LIBS_TMP)) | ||
|
||
endif | ||
endif | ||
|
||
ifeq ($(LLVM_MAJOR_VERSION_9PLUS),9) | ||
# -lclangASTMatchers needed for LLVM 9 but not earlier | ||
LLVM_CLANG_LIBS=-lclangFrontend -lclangSerialization -lclangDriver -lclangCodeGen -lclangParse -lclangSema -lclangAnalysis -lclangEdit -lclangASTMatchers -lclangAST -lclangLex -lclangBasic | ||
ifeq ($(CHPL_LLVM_DYNAMIC),1) | ||
LLVM_CLANG_LIBS=-lclang-cpp | ||
else | ||
LLVM_CLANG_LIBS=-lclangFrontend -lclangSerialization -lclangDriver -lclangCodeGen -lclangParse -lclangSema -lclangAnalysis -lclangEdit -lclangAST -lclangLex -lclangBasic | ||
LLVM_CLANG_LIBS=-lclangFrontend -lclangSerialization -lclangDriver -lclangCodeGen -lclangParse -lclangSema -lclangAnalysis -lclangEdit -lclangASTMatchers -lclangAST -lclangLex -lclangBasic | ||
endif | ||
|
||
|
||
ifdef CHPL_RV | ||
LLVM_RV_CFLAGS=-DHAVE_LLVM_RV=1 | ||
LLVM_RV_LIBS=-lRV -lgensleef | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need the above comment and conditionals or can we just always set this (wondering if
CHPL_MAKE_LLVM_CLANG_COMPILE_ARGS
is empty when the above conditions aren't set)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think we could always set it and I'd expect it to be empty if the above conditions aren't set. For now though I will leave this as-is in the PR.