Skip to content
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

[WIP] Support LLVM12 #503

Merged
merged 15 commits into from
Jul 26, 2021
Merged
Prev Previous commit
Next Next commit
Fix LLVM 11 builds by including libxml2
  • Loading branch information
Jcd1230 committed Jul 26, 2021
commit c9c9898b59aef10e16bb6f4207144f82ec0980b3
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -123,10 +123,15 @@ CLANG_LIBFILES := $(patsubst %, $(CLANG_PREFIX)/lib/%, $(CLANG_LIBS))

ifeq "$(LLVMVERGT4)" "1"
LLVM_LIBS += $(shell $(LLVM_CONFIG) --libs --link-static)
LLVM_LIBFILES = $(shell $(LLVM_CONFIG) --libfiles --link-static)
LLVM_LIBFILES := $(shell $(LLVM_CONFIG) --libfiles --link-static)
else
LLVM_LIBS += $(shell $(LLVM_CONFIG) --libs)
LLVM_LIBFILES = $(shell $(LLVM_CONFIG) --libfiles)
LLVM_LIBFILES := $(shell $(LLVM_CONFIG) --libfiles)
endif

LLVM_POLLY = "100 110 111 120"
ifneq (,$(findstring $(LLVM_VERSION),$(LLVM_POLLY)))
LLVM_LIBFILES += $(shell $(LLVM_CONFIG) --libdir)/libPolly*.a
endif

# llvm sometimes requires ncurses and libz, check if they have the symbols, and add them if they do
@@ -146,6 +151,11 @@ endif

SUPPORT_LIBRARY_FLAGS += -lffi -ledit

LLVM_LIBXML2 := "110 111"
ifneq (,$(findstring $(LLVM_VERSION),$(LLVM_LIBXML2)))
SUPPORT_LIBRARY_FLAGS += -lxml2
endif

PACKAGE_DEPS += $(LUAJIT_LIB)

#makes luajit happy on osx 10.6 (otherwise luaL_newstate returns NULL)
@@ -228,12 +238,11 @@ build/llvm_objects/llvm_list: $(addprefix build/, $(LIBOBJS) $(EXEOBJS))
mkdir -p build/llvm_objects/luajit
# Extract Luajit + all LLVM & Clang libraries
cd build/llvm_objects; for lib in $(LUAJIT_LIB) $(LLVM_LIBFILES) $(CLANG_LIBFILES); do \
echo ---$$lib---; \
echo Extracing objects from $$lib; \
DIR=$$(basename $$lib .a); \
mkdir -p $$DIR; \
cd $$DIR; \
ar x $$lib; \
ls; \
cd ..; \
done