Skip to content

Commit ecac6cc

Browse files
committed
WIP try to fix LLVM 11
1 parent a883ea5 commit ecac6cc

File tree

3 files changed

+12
-22
lines changed

3 files changed

+12
-22
lines changed

.circleci/config.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,10 @@ workflows:
392392
test-all:
393393
jobs:
394394
- test-llvm9-go111
395-
- test-llvm10-go112
396-
- test-llvm10-go113
397-
- test-llvm10-go114
398-
- test-llvm11-go115
399-
- build-linux
400-
- build-macos
401-
- assert-test-linux
395+
#- test-llvm10-go112
396+
#- test-llvm10-go113
397+
#- test-llvm10-go114
398+
#- test-llvm11-go115
399+
#- build-linux
400+
#- build-macos
401+
#- assert-test-linux

Makefile

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,13 @@ ifeq ($(OS),Windows_NT)
4848
# LLVM compiled using MinGW on Windows appears to have problems with threads.
4949
# Without this flag, linking results in errors like these:
5050
# libLLVMSupport.a(Threading.cpp.obj):Threading.cpp:(.text+0x55): undefined reference to `std::thread::hardware_concurrency()'
51-
LLVM_OPTION += -DLLVM_ENABLE_THREADS=OFF
51+
LLVM_OPTION += -DLLVM_ENABLE_THREADS=OFF -DLLVM_ENABLE_PIC=OFF
5252

53+
CGO_CPPFLAGS += -DCINDEX_NO_EXPORTS
5354
CGO_LDFLAGS += -static -static-libgcc -static-libstdc++
5455
CGO_LDFLAGS_EXTRA += -lversion
5556

56-
# Build libclang manually because the CMake-based build system on Windows
57-
# doesn't allow building libclang as a static library.
58-
LIBCLANG_PATH = $(abspath build/libclang-custom.a)
59-
LIBCLANG_FILES = $(abspath $(wildcard $(LLVM_BUILDDIR)/tools/clang/tools/libclang/CMakeFiles/libclang.dir/*.cpp.obj))
60-
61-
# Add the libclang dependency to the tinygo binary target.
62-
tinygo: $(LIBCLANG_PATH)
63-
test: $(LIBCLANG_PATH)
64-
# Build libclang.
65-
$(LIBCLANG_PATH): $(LIBCLANG_FILES)
66-
@mkdir -p build
67-
ar rcs $(LIBCLANG_PATH) $^
57+
LIBCLANG_PATH = $(abspath $(LLVM_BUILDDIR))/lib/liblibclang.a
6858

6959
else ifeq ($(shell uname -s),Darwin)
7060
MD5SUM = md5
@@ -87,7 +77,7 @@ LLD_LIBS = $(START_GROUP) -llldCOFF -llldCommon -llldCore -llldDriver -llldELF -
8777

8878
# For static linking.
8979
ifneq ("$(wildcard $(LLVM_BUILDDIR)/bin/llvm-config*)","")
90-
CGO_CPPFLAGS=$(shell $(LLVM_BUILDDIR)/bin/llvm-config --cppflags) -I$(abspath $(LLVM_BUILDDIR))/tools/clang/include -I$(abspath $(CLANG_SRC))/include -I$(abspath $(LLD_SRC))/include
80+
CGO_CPPFLAGS+=$(shell $(LLVM_BUILDDIR)/bin/llvm-config --cppflags) -I$(abspath $(LLVM_BUILDDIR))/tools/clang/include -I$(abspath $(CLANG_SRC))/include -I$(abspath $(LLD_SRC))/include
9181
CGO_CXXFLAGS=-std=c++14
9282
CGO_LDFLAGS+=$(LIBCLANG_PATH) -L$(abspath $(LLVM_BUILDDIR)/lib) $(CLANG_LIBS) $(LLD_LIBS) $(shell $(LLVM_BUILDDIR)/bin/llvm-config --ldflags --libs --system-libs $(LLVM_COMPONENTS)) -lstdc++ $(CGO_LDFLAGS_EXTRA)
9383
endif

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- task: CacheBeta@0
3333
displayName: Cache LLVM build
3434
inputs:
35-
key: llvm-build-11-windows-v1
35+
key: llvm-build-11-windows-v3
3636
path: llvm-build
3737
- task: Bash@3
3838
displayName: Build LLVM

0 commit comments

Comments
 (0)