From 40d65fcee7c5717e469648e81ab4618b27c56b94 Mon Sep 17 00:00:00 2001 From: aherlihy Date: Fri, 14 Nov 2014 03:24:55 +0000 Subject: [PATCH 1/3] removed --start-group and --end-group for darwin --- Makefile | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 8a6dcfd..7bbfb55 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,8 @@ # This code is in the public domain #------------------------------------------------------------------------------- +UNAME := $(shell uname -s) + # The following variables will likely need to be customized, depending on where # and how you built LLVM & Clang. They can be overridden by setting them on the # make command line: "make VARNAME=VALUE", etc. @@ -67,8 +69,13 @@ CLANG_INCLUDES := \ # because there are circular dependencies that make the correct order difficult # to specify and maintain. The linker group options make the linking somewhat # slower, but IMHO they're still perfectly fine for tools that link with Clang. -CLANG_LIBS := \ - -Wl,--start-group \ + +ifneq ($(UNAME),Darwin) + CLANG_LIBS += \ + -Wl,--start-group +endif + +CLANG_LIBS += \ -lclangAST \ -lclangAnalysis \ -lclangBasic \ @@ -88,8 +95,12 @@ CLANG_LIBS := \ -lclangStaticAnalyzerCore \ -lclangSerialization \ -lclangToolingCore \ - -lclangTooling \ - -Wl,--end-group + -lclangTooling + +ifneq ($(UNAME),Darwin) + CLANG_LIBS += \ + -Wl,--end-group +endif # Internal paths in this project: where to find sources, and where to put # build artifacts. From 7d48bc360ef4d5da4b7c1b2d4775ceb7256299f8 Mon Sep 17 00:00:00 2001 From: aherlihy Date: Fri, 14 Nov 2014 03:35:43 +0000 Subject: [PATCH 2/3] set undefined linker behavior to dynamic_lookup --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7bbfb55..e72c1e8 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ LLVM_LDFLAGS := `$(LLVM_BIN_PATH)/llvm-config --ldflags --libs --system-libs` # libs to be linked more than once because it uses globals for configuration # and plugin registration, and these trample over each other. LLVM_LDFLAGS_NOLIBS := `$(LLVM_BIN_PATH)/llvm-config --ldflags` -PLUGIN_LDFLAGS := -shared +PLUGIN_LDFLAGS := -shared -Wl,-undefined,dynamic_lookup CLANG_INCLUDES := \ -I$(LLVM_SRC_PATH)/tools/clang/include \ From c1dc961203bd833a817fc4e5329bb45cdab72190 Mon Sep 17 00:00:00 2001 From: aherlihy Date: Fri, 14 Nov 2014 03:37:32 +0000 Subject: [PATCH 3/3] added reminder to remove -lclangToolingCore for Darwin --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index e72c1e8..c5bd36f 100644 --- a/Makefile +++ b/Makefile @@ -70,6 +70,8 @@ CLANG_INCLUDES := \ # to specify and maintain. The linker group options make the linking somewhat # slower, but IMHO they're still perfectly fine for tools that link with Clang. +# Note: if using Darwin, may need to get rid of -lclangToolingCore. + ifneq ($(UNAME),Darwin) CLANG_LIBS += \ -Wl,--start-group