Skip to content

Commit 0d82645

Browse files
committed
main: add initial support for (in-development) LLVM 11
This can be useful to test improvements in LLVM master and to make it possible to support LLVM 11 for the most part already before the next release. That also allows catching LLVM bugs early to fix them upstream. Note that tests do not yet pass for this LLVM version, but the TinyGo compiler can be built with the binaries from apt.llvm.org (at the time of making this commit).
1 parent 32c7f3b commit 0d82645

File tree

6 files changed

+22
-8
lines changed

6 files changed

+22
-8
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,12 +387,12 @@ jobs:
387387
steps:
388388
- test-linux:
389389
llvm: "10"
390-
test-llvm10-go115:
390+
test-llvm11-go115:
391391
docker:
392392
- image: circleci/golang:1.15-buster
393393
steps:
394394
- test-linux:
395-
llvm: "10"
395+
llvm: "11"
396396
assert-test-linux:
397397
docker:
398398
- image: circleci/golang:1.14-stretch
@@ -424,7 +424,7 @@ workflows:
424424
- test-llvm10-go112
425425
- test-llvm10-go113
426426
- test-llvm10-go114
427-
- test-llvm10-go115
427+
- test-llvm11-go115
428428
- build-linux
429429
- build-macos
430430
- assert-test-linux

builder/objcopy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func extractROM(path string) (uint64, []byte, error) {
5858

5959
progs := make(progSlice, 0, 2)
6060
for _, prog := range f.Progs {
61-
if prog.Type != elf.PT_LOAD || prog.Filesz == 0 {
61+
if prog.Type != elf.PT_LOAD || prog.Filesz == 0 || prog.Off == 0 {
6262
continue
6363
}
6464
progs = append(progs, prog)

cgo/libclang_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// +build !byollvm
2-
// +build !llvm9
2+
// +build !llvm9,!llvm11
33

44
package cgo
55

cgo/libclang_config_llvm11.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// +build !byollvm
2+
// +build llvm11
3+
4+
package cgo
5+
6+
/*
7+
#cgo linux CFLAGS: -I/usr/lib/llvm-11/include
8+
#cgo darwin CFLAGS: -I/usr/local/opt/llvm@11/include
9+
#cgo freebsd CFLAGS: -I/usr/local/llvm11/include
10+
#cgo linux LDFLAGS: -L/usr/lib/llvm-11/lib -lclang
11+
#cgo darwin LDFLAGS: -L/usr/local/opt/llvm@11/lib -lclang -lffi
12+
#cgo freebsd LDFLAGS: -L/usr/local/llvm11/lib -lclang
13+
*/
14+
import "C"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ require (
1010
github.com/marcinbor85/gohex v0.0.0-20200531091804-343a4b548892
1111
go.bug.st/serial v1.0.0
1212
golang.org/x/tools v0.0.0-20200216192241-b320d3a0f5a2
13-
tinygo.org/x/go-llvm v0.0.0-20200503225853-345b2947b59d
13+
tinygo.org/x/go-llvm v0.0.0-20200503224449-70c558526021
1414
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbO
4646
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
4747
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
4848
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
49-
tinygo.org/x/go-llvm v0.0.0-20200503225853-345b2947b59d h1:hcX7vpB067GWM/EH4sGGOti0PMgIx+0bbZwUXctOIvE=
50-
tinygo.org/x/go-llvm v0.0.0-20200503225853-345b2947b59d/go.mod h1:fv1F0BSNpxMfCL0zF3M4OPFbgYHnhtB6ST0HvUtu/LE=
49+
tinygo.org/x/go-llvm v0.0.0-20200503224449-70c558526021 h1:d8T98WXGjrTgDmMXgxa6nb9EAYXGXwnzXygnJl6d+ac=
50+
tinygo.org/x/go-llvm v0.0.0-20200503224449-70c558526021/go.mod h1:fv1F0BSNpxMfCL0zF3M4OPFbgYHnhtB6ST0HvUtu/LE=

0 commit comments

Comments
 (0)