diff --git a/Makefile b/Makefile index bfbfc09d..10224337 100644 --- a/Makefile +++ b/Makefile @@ -108,7 +108,7 @@ LLVM_LIBRARY_FLAGS += -lclangFrontend -lclangDriver \ -lclangAnalysis \ -lclangEdit -lclangAST -lclangLex -lclangBasic -CLANG_AST_MATCHERS = "80 90 100 110 111" +CLANG_AST_MATCHERS = "80 90 100 110 111 120" ifneq (,$(findstring $(LLVM_VERSION),$(CLANG_AST_MATCHERS))) LLVM_LIBRARY_FLAGS += -lclangASTMatchers endif @@ -229,9 +229,15 @@ release/include/terra/%.h: $(LUAJIT_INCLUDE)/%.h $(LUAJIT_LIB) build/llvm_objects/llvm_list: $(addprefix build/, $(LIBOBJS) $(EXEOBJS)) mkdir -p build/llvm_objects/luajit - $(CXX) -o /dev/null $(addprefix build/, $(LIBOBJS) $(EXEOBJS)) $(LLVM_LIBRARY_FLAGS) $(SUPPORT_LIBRARY_FLAGS) $(LFLAGS) -Wl,-t 2>&1 | egrep "lib(LLVM|clang)" > build/llvm_objects/llvm_list + $(CXX) -o /dev/null $(addprefix build/, $(LIBOBJS) $(EXEOBJS)) $(LLVM_LIBRARY_FLAGS) $(SUPPORT_LIBRARY_FLAGS) $(LFLAGS) -Wl,-t 2>&1 | egrep "lib(LLVM|clang|Polly)" > build/llvm_objects/llvm_list # extract needed LLVM objects based on a dummy linker invocation - < build/llvm_objects/llvm_list $(LUAJIT) src/unpacklibraries.lua build/llvm_objects + cd build/llvm_objects; for lib in $$(cat llvm_list); do \ + DIR=$$(basename $$lib .a); \ + mkdir -p $$DIR; \ + pushd $$DIR; \ + ar x $$lib; \ + popd; \ + done # include all luajit objects, since the entire lua interface is used in terra diff --git a/src/unpacklibraries.lua b/src/unpacklibraries.lua deleted file mode 100644 index ff884d22..00000000 --- a/src/unpacklibraries.lua +++ /dev/null @@ -1,25 +0,0 @@ -local destination = ... - -local function exe(cmd,...) - cmd = string.format(cmd,...) - local res = { os.execute(cmd) } - if type(res[1]) == 'number' and res[1] ~= 0 or not res[1] then - print('Error during '..cmd..':', table.unpack(res)) - error("command failed: "..cmd) - end -end -local function exists(path) - local f = io.open(path) - if not f then return false end - f:close() - return true -end -for line in io.lines() do - line = line:gsub("[()]"," ") - local archivepath,objectfile = line:match("(%S+)%s+(%S+)") - local archivename = archivepath:match("/([^/]*)%.a$") - if not exists( ("%s/%s/%s"):format(destination,archivename,objectfile) ) then - exe("mkdir -p %s/%s",destination,archivename) - exe("cd %s/%s; ar x %s %s",destination,archivename,archivepath,objectfile) - end -end \ No newline at end of file