-
Notifications
You must be signed in to change notification settings - Fork 18.1k
cmd/go: allow -mlsx -mlasx cgo flags for loong64 #71597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
cc @golang/loong64 |
Seems reasonable. Feel free to send a CL (see the contribution guide). Thanks. |
There are more arch-specific flags described in the LoongArch Toolchain Conventions spec, so we would probably include all of them. Would you prepare a patch or leave it to the loong64 port team? Just in case you already have some CL prepared. |
FYI, the list of accepted flags is in the file $GOROOT/src/cmd/go/internal/work/security.go. |
Change https://go.dev/cl/647956 mentions this issue: |
Recognize and allow all LoongArch-specific CFLAGS as standardized in the LoongArch Toolchain Conventions v1.1, and implemented in current versions of GCC and Clang, to enable advanced cgo use cases on loong64. These flags are also allowed for linker invocations in case of possible LTO. See: https://github.com/loongson/la-toolchain-conventions/blob/releases/v1.1/LoongArch-toolchain-conventions-EN.adoc#list While at it, also add support for -mtls-dialect as some C programs may benefit performance-wise from the optional TLSDESC usage. This flag is not specific to loong64 though; it is available for amd64, arm, arm64, loong64, riscv64 and x86. Fixes golang#71597. Change-Id: I35d2507edb71fa324ae429a3ae3c739644a9cac1 Reviewed-on: https://go-review.googlesource.com/c/go/+/647956 LUCI-TryBot-Result: Go LUCI <[email protected]> Commit-Queue: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Cherry Mui <[email protected]> Reviewed-by: abner chenc <[email protected]> Reviewed-by: Meidan Li <[email protected]> Link: https://go-review.googlesource.com/c/go/+/647956 Signed-off-by: Mingcong Bai <[email protected]>
Go version
go version go1.23.4 linux/loong64
Output of
go env
in your module/workspace:What did you do?
With:
What did you see happen?
Running
go build
will show: invalid flag in #cgo CPPFLAGS: -mlasx.But these are valid flags on loongarch64:
-mlasx
-mno-lasx
-mlsx
-mno-lsx
What did you expect to see?
go build succeeds.
The text was updated successfully, but these errors were encountered: