android / android/ndk

Debug flag is enabled for release build type.

Open
#243 16 comments 28 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
2.3k
Forks
310
PR merge metrics
No merged PRs in 30d

Description

#### Description

The toolchain file provided for CMake (found in `build/cmake/android.toolchain.cmake`) enables the debug flags `-g` in Release mode.

Excerpt of the toolchain file:
~~~
# Generic flags.
list(APPEND ANDROID_COMPILER_FLAGS
-g
...)
# ...
# Debug and release flags.
list(APPEND ANDROID_COMPILER_FLAGS_DEBUG
-O0)
~~~

It seems that the `-g` should be set for `ANDROID_COMPILER_FLAGS_DEBUG`, not `ANDROID_COMPILER_FLAGS`.

A workaround is to set `CMAKE_CXX_FLAGS_RELEASE` to `-g0` when configuring the build directory.

#### Environment Details

Not all of these will be relevant to every bug, but please provide as much
information as you can.

* NDK Version: Pkg.Revision = 13.0.3315539
* Build sytem: CMake
* Host OS: Linux Debian Jessie
* Compiler: Clang
* ABI: arm64-v8a

Contributor guide

Open the contributing guide

Research direction

Open build/cmake/android.toolchain.cmake and inspect how ANDROID_COMPILER_FLAGS and ANDROID_COMPILER_FLAGS_DEBUG are applied to Release and Debug builds. Configure a CMake build using the reported NDK toolchain and verify that Release no longer enables debug symbols while Debug retains its expected flags.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.