aboutsummaryrefslogtreecommitdiffhomepage
path: root/builder/darwin-libsystem.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2022-02-05 14:27:50 +0100
committerRon Evans <[email protected]>2022-04-23 08:45:46 +0200
commit6b31ee1e9392a463b536735081cc496405929882 (patch)
tree2eeb92533ccb7269a2e013b3feb9520c004598d1 /builder/darwin-libsystem.go
parentcad6a57077c7887025ba532a03f41d6ad78daa72 (diff)
downloadtinygo-6b31ee1e9392a463b536735081cc496405929882.tar.gz
tinygo-6b31ee1e9392a463b536735081cc496405929882.zip
all: update to LLVM 14
Switch over to LLVM 14 for static builds. Keep using LLVM 13 for regular builds for now. This uses a branch of the upstream Espressif branch to fix an issue, see: https://github.com/espressif/llvm-project/pull/59
Diffstat (limited to 'builder/darwin-libsystem.go')
-rw-r--r--builder/darwin-libsystem.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/builder/darwin-libsystem.go b/builder/darwin-libsystem.go
index 328825810..0eb262c10 100644
--- a/builder/darwin-libsystem.go
+++ b/builder/darwin-libsystem.go
@@ -6,6 +6,7 @@ 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
@@ -38,8 +39,12 @@ 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", "darwinnew",
+ "-flavor", flavor,
"-demangle",
"-dynamic",
"-dylib",