Skip to content

Commit 78a8ff5

Browse files
committed
all: add support for LLVM 19
1 parent 127557d commit 78a8ff5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+251
-210
lines changed

.circleci/config.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ commands:
1010
steps:
1111
- restore_cache:
1212
keys:
13-
- llvm-source-18-v1
13+
- llvm-source-19-v1
1414
- run:
1515
name: "Fetch LLVM source"
1616
command: make llvm-source
1717
- save_cache:
18-
key: llvm-source-18-v1
18+
key: llvm-source-19-v1
1919
paths:
2020
- llvm-project/clang/lib/Headers
2121
- llvm-project/clang/include
@@ -109,12 +109,15 @@ jobs:
109109
# "make lint" fails before go 1.21 because internal/tools/go.mod specifies packages that require go 1.21
110110
fmt-check: false
111111
resource_class: large
112-
test-llvm18-go123:
112+
test-llvm19-go123:
113113
docker:
114114
- image: golang:1.23-bullseye
115115
steps:
116116
- test-linux:
117-
llvm: "18"
117+
llvm: "19"
118+
environment:
119+
# Hack to work around https://github.com/llvm/llvm-project/issues/105987
120+
LD_LIBRARY_PATH: /usr/lib/llvm-19/lib
118121
resource_class: large
119122

120123
workflows:
@@ -123,5 +126,5 @@ workflows:
123126
# This tests our lowest supported versions of Go and LLVM, to make sure at
124127
# least the smoke tests still pass.
125128
- test-llvm15-go119
126-
# This tests LLVM 18 support when linking against system libraries.
127-
- test-llvm18-go123
129+
# This tests LLVM 19 support when linking against system libraries.
130+
- test-llvm19-go123

.github/workflows/build-macos.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
uses: actions/cache/restore@v4
4646
id: cache-llvm-source
4747
with:
48-
key: llvm-source-18-${{ matrix.os }}-v2
48+
key: llvm-source-19-${{ matrix.os }}-v1
4949
path: |
5050
llvm-project/clang/lib/Headers
5151
llvm-project/clang/include
@@ -70,7 +70,7 @@ jobs:
7070
uses: actions/cache/restore@v4
7171
id: cache-llvm-build
7272
with:
73-
key: llvm-build-18-${{ matrix.os }}-v3
73+
key: llvm-build-19-${{ matrix.os }}-v1
7474
path: llvm-build
7575
- name: Build LLVM
7676
if: steps.cache-llvm-build.outputs.cache-hit != 'true'
@@ -126,7 +126,7 @@ jobs:
126126
runs-on: macos-latest
127127
strategy:
128128
matrix:
129-
version: [16, 17, 18]
129+
version: [16, 17, 18, 19]
130130
steps:
131131
- name: Set up Homebrew
132132
uses: Homebrew/actions/setup-homebrew@master
@@ -150,8 +150,8 @@ jobs:
150150
- name: Check binary
151151
run: tinygo version
152152
- name: Build TinyGo (default LLVM)
153-
if: matrix.version == 18
153+
if: matrix.version == 19
154154
run: go install
155155
- name: Check binary
156-
if: matrix.version == 18
156+
if: matrix.version == 19
157157
run: tinygo version

.github/workflows/linux.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
uses: actions/cache/restore@v4
4949
id: cache-llvm-source
5050
with:
51-
key: llvm-source-18-linux-alpine-v1
51+
key: llvm-source-19-linux-alpine-v1
5252
path: |
5353
llvm-project/clang/lib/Headers
5454
llvm-project/clang/include
@@ -73,7 +73,7 @@ jobs:
7373
uses: actions/cache/restore@v4
7474
id: cache-llvm-build
7575
with:
76-
key: llvm-build-18-linux-alpine-v2
76+
key: llvm-build-19-linux-alpine-v1
7777
path: llvm-build
7878
- name: Build LLVM
7979
if: steps.cache-llvm-build.outputs.cache-hit != 'true'
@@ -205,7 +205,7 @@ jobs:
205205
uses: actions/cache/restore@v4
206206
id: cache-llvm-source
207207
with:
208-
key: llvm-source-18-linux-asserts-v1
208+
key: llvm-source-19-linux-asserts-v1
209209
path: |
210210
llvm-project/clang/lib/Headers
211211
llvm-project/clang/include
@@ -230,7 +230,7 @@ jobs:
230230
uses: actions/cache/restore@v4
231231
id: cache-llvm-build
232232
with:
233-
key: llvm-build-18-linux-asserts-v2
233+
key: llvm-build-19-linux-asserts-v1
234234
path: llvm-build
235235
- name: Build LLVM
236236
if: steps.cache-llvm-build.outputs.cache-hit != 'true'
@@ -321,7 +321,7 @@ jobs:
321321
uses: actions/cache/restore@v4
322322
id: cache-llvm-source
323323
with:
324-
key: llvm-source-18-linux-v1
324+
key: llvm-source-19-linux-v1
325325
path: |
326326
llvm-project/clang/lib/Headers
327327
llvm-project/clang/include
@@ -346,7 +346,7 @@ jobs:
346346
uses: actions/cache/restore@v4
347347
id: cache-llvm-build
348348
with:
349-
key: llvm-build-18-linux-${{ matrix.goarch }}-v2
349+
key: llvm-build-19-linux-${{ matrix.goarch }}-v2
350350
path: llvm-build
351351
- name: Build LLVM
352352
if: steps.cache-llvm-build.outputs.cache-hit != 'true'

.github/workflows/llvm.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ jobs:
3535
uses: docker/metadata-action@v5
3636
with:
3737
images: |
38-
tinygo/llvm-18
39-
ghcr.io/${{ github.repository_owner }}/llvm-18
38+
tinygo/llvm-19
39+
ghcr.io/${{ github.repository_owner }}/llvm-19
4040
tags: |
4141
type=sha,format=long
4242
type=raw,value=latest

.github/workflows/nix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
uses: actions/cache/restore@v4
3030
id: cache-llvm-source
3131
with:
32-
key: llvm-source-18-linux-nix-v1
32+
key: llvm-source-19-linux-nix-v1
3333
path: |
3434
llvm-project/compiler-rt
3535
- name: Download LLVM source

.github/workflows/sizediff-install-pkgs.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
# still works after checking out the dev branch (that is, when going from LLVM
33
# 16 to LLVM 17 for example, both Clang 16 and Clang 17 are installed).
44

5-
echo 'deb https://apt.llvm.org/noble/ llvm-toolchain-noble-18 main' | sudo tee /etc/apt/sources.list.d/llvm.list
5+
echo 'deb https://apt.llvm.org/noble/ llvm-toolchain-noble-19 main' | sudo tee /etc/apt/sources.list.d/llvm.list
66
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
77
sudo apt-get update
88
sudo apt-get install --no-install-recommends -y \
9-
llvm-18-dev \
10-
clang-18 \
11-
libclang-18-dev \
12-
lld-18
9+
llvm-19-dev \
10+
clang-19 \
11+
libclang-19-dev \
12+
lld-19

.github/workflows/sizediff.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ jobs:
1414
runs-on: ubuntu-24.04
1515
permissions:
1616
pull-requests: write
17+
env:
18+
# Hack to work around https://github.com/llvm/llvm-project/issues/105987
19+
LD_LIBRARY_PATH: /usr/lib/llvm-19/lib
1720
steps:
1821
# Prepare, install tools
1922
- name: Add GOBIN to $PATH
@@ -30,7 +33,7 @@ jobs:
3033
uses: actions/cache@v4
3134
id: cache-llvm-source
3235
with:
33-
key: llvm-source-18-sizediff-v1
36+
key: llvm-source-19-sizediff-v1
3437
path: |
3538
llvm-project/compiler-rt
3639
- name: Download LLVM source

.github/workflows/windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
uses: actions/cache/restore@v4
4848
id: cache-llvm-source
4949
with:
50-
key: llvm-source-18-windows-v1
50+
key: llvm-source-19-windows-v1
5151
path: |
5252
llvm-project/clang/lib/Headers
5353
llvm-project/clang/include
@@ -72,7 +72,7 @@ jobs:
7272
uses: actions/cache/restore@v4
7373
id: cache-llvm-build
7474
with:
75-
key: llvm-build-18-windows-v2
75+
key: llvm-build-19-windows-v1
7676
path: llvm-build
7777
- name: Build LLVM
7878
if: steps.cache-llvm-build.outputs.cache-hit != 'true'

GNUmakefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LLD_SRC ?= $(LLVM_PROJECTDIR)/lld
1010

1111
# Try to autodetect LLVM build tools.
1212
# Versions are listed here in descending priority order.
13-
LLVM_VERSIONS = 18 17 16 15
13+
LLVM_VERSIONS = 19 18 17 16 15
1414
errifempty = $(if $(1),$(1),$(error $(2)))
1515
detect = $(shell which $(call errifempty,$(firstword $(foreach p,$(2),$(shell command -v $(p) 2> /dev/null && echo $(p)))),failed to locate $(1) at any of: $(2)))
1616
toolSearchPathsVersion = $(1)-$(2)
@@ -147,7 +147,7 @@ endif
147147
MD5SUM ?= md5sum
148148

149149
# Libraries that should be linked in for the statically linked Clang.
150-
CLANG_LIB_NAMES = clangAnalysis clangAPINotes clangAST clangASTMatchers clangBasic clangCodeGen clangCrossTU clangDriver clangDynamicASTMatchers clangEdit clangExtractAPI clangFormat clangFrontend clangFrontendTool clangHandleCXX clangHandleLLVM clangIndex clangLex clangParse clangRewrite clangRewriteFrontend clangSema clangSerialization clangSupport clangTooling clangToolingASTDiff clangToolingCore clangToolingInclusions
150+
CLANG_LIB_NAMES = clangAnalysis clangAPINotes clangAST clangASTMatchers clangBasic clangCodeGen clangCrossTU clangDriver clangDynamicASTMatchers clangEdit clangExtractAPI clangFormat clangFrontend clangFrontendTool clangHandleCXX clangHandleLLVM clangIndex clangInstallAPI clangLex clangParse clangRewrite clangRewriteFrontend clangSema clangSerialization clangSupport clangTooling clangToolingASTDiff clangToolingCore clangToolingInclusions
151151
CLANG_LIBS = $(START_GROUP) $(addprefix -l,$(CLANG_LIB_NAMES)) $(END_GROUP) -lstdc++
152152

153153
# Libraries that should be linked in for the statically linked LLD.
@@ -238,7 +238,7 @@ gen-device-renesas: build/gen-device-svd
238238
GO111MODULE=off $(GO) fmt ./src/device/renesas
239239

240240
$(LLVM_PROJECTDIR)/llvm:
241-
git clone -b tinygo_xtensa_release_18.1.2 --depth=1 https://github.com/tinygo-org/llvm-project $(LLVM_PROJECTDIR)
241+
git clone -b xtensa_release_19.1.2 --depth=1 https://github.com/espressif/llvm-project $(LLVM_PROJECTDIR)
242242
llvm-source: $(LLVM_PROJECTDIR)/llvm ## Get LLVM sources
243243

244244
# Configure LLVM.

builder/builder_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ func TestClangAttributes(t *testing.T) {
3939
"wasm",
4040
"wasm-unknown",
4141
}
42-
if hasBuiltinTools {
42+
// TODO: remove this version check.
43+
if hasBuiltinTools && llvm.Version != "19.1.0-rc3" {
4344
// hasBuiltinTools is set when TinyGo is statically linked with LLVM,
4445
// which also implies it was built with Xtensa support.
4546
targetNames = append(targetNames, "esp32", "esp8266")

0 commit comments

Comments
 (0)