always use gb_LinkTarget__get_cxxflags for cxxobjects

E.g. gb_LinkTarget_add_exception_object adds it explicitly, but
gb_LinkTarget_add_cxxobject itself does not, even though other variants
(c,objc,objcxx) do it.
This means that when compiling tools/qa/cppunit/test_cpuid.cxx it
doesn't get the correct -O/-g flags, because CppunitTest_tools_test.mk
uses gb_CppunitTest_add_cxxobjects to add $(INTRINSICS_CXXFLAGS).
And that in its own actually should use the add_exception_objects variant,
it didn't presumably because that one used to have cxxflags passing broken
until I fixed it in 4bbdab901e. The usage
in Library_cpp_uno.mk even explicitly works around the lack of debug symbols.

Change-Id: Idc794e95bb817cd2ba2942b8e1f04f80d6722f97
Reviewed-on: https://gerrit.libreoffice.org/80119
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
This commit is contained in:
Luboš Luňák
2019-10-03 11:54:28 +02:00
parent d1a34deaa8
commit dc34ab8105
4 changed files with 16 additions and 19 deletions

View File

@@ -32,10 +32,9 @@ ifneq ($(filter ANDROID DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
bridges_SELECTED_BRIDGE := gcc3_linux_aarch64 bridges_SELECTED_BRIDGE := gcc3_linux_aarch64
bridge_exception_objects := abi callvirtualfunction uno2cpp bridge_exception_objects := abi callvirtualfunction uno2cpp
$(eval $(call gb_Library_add_cxxobjects,$(gb_CPPU_ENV)_uno, \ $(eval $(call gb_Library_add_exception_objects,$(gb_CPPU_ENV)_uno, \
bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/cpp2uno, \ bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/cpp2uno, \
$(gb_LinkTarget_EXCEPTIONFLAGS) \ -fstack-protector \
$(call gb_LinkTarget__get_cxxflags,$(gb_CPPU_ENV)_uno) -fstack-protector \
)) ))
endif endif
@@ -219,8 +218,6 @@ bridges_NON_CALL_EXCEPTIONS_FLAGS := -fnon-call-exceptions
endif endif
endif endif
bridges_DEBUGINFO_FLAGS := $(if $(call gb_LinkTarget__symbols_enabled,Library_$(gb_CPPU_ENV)_uno),$(gb_DEBUGINFO_FLAGS))
$(eval $(call gb_Library_use_libraries,$(gb_CPPU_ENV)_uno,\ $(eval $(call gb_Library_use_libraries,$(gb_CPPU_ENV)_uno,\
cppu \ cppu \
sal \ sal \
@@ -231,19 +228,19 @@ $(foreach obj,$(bridge_exception_objects),\
bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj))) \ bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj))) \
) )
$(foreach obj,$(bridge_noncallexception_objects),\ $(foreach obj,$(bridge_noncallexception_objects),\
$(eval $(call gb_Library_add_cxxobjects,$(gb_CPPU_ENV)_uno,\ $(eval $(call gb_Library_add_exception_objects,$(gb_CPPU_ENV)_uno,\
bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj) \ bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj) \
, $(bridges_NON_CALL_EXCEPTIONS_FLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) $(bridges_DEBUGINFO_FLAGS))) \ , $(bridges_NON_CALL_EXCEPTIONS_FLAGS) )) \
) )
$(foreach obj,$(bridge_noopt_objects),\ $(foreach obj,$(bridge_noopt_objects),\
$(eval $(call gb_Library_add_cxxobjects,$(gb_CPPU_ENV)_uno,\ $(eval $(call gb_Library_add_exception_objects,$(gb_CPPU_ENV)_uno,\
bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj) \ bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj) \
, $(gb_COMPILERNOOPTFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) $(bridges_DEBUGINFO_FLAGS))) \ , $(gb_COMPILERNOOPTFLAGS))) \
) )
$(foreach obj,$(bridge_noncallexception_noopt_objects),\ $(foreach obj,$(bridge_noncallexception_noopt_objects),\
$(eval $(call gb_Library_add_cxxobjects,$(gb_CPPU_ENV)_uno,\ $(eval $(call gb_Library_add_exception_objects,$(gb_CPPU_ENV)_uno,\
bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj) \ bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj) \
, $(gb_COMPILERNOOPTFLAGS) $(bridges_NON_CALL_EXCEPTIONS_FLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) $(bridges_DEBUGINFO_FLAGS))) \ , $(gb_COMPILERNOOPTFLAGS) $(bridges_NON_CALL_EXCEPTIONS_FLAGS) )) \
) )
$(foreach obj,$(bridge_cxx_objects),\ $(foreach obj,$(bridge_cxx_objects),\
$(eval $(call gb_Library_add_cxxobjects,$(gb_CPPU_ENV)_uno,\ $(eval $(call gb_Library_add_cxxobjects,$(gb_CPPU_ENV)_uno,\

View File

@@ -308,9 +308,9 @@ ifeq ($(OS),iOS)
# behaviour in the source code... Compiling this source file with # behaviour in the source code... Compiling this source file with
# optimization causes some Smart Art images to end up with completely # optimization causes some Smart Art images to end up with completely
# wrong colour, some even totally black. # wrong colour, some even totally black.
$(eval $(call gb_Library_add_cxxobjects,oox,\ $(eval $(call gb_Library_add_exception_objects,oox,\
oox/source/drawingml/color \ oox/source/drawingml/color \
, $(gb_COMPILERNOOPTFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) \ , $(gb_COMPILERNOOPTFLAGS) \
)) ))
else else
$(eval $(call gb_Library_add_exception_objects,oox,\ $(eval $(call gb_Library_add_exception_objects,oox,\

View File

@@ -1122,7 +1122,7 @@ $(call gb_LinkTarget_get_clean_target,$(1)) : CXXOBJECTS += $(2)
$(call gb_LinkTarget_get_target,$(1)) : $(call gb_CxxObject_get_target,$(2)) $(call gb_LinkTarget_get_target,$(1)) : $(call gb_CxxObject_get_target,$(2))
$(call gb_CxxObject_get_target,$(2)) : | $(call gb_LinkTarget_get_headers_target,$(1)) $(call gb_CxxObject_get_target,$(2)) : | $(call gb_LinkTarget_get_headers_target,$(1))
$(call gb_CxxObject_get_target,$(2)) : T_CXXFLAGS += $(3) $(call gb_CxxObject_get_target,$(2)) : T_CXXFLAGS += $(call gb_LinkTarget__get_cxxflags,$(4)) $(3)
$(call gb_CxxObject_get_target,$(2)) : \ $(call gb_CxxObject_get_target,$(2)) : \
OBJECTOWNER := $(call gb_Object__owner,$(2),$(1)) OBJECTOWNER := $(call gb_Object__owner,$(2),$(1))
ifneq ($(gb_ENABLE_PCH),) ifneq ($(gb_ENABLE_PCH),)
@@ -1258,7 +1258,7 @@ $(call gb_GenCxxObject_get_target,$(2)) : $(call gb_GenCxxObject_get_source,$(2)
$(call gb_GenCxxObject_get_source,$(2),$(1)) : | $(gb_Helper_MISCDUMMY) $(call gb_GenCxxObject_get_source,$(2),$(1)) : | $(gb_Helper_MISCDUMMY)
$(call gb_GenCxxObject_get_target,$(2)) : | $(call gb_LinkTarget_get_headers_target,$(1)) $(call gb_GenCxxObject_get_target,$(2)) : | $(call gb_LinkTarget_get_headers_target,$(1))
$(call gb_GenCxxObject_get_target,$(2)) : WARNINGS_NOT_ERRORS := $(true) $(call gb_GenCxxObject_get_target,$(2)) : WARNINGS_NOT_ERRORS := $(true)
$(call gb_GenCxxObject_get_target,$(2)) : T_CXXFLAGS += $(3) $(call gb_GenCxxObject_get_target,$(2)) : T_CXXFLAGS += $(call gb_LinkTarget__get_cxxflags,$(4)) $(3)
$(call gb_GenCxxObject_get_target,$(2)) : \ $(call gb_GenCxxObject_get_target,$(2)) : \
OBJECTOWNER := $(call gb_Object__owner,$(2),$(1)) OBJECTOWNER := $(call gb_Object__owner,$(2),$(1))
$(call gb_GenCxxObject_get_target,$(2)) : GEN_CXX_SOURCE := $(call gb_GenCxxObject_get_source,$(2),$(1)) $(call gb_GenCxxObject_get_target,$(2)) : GEN_CXX_SOURCE := $(call gb_GenCxxObject_get_source,$(2),$(1))
@@ -1333,7 +1333,7 @@ endef
# call gb_LinkTarget_add_exception_object,linktarget,sourcefile,cxxflags,linktargetmakefilename # call gb_LinkTarget_add_exception_object,linktarget,sourcefile,cxxflags,linktargetmakefilename
define gb_LinkTarget_add_exception_object define gb_LinkTarget_add_exception_object
$(call gb_LinkTarget_add_cxxobject,$(1),$(2),$(gb_LinkTarget_EXCEPTIONFLAGS) $(call gb_LinkTarget__get_cxxflags,$(4)) $(3),$(4)) $(call gb_LinkTarget_add_cxxobject,$(1),$(2),$(gb_LinkTarget_EXCEPTIONFLAGS) $(3),$(4))
endef endef
# call gb_LinkTarget__use_linktarget_objects,linktarget,linktargets # call gb_LinkTarget__use_linktarget_objects,linktarget,linktargets
@@ -1418,7 +1418,7 @@ endef
# call gb_LinkTarget_add_generated_exception_object,linktarget,sourcefile,cxxflags,linktargetmakefilename # call gb_LinkTarget_add_generated_exception_object,linktarget,sourcefile,cxxflags,linktargetmakefilename
define gb_LinkTarget_add_generated_exception_object define gb_LinkTarget_add_generated_exception_object
$(call gb_LinkTarget_add_generated_cxx_object,$(1),$(2),$(gb_LinkTarget_EXCEPTIONFLAGS) $(call gb_LinkTarget__get_cxxflags,$(4)) $(3),$(4)) $(call gb_LinkTarget_add_generated_cxx_object,$(1),$(2),$(gb_LinkTarget_EXCEPTIONFLAGS) $(3),$(4))
endef endef
# call gb_LinkTarget_add_generated_exception_objects,linktarget,sourcefile,cxxflags,linktargetmakefilename # call gb_LinkTarget_add_generated_exception_objects,linktarget,sourcefile,cxxflags,linktargetmakefilename

View File

@@ -32,8 +32,8 @@ $(eval $(call gb_CppunitTest_add_exception_objects,tools_test, \
tools/qa/cppunit/test_GenericTypeSerializer \ tools/qa/cppunit/test_GenericTypeSerializer \
)) ))
$(eval $(call gb_CppunitTest_add_cxxobjects,tools_test,\ $(eval $(call gb_CppunitTest_add_exception_objects,tools_test,\
tools/qa/cppunit/test_cpuid, $(gb_LinkTarget_EXCEPTIONFLAGS) $(INTRINSICS_CXXFLAGS) \ tools/qa/cppunit/test_cpuid, $(INTRINSICS_CXXFLAGS) \
)) ))
$(eval $(call gb_CppunitTest_use_sdk_api,tools_test)) $(eval $(call gb_CppunitTest_use_sdk_api,tools_test))