diff options
author | Ayke van Laethem <[email protected]> | 2022-05-05 14:52:20 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2022-05-07 17:15:35 +0200 |
commit | 5c23f6fb6c64c4de46a3cf2374490a2c3b7401f3 (patch) | |
tree | e5048ec49679778313cb3db5416bbbb0b4b3bddd /builder | |
parent | 5afb63df60427bd5ddf7adb8e2d43258c2544ce6 (diff) | |
download | tinygo-5c23f6fb6c64c4de46a3cf2374490a2c3b7401f3.tar.gz tinygo-5c23f6fb6c64c4de46a3cf2374490a2c3b7401f3.zip |
all: remove support for LLVM 11 and LLVM 12
This removes a lot of backwards compatibility cruft and makes it
possible to start using features that need LLVM 13 or newer.
For example:
* https://github.com/tinygo-org/tinygo/pull/2637
* https://github.com/tinygo-org/tinygo/pull/2830
Diffstat (limited to 'builder')
-rw-r--r-- | builder/build.go | 11 | ||||
-rw-r--r-- | builder/builder_test.go | 2 | ||||
-rw-r--r-- | builder/darwin-libsystem.go | 7 | ||||
-rw-r--r-- | builder/tools-builtin.go | 2 |
4 files changed, 3 insertions, 19 deletions
diff --git a/builder/build.go b/builder/build.go index 6f5e73f9f..adf89d003 100644 --- a/builder/build.go +++ b/builder/build.go @@ -935,17 +935,6 @@ func optimizeProgram(mod llvm.Module, config *compileopts.Config) error { return errors.New("verification failure after LLVM optimization passes") } - // LLVM 11 by default tries to emit tail calls (even with the target feature - // disabled) unless it is explicitly disabled with a function attribute. - // This is a problem, as it tries to emit them and prints an error when it - // can't with this feature disabled. - // Because as of september 2020 tail calls are not yet widely supported, - // they need to be disabled until they are widely supported (at which point - // the +tail-call target feautre can be set). - if strings.HasPrefix(config.Triple(), "wasm") { - transform.DisableTailCalls(mod) - } - return nil } diff --git a/builder/builder_test.go b/builder/builder_test.go index c38d360af..42727e4a9 100644 --- a/builder/builder_test.go +++ b/builder/builder_test.go @@ -26,7 +26,7 @@ func TestClangAttributes(t *testing.T) { "cortex-m0", "cortex-m0plus", "cortex-m3", - //"cortex-m33", // TODO: broken in LLVM 11, fixed in https://reviews.llvm.org/D90305 + "cortex-m33", "cortex-m4", "cortex-m7", "esp32c3", diff --git a/builder/darwin-libsystem.go b/builder/darwin-libsystem.go index 0eb262c10..d2846f275 100644 --- a/builder/darwin-libsystem.go +++ b/builder/darwin-libsystem.go @@ -6,7 +6,6 @@ import ( "github.com/tinygo-org/tinygo/compileopts" "github.com/tinygo-org/tinygo/goenv" - "tinygo.org/x/go-llvm" ) // Create a job that builds a Darwin libSystem.dylib stub library. This library @@ -39,12 +38,8 @@ func makeDarwinLibSystemJob(config *compileopts.Config, tmpdir string) *compileJ // Link object file to dynamic library. platformVersion := strings.TrimPrefix(strings.Split(config.Triple(), "-")[2], "macosx") - flavor := "darwin" - if strings.Split(llvm.Version, ".")[0] < "13" { - flavor = "darwinnew" // needed on LLVM 12 and below - } flags = []string{ - "-flavor", flavor, + "-flavor", "darwin", "-demangle", "-dynamic", "-dylib", diff --git a/builder/tools-builtin.go b/builder/tools-builtin.go index e8b7070c9..ceb493be8 100644 --- a/builder/tools-builtin.go +++ b/builder/tools-builtin.go @@ -54,7 +54,7 @@ func RunTool(tool string, args ...string) error { ok = C.tinygo_clang_driver(C.int(len(args)), (**C.char)(buf)) case "ld.lld": switch linker { - case "darwin", "darwinnew": // darwinnew is only needed for LLVM 12 and below + case "darwin": ok = C.tinygo_link_macho(C.int(len(args)), (**C.char)(buf)) case "elf": ok = C.tinygo_link_elf(C.int(len(args)), (**C.char)(buf)) |