Skip to content

Commit

Permalink
linux: use -musleabi* instead of -gnueabi* (or nothing)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aykevl authored and deadprogram committed Aug 14, 2024
1 parent a47ff02 commit a35b983
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions compileopts/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit a35b983

Please sign in to comment.