Hi,
CXXFLAGS are used after gb_Library_add_cxxflags in gbuild.
This causes problems because gb_Library_add_cxxflags usually enforce
some setting that is strictly needed.
For example, my LO-4.0 build for openSUSE crashes in bridge test. It is
related to omit-frame-pointer gcc feature.
+ openSUSE uses:
CXXFLAGS=-fomit-frame-pointer ...
bridges/Library_gcc3_linux_intel.mk includes:
--- cut ---
# In case someone enabled the non-standard -fomit-frame-pointer which
does not
# work with the .cxx sources of this library.
$(eval $(call gb_Library_add_cxxflags,gcc3_uno,\
-fno-omit-frame-pointer \
-fno-strict-aliasing \
$(if $(filter TRUE,$(HAVE_GCC_AVX)),\
-mno-avx \
) \
))
--- cut ---
Unfortunately, CXXFLAGS is listed later on the commandline, so
the bridge is compiled with the global -f-omit-frame-pointer and is
miscompiled.
IMHO, it would make sense to use CXXFLAGS after the default global flags
but before the source file specific flags.
Another possibility would be to introduce another macro, for example
gb_Library_add_post_cxxflags or gb_Library_add_enforcing_cxxflags.
But then we would need to convert most (if not all)
gb_Library_add_cxxflags calls to the new macro :-)
What do you think?
Could you give me some hints how to do it?
Best Regards,
Petr
PS: I have troubles to understand the related gbuild code. It seems that
both CXXFLAGS and gb_Library_add_cxxflags are added to the T_CXXFLAGS
variable, see:
--- cut solenv/gbuild/LinkTarget.mk ---
$(call gb_LinkTarget_get_dep_target,$(1)) : T_CXXFLAGS :=
$$(gb_LinkTarget_CXXFLAGS)
[...]
define gb_LinkTarget_add_cxxflags
$(call gb_LinkTarget_get_headers_target,$(1)) \
$(call gb_LinkTarget_get_target,$(1)) : T_CXXFLAGS += $(2)
ifeq ($(gb_FULLDEPS),$(true))
$(call gb_LinkTarget_get_dep_target,$(1)) : T_CXXFLAGS += $(2)
endif
endef
--- cut ---
It looks like T_CXXFLAGS is initialized with CXXFLAGS and
gb_LinkTarget_add_cxxflags is added at the end. Though, in reality, they
are listed in the opposite order. So, I am lost :-)
Context
- gmake: CXXFLAGS override gb_Library_add_cxxflags · Petr Mladek
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.