diff options
author | Cherry Mui <cherryyz@google.com> | 2024-02-09 14:17:18 -0500 |
---|---|---|
committer | Cherry Mui <cherryyz@google.com> | 2024-02-16 18:14:03 +0000 |
commit | e4ebd13f7a6f216f7ddbaa1f2a3c97fd10bc3d23 (patch) | |
tree | 138e3b5f9243fd8b548c537032cce90d6b95ba05 /src/cmd/dist | |
parent | a0226c5680f3ce6b0d8a8341f8c69611f3008393 (diff) | |
download | go-e4ebd13f7a6f216f7ddbaa1f2a3c97fd10bc3d23.tar.gz go-e4ebd13f7a6f216f7ddbaa1f2a3c97fd10bc3d23.zip |
cmd/dist,cmd/go: define assembly macros, handle GOARM value with soft/hardfloat
CL 525637 added GOARM_x assembly macros based on GOARM value. But
it did not define the macro in cmd/dist, so the macro is not set
during bootstrapping. This CL defines them.
With CL 514907, cfg.GOARM can also take a soft/hardfloat suffix,
like "7,hardfloat". Handle that case.
For #65601.
Change-Id: I60ffe7e8b623ae693d91d6e8595067a6f76565b3
Reviewed-on: https://go-review.googlesource.com/c/go/+/562995
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/cmd/dist')
-rw-r--r-- | src/cmd/dist/build.go | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go index 51bb63c519..4181d33112 100644 --- a/src/cmd/dist/build.go +++ b/src/cmd/dist/build.go @@ -903,6 +903,20 @@ func runInstall(pkg string, ch chan struct{}) { // Define GORISCV64_value from goriscv64 asmArgs = append(asmArgs, "-D", "GORISCV64_"+goriscv64) } + if goarch == "arm" { + // Define GOARM_value from goarm, which can be either a version + // like "6", or a version and a FP mode, like "7,hardfloat". + switch { + case strings.Contains(goarm, "7"): + asmArgs = append(asmArgs, "-D", "GOARM_7") + fallthrough + case strings.Contains(goarm, "6"): + asmArgs = append(asmArgs, "-D", "GOARM_6") + fallthrough + default: + asmArgs = append(asmArgs, "-D", "GOARM_5") + } + } goasmh := pathf("%s/go_asm.h", workdir) // Collect symabis from assembly code. @@ -1760,8 +1774,8 @@ var cgoEnabled = map[string]bool{ // get filtered out of cgoEnabled for 'dist list'. // See go.dev/issue/56679. var broken = map[string]bool{ - "linux/sparc64": true, // An incomplete port. See CL 132155. - "openbsd/mips64": true, // Broken: go.dev/issue/58110. + "linux/sparc64": true, // An incomplete port. See CL 132155. + "openbsd/mips64": true, // Broken: go.dev/issue/58110. } // List of platforms which are first class ports. See go.dev/issue/38874. |