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: "hello world" does not compile for GOOS=android
due to -Wall
in gcc_android.c
#51911
Comments
GOOS=android
due to -Wall
in gcc_android.c
CC @golang/runtime And specifically @ianlancetaylor and @cherrymui. I'm not sure if this actually belongs in runtime/cgo (probably not), but I'm not sure where else to attribute it. I don't actually know what invokes the C compiler at the end of the day for cgo. |
What is the warning? It seems the message above mentioned the source code location it warns at, but not what it warns. Thanks. |
Are you saying you want to fix the android headers instead of removing -Wall?
|
We haven't proposed any fix for this yet. We were just looking for additional information to make sure we understand the problem. |
eh sorry, that came across wrong. i'm actually just wondering where the -Wall is even coming from and how i can remove it myself. |
If I'm not mistaken, Android builds always use cgo since they have to work with the system libc. That means the build implicitly imports I'm surprised these headers aren't |
aha! Line 29 in 2ebe77a
unfortunately the workaround is much more convenient: an empty log.h file with just __android_log_vprint works just fine. i'm not sure if this bug should stay open. i guess it depends on if go requires system headers to pass -Wall although that isn't the case in pretty much any real world use case where you just get broken vendor source code as a tarball. |
Modern versions of GCC do not issue warnings for system header files (this is controlled by |
oh no! yes that's the issue. i used -I rather than -isystem. thanks! |
go version go1.17.7 linux/amd64
gcc_android.c currently doesnt compile. I don't think it should be built with -Wall anyway, as it's hard to keep updated with the latest android changes
CGO_CFLAGS="-I/home/aep/Android/Sdk/ndk/21.4.7075529/sysroot/usr/include/" CGO_ENABLED=1 GOOS=android GOARCH=arm64 go build
The text was updated successfully, but these errors were encountered: