diff options
author | Ayke van Laethem <[email protected]> | 2024-07-30 19:08:55 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2024-08-12 13:23:32 +0200 |
commit | f188eaf5f92618adc6422c2b55db8f822c6cc458 (patch) | |
tree | 835fb9b43034c92ff679d386500c7c9f66a98290 /compileopts/options.go | |
parent | 6efc6d2bb6489a9157c5bd964bdc072ed23f29d1 (diff) | |
download | tinygo-f188eaf5f92618adc6422c2b55db8f822c6cc458.tar.gz tinygo-f188eaf5f92618adc6422c2b55db8f822c6cc458.zip |
mips: add GOMIPS=softfloat support
Previously, the compiler would default to hardfloat. This is not
supported by some MIPS CPUs.
This took me much longer than it should have because of a quirk in the
LLVM Mips backend: if the target-features string is not set (like during
LTO), the Mips backend picks the first function in the module and uses
that. Unfortunately, in the case of TinyGo this first function is
`llvm.dbg.value`, which is an LLVM intrinsic and doesn't have the
target-features string. I fixed it by adding a `-mllvm -mattr=` flag to
the linker.
Diffstat (limited to 'compileopts/options.go')
-rw-r--r-- | compileopts/options.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compileopts/options.go b/compileopts/options.go index 8b0e2266d..9601ae322 100644 --- a/compileopts/options.go +++ b/compileopts/options.go @@ -23,6 +23,7 @@ type Options struct { GOOS string // environment variable GOARCH string // environment variable GOARM string // environment variable (only used with GOARCH=arm) + GOMIPS string // environment variable (only used with GOARCH=mips and GOARCH=mipsle) Directory string // working dir, leave it unset to use the current working dir Target string Opt string |