mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 18:47:47 +00:00
linux: use -musleabi* instead of -gnueabi* (or nothing)
This more accurately describes the libc we are using. This also adds the environment to _all_ Linux systems, not just ARM. And selects the correct ABI (soft/hardfloat) that's in use. I don't know whether it has any practical implications, but LLVM appears to be using this information so it seems wise to use the correct values.
This commit is contained in:
committed by
Ron Evans
parent
a47ff02c82
commit
a35b983a5d
@@ -418,8 +418,15 @@ func defaultTarget(options *Options) (*TargetSpec, error) {
|
||||
spec.Triple = llvmarch + "-" + llvmvendor + "-" + llvmos
|
||||
if options.GOOS == "windows" {
|
||||
spec.Triple += "-gnu"
|
||||
} else if options.GOARCH == "arm" {
|
||||
spec.Triple += "-gnueabihf"
|
||||
} else if options.GOOS == "linux" {
|
||||
// We use musl on Linux (not glibc) so we should use -musleabi* instead
|
||||
// of -gnueabi*.
|
||||
// The *hf suffix selects between soft/hard floating point ABI.
|
||||
if spec.SoftFloat {
|
||||
spec.Triple += "-musleabi"
|
||||
} else {
|
||||
spec.Triple += "-musleabihf"
|
||||
}
|
||||
}
|
||||
|
||||
// Add extra assembly files (needed for the scheduler etc).
|
||||
|
||||
Reference in New Issue
Block a user