Skip to content

Commit ad1c53d

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

File tree

3 files changed

+54
-64
lines changed

3 files changed

+54
-64
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: 43 additions & 43 deletions
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
@@ -48,45 +48,45 @@ jobs:
4848
# build!
4949
make llvm-build
5050
fi
51-
- task: Bash@3
52-
displayName: Install QEMU
53-
inputs:
54-
targetType: inline
55-
script: choco install qemu --version=2020.06.12
56-
- task: CacheBeta@0
57-
displayName: Cache wasi-libc sysroot
58-
inputs:
59-
key: wasi-libc-sysroot-v3
60-
path: lib/wasi-libc/sysroot
61-
- task: Bash@3
62-
displayName: Build wasi-libc
63-
inputs:
64-
targetType: inline
65-
script: PATH=/usr/bin:$PATH make wasi-libc
66-
- task: Bash@3
67-
displayName: Test TinyGo
68-
inputs:
69-
targetType: inline
70-
script: |
71-
export PATH="$PATH:./llvm-build/bin:/c/Program Files/qemu"
72-
unset GOROOT
73-
make test
74-
- task: Bash@3
75-
displayName: Build TinyGo release tarball
76-
inputs:
77-
targetType: inline
78-
script: |
79-
export PATH="$PATH:./llvm-build/bin:/c/Program Files/qemu"
80-
unset GOROOT
81-
make build/release -j4
82-
- publish: $(System.DefaultWorkingDirectory)/build/release/tinygo
83-
displayName: Publish zip as artifact
84-
artifact: tinygo
85-
- task: Bash@3
86-
displayName: Smoke tests
87-
inputs:
88-
targetType: inline
89-
script: |
90-
export PATH="$PATH:./llvm-build/bin:/c/Program Files/qemu"
91-
unset GOROOT
92-
make smoketest TINYGO=build/tinygo AVR=0 XTENSA=0
51+
#- task: Bash@3
52+
# displayName: Install QEMU
53+
# inputs:
54+
# targetType: inline
55+
# script: choco install qemu --version=2020.06.12
56+
#- task: CacheBeta@0
57+
# displayName: Cache wasi-libc sysroot
58+
# inputs:
59+
# key: wasi-libc-sysroot-v3
60+
# path: lib/wasi-libc/sysroot
61+
#- task: Bash@3
62+
# displayName: Build wasi-libc
63+
# inputs:
64+
# targetType: inline
65+
# script: PATH=/usr/bin:$PATH make wasi-libc
66+
#- task: Bash@3
67+
# displayName: Test TinyGo
68+
# inputs:
69+
# targetType: inline
70+
# script: |
71+
# export PATH="$PATH:./llvm-build/bin:/c/Program Files/qemu"
72+
# unset GOROOT
73+
# make test
74+
#- task: Bash@3
75+
# displayName: Build TinyGo release tarball
76+
# inputs:
77+
# targetType: inline
78+
# script: |
79+
# export PATH="$PATH:./llvm-build/bin:/c/Program Files/qemu"
80+
# unset GOROOT
81+
# make build/release -j4
82+
#- publish: $(System.DefaultWorkingDirectory)/build/release/tinygo
83+
# displayName: Publish zip as artifact
84+
# artifact: tinygo
85+
#- task: Bash@3
86+
# displayName: Smoke tests
87+
# inputs:
88+
# targetType: inline
89+
# script: |
90+
# export PATH="$PATH:./llvm-build/bin:/c/Program Files/qemu"
91+
# unset GOROOT
92+
# make smoketest TINYGO=build/tinygo AVR=0 XTENSA=0

0 commit comments

Comments
 (0)