aboutsummaryrefslogtreecommitdiffhomepage
path: root/compileopts
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 /compileopts
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 'compileopts')
-rw-r--r--compileopts/target.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/compileopts/target.go b/compileopts/target.go
index cf16dff40..26f007538 100644
--- a/compileopts/target.go
+++ b/compileopts/target.go
@@ -277,8 +277,12 @@ func defaultTarget(goos, goarch, triple string) (*TargetSpec, error) {
spec.Libc = "darwin-libSystem"
arch := strings.Split(triple, "-")[0]
platformVersion := strings.TrimPrefix(strings.Split(triple, "-")[2], "macosx")
+ flavor := "darwin"
+ if strings.Split(llvm.Version, ".")[0] < "13" {
+ flavor = "darwinnew" // needed on LLVM 12 and below
+ }
spec.LDFlags = append(spec.LDFlags,
- "-flavor", "darwinnew",
+ "-flavor", flavor,
"-dead_strip",
"-arch", arch,
"-platform_version", "macos", platformVersion, platformVersion,