From f7f20829795281f9c7dbdd1ae16c170e594df819 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Tue, 14 Apr 2020 22:43:32 +0200 Subject: [PATCH] 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). --- cgo/libclang_config.go | 2 +- cgo/libclang_config_llvm11.go | 14 ++++++++++++++ go.mod | 2 +- go.sum | 4 ++-- 4 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 cgo/libclang_config_llvm11.go diff --git a/cgo/libclang_config.go b/cgo/libclang_config.go index ec65d8a89..24b950143 100644 --- a/cgo/libclang_config.go +++ b/cgo/libclang_config.go @@ -1,5 +1,5 @@ // +build !byollvm -// +build !llvm9 +// +build !llvm9,!llvm11 package cgo diff --git a/cgo/libclang_config_llvm11.go b/cgo/libclang_config_llvm11.go new file mode 100644 index 000000000..6fab82bef --- /dev/null +++ b/cgo/libclang_config_llvm11.go @@ -0,0 +1,14 @@ +// +build !byollvm +// +build llvm11 + +package cgo + +/* +#cgo linux CFLAGS: -I/usr/lib/llvm-11/include +#cgo darwin CFLAGS: -I/usr/local/opt/llvm@11/include +#cgo freebsd CFLAGS: -I/usr/local/llvm11/include +#cgo linux LDFLAGS: -L/usr/lib/llvm-11/lib -lclang +#cgo darwin LDFLAGS: -L/usr/local/opt/llvm@11/lib -lclang -lffi +#cgo freebsd LDFLAGS: -L/usr/local/llvm11/lib -lclang +*/ +import "C" diff --git a/go.mod b/go.mod index 688793696..98a2ab93d 100644 --- a/go.mod +++ b/go.mod @@ -10,5 +10,5 @@ require ( github.com/marcinbor85/gohex v0.0.0-20200531091804-343a4b548892 go.bug.st/serial v1.0.0 golang.org/x/tools v0.0.0-20200216192241-b320d3a0f5a2 - tinygo.org/x/go-llvm v0.0.0-20200503225853-345b2947b59d + tinygo.org/x/go-llvm v0.0.0-20200503224449-70c558526021 ) diff --git a/go.sum b/go.sum index c24491ef2..9ceebac1a 100644 --- a/go.sum +++ b/go.sum @@ -46,5 +46,5 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbO golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -tinygo.org/x/go-llvm v0.0.0-20200503225853-345b2947b59d h1:hcX7vpB067GWM/EH4sGGOti0PMgIx+0bbZwUXctOIvE= -tinygo.org/x/go-llvm v0.0.0-20200503225853-345b2947b59d/go.mod h1:fv1F0BSNpxMfCL0zF3M4OPFbgYHnhtB6ST0HvUtu/LE= +tinygo.org/x/go-llvm v0.0.0-20200503224449-70c558526021 h1:d8T98WXGjrTgDmMXgxa6nb9EAYXGXwnzXygnJl6d+ac= +tinygo.org/x/go-llvm v0.0.0-20200503224449-70c558526021/go.mod h1:fv1F0BSNpxMfCL0zF3M4OPFbgYHnhtB6ST0HvUtu/LE=