This request is superseded by
request 1105413
(Show diff)
Overview
Request 1105335 superseded
- Force-add -DNDEBUG to CFLAGS; libphonenumber relies on it.
new cmake exposed this https://build.opensuse.org/request/show/1104274
- Created by jengelh
- In state superseded
- Package maintainer: Vogtinator
- Superseded by 1105413
Loading...
Request History
jengelh created request
- Force-add -DNDEBUG to CFLAGS; libphonenumber relies on it.
new cmake exposed this https://build.opensuse.org/request/show/1104274
Vogtinator declined request
Typo: `CXXFALGS`
superseded by 1105413
This is supposed to be set by CMake itself. If this no longer works with the linked cmake submission, it's probably wrong.
If your code does not compile without
-DNDEBUG
, that's wrong. NDEBUG should only control assert(), cf. https://en.cppreference.com/w/c/error/assertI agree with that, but it's expected that in RelWithDbgInfo builds,
-DNDEBUG
is set.Whatever the cmake SR does breaks this and needs to be fixed.
You can edit d:l:c/libphonenumber's "working" .spec file and use the "working" cmake and replace the
%cmake_build
line withSetting CFLAGS from the command line is a supported use-case of cmake, and libphonenumber threw it down the gutter. This bug is on libphonenumber and libphonenumber itself.
The CMakeLists sets
CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT
which is correct. The issue is that this setsCMAKE_C_FLAGS_RELWITHDEBINFO
instead ofCFLAGS
, so it overridesCMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT
: https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_FLAGS_INIT.html#variable:CMAKE_%3CLANG%3E_FLAGS_INITWhen I said “Setting CFLAGS from the command line” I meant “Setting (the cmake's unwieldly long name for what most people know as CFLAGS) from the command line”.
Yeah, and that works here.
What the spec file currently does results in
C_FLAGS = -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -O2 -g -DNDEBUG -fPIC -Wall -Werror
in the Makefiles.Huh?!
See home:jengelh:cmakecrap/libphonenumber the moment I'm asking for full debug, which is totally within the right of a user to do, the thing fails to build.
-DCMAKE_BUILD_TYPE=Debug
should be enough. Let me check what happens here.Issue reproduced, it's a bug in abseil.
absl_log
is missing a dependency onabsl_log_internal_check_op
.