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

runtime/cgo: build failing with error: unknown warning group '-Watomic-alignment' on ios-arm64-corellium #65971

Closed
bcmills opened this issue Feb 27, 2024 · 3 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FixPending Issues that have a fix which has not yet been reviewed or submitted. NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Feb 27, 2024

Go version

24070cf

Output of go env in your module/workspace:

N/A

What did you do?

https://build.golang.org/log/85f674e744e8c08473b66ecef4d68f044f187e50

What did you see happen?

Building Go cmd/dist using /var/root/go-ios-arm64-bootstrap. (go1.20.6 ios/arm64)
Building Go toolchain1 using /var/root/go-ios-arm64-bootstrap.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
warning: unable to find runtime/cgo.a
Building Go toolchain2 using go_bootstrap and Go toolchain1.
# runtime/cgo
gcc_libinit.c:11:32: error: unknown warning group '-Watomic-alignment', ignored [-Werror,-Wunknown-warning-option]
go tool dist: FAILED: /tmp/workdir-host-ios-arm64-corellium-ios/go/pkg/tool/ios_arm64/go_bootstrap install -pgo=off cmd/asm cmd/cgo cmd/compile cmd/link: exit status 1

What did you expect to see?

All build steps succeeded and tests passing.

It appears that this flag was added in https://go.dev/cl/562348, for #65290 (attn @mauri870 @ianlancetaylor).

(attn @golang/ios)

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Feb 27, 2024
@bcmills
Copy link
Contributor Author

bcmills commented Feb 27, 2024

It isn't clear to me whether this problem is actually specific to ios, or more generally applicable but depending on a specific range of C compiler versions.

@gopherbot
Copy link

Change https://go.dev/cl/567556 mentions this issue: runtime/cgo: ignore unknown warning options

@mauri870
Copy link
Member

I wonder if this is related to the clang that comes with xcode.

Maybe this approach works:

#if !defined(__has_warning) || __has_warning("-Watomic-alignment")
#pragma GCC diagnostic ignored "-Watomic-alignment"
#endif

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. FixPending Issues that have a fix which has not yet been reviewed or submitted. labels Feb 28, 2024
@dmitshur dmitshur added this to the Go1.23 milestone Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FixPending Issues that have a fix which has not yet been reviewed or submitted. NeedsFix The path to resolution is known, but the work has not been done.
Projects
Development

No branches or pull requests

4 participants