-
Notifications
You must be signed in to change notification settings - Fork 15
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
Bazel adds "-g" in opt compilation mode when using NDK #89
Comments
For releases where you don't want debug info you should pass |
Hi @xiaobao520123, could you please try above and issue still persist, please help us how to reproduce this with all information i.e. bazel version, OS versions etc. |
well I try to use external/androidndk/ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang '-D__ANDROID_API__=21' -isystemexternal/androidndk/ndk/sysroot/usr/include/arm-linux-androideabi -target armv7-none-linux-androideabi '-march=armv7-a' '-mfloat-abi=softfp' '-mfpu=vfpv3-d16' -gcc-toolchain external/androidndk/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64 -fpic -no-canonical-prefixes -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -funwind-tables -fstack-protector-strong -fno-addrsig '-Werror=return-type' '-Werror=int-to-pointer-cast' '-Werror=pointer-to-int-cast' '-Werror=implicit-function-declaration' -mthumb -Os -g -DNDEBUG -MD -MF ...... Bazelisk version: development My bazel version is bazel 6.4.0 and the NDK I use is android-ndk-r21e |
Ah right, because it wants to give you debug info in case you need it for crash reports. You can either strip the final binary (maybe |
yeah I've used the latter way you suggest, and it works. But I think when building in opt mode, debug info should not be included by default. |
I think the crash reporting case is why it is, probably better to knowingly have to strip than to forget to enable -g when you need it and not be able to symbolicate production crashes |
Native android_ndk_repository has been removed from bazel 8, but it looks like this is still set in the Starlark version: rules_android_ndk/ndk_cc_toolchain_config.bzl Line 665 in cb776db
so I'll move this issue there |
Description of the bug:
Seen at src/main/java/com/google/devtools/build/lib/bazel/rules/android/ndkcrosstools/r19/ArmCrosstools.java:91
When building my library using NDK with opt mode, bazel always adds the flag "-g" into the command line arguments.
This causes some problems for me because I don't want any debugging information to appear inside my library.
Which category does this issue belong to?
No response
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
No response
Which operating system are you running Bazel on?
No response
What is the output of
bazel info release
?No response
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: