Browse Source

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.
pull/4408/head
Ayke van Laethem 3 months ago
committed by Ron Evans
parent
commit
a35b983a5d
  1. 11
      compileopts/target.go

11
compileopts/target.go

@ -418,8 +418,15 @@ func defaultTarget(options *Options) (*TargetSpec, error) {
spec.Triple = llvmarch + "-" + llvmvendor + "-" + llvmos spec.Triple = llvmarch + "-" + llvmvendor + "-" + llvmos
if options.GOOS == "windows" { if options.GOOS == "windows" {
spec.Triple += "-gnu" spec.Triple += "-gnu"
} else if options.GOARCH == "arm" { } else if options.GOOS == "linux" {
spec.Triple += "-gnueabihf" // 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). // Add extra assembly files (needed for the scheduler etc).

Loading…
Cancel
Save