Skip to content
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

misc/cgo/test: failure with gcc 10 #50987

Closed
bsiegert opened this issue Feb 3, 2022 · 5 comments
Closed

misc/cgo/test: failure with gcc 10 #50987

bsiegert opened this issue Feb 3, 2022 · 5 comments

Comments

@bsiegert
Copy link
Contributor

bsiegert commented Feb 3, 2022

Example build log: https://build.golang.org/log/193a8f825e6a894f5e435df6958df8ad54a97306

I added a netbsd-arm64-bsiegert machine running a current development snapshot of NetBSD. Its gcc is version 10.3.0.

At the end of a test run, the cgo tests fail because of a warning generated by the verification for issue #5242:

##### ../misc/cgo/test
# misc/cgo/test
./test.go: In function 'issue5242':
./test.go:377:5: note: parameter passing for argument of type 'bar' changed in GCC 9.1
  377 | int issue5242(foo f, bar b) {
      |     ^~~~~~~~~
go build misc/cgo/test: C compiler warning promoted to error on Go builders
FAIL	misc/cgo/test [build failed]
2022/02/03 08:04:06 Failed: exit status 1
# misc/cgo/test
./test.go: In function 'issue5242':
./test.go:377:5: note: parameter passing for argument of type 'bar' changed in GCC 9.1
  377 | int issue5242(foo f, bar b) {
      |     ^~~~~~~~~
go build misc/cgo/test: C compiler warning promoted to error on Go builders
FAIL	misc/cgo/test [build failed]
2022/02/03 08:04:08 Failed: exit status 1
go tool dist: FAILED

This is due to a bugfix in how bitfields are passed by value in gcc 9.1, which technically breaks the ABI.

Since this is precisely the case that is being tested, I don't see how the code could be changed to prevent the warning. We could pass -Wno-psabi to gcc maybe?

/cc @ianlancetaylor @mdempsky

@ianlancetaylor
Copy link
Member

I think -Wno-psabi is the way to go. Thanks. Sent you a CL.

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/382956 mentions this issue: misc/cgo/test: disable unhelpful GCC warning

@bcmills
Copy link
Contributor

bcmills commented May 24, 2022

@gopherbot, please backport to Go 1.17. The netbsd-arm64-bsiegert builder is currently failing on the release branch due to this issue.

@gopherbot
Copy link
Contributor

Backport issue(s) opened: #53050 (for 1.17).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/408074 mentions this issue: [release-branch.go1.17] misc/cgo/test: disable unhelpful GCC warning

@golang golang locked and limited conversation to collaborators May 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants