[Libreoffice-commits] core.git: solenv/gbuild

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 21 10:01:49 UTC 2020


 solenv/gbuild/platform/com_GCC_class.mk |   11 +++++++++--
 solenv/gbuild/platform/com_GCC_defs.mk  |    1 +
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 71de470ef2e7bac21a59d6baad8d12d1cc181628
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Tue Apr 21 10:26:37 2020 +0200
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Tue Apr 21 12:01:08 2020 +0200

    don't try to use -fno-enforce-eh-specs with Clang
    
    The use can be triggered when using gb_LinkTarget_use_clang, but
    Clang unlike GCC doesn't know the option.
    
    Change-Id: Idd109a09127061a72940de9229f0dd34b221375d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92611
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk
index f7e553dd5dc8..d19f0d3686ad 100644
--- a/solenv/gbuild/platform/com_GCC_class.mk
+++ b/solenv/gbuild/platform/com_GCC_class.mk
@@ -59,6 +59,12 @@ define gb_CObject__compiler
 		$(if $(2), $(2), $(gb_CXX)))
 endef
 
+# When gb_LinkTarget_use_clang is used, filter out GCC flags that Clang doesn't know.
+# $(call gb_CObject__filter_out_clang_cflags,cflags)
+define gb_CObject__filter_out_clang_cflags
+    $(filter-out $(gb_FilterOutClangCFLAGS),$(1))
+endef
+
 # $(call gb_CObject__command_pattern,object,flags,source,dep-file,compiler-plugins,symbols,compiler)
 define gb_CObject__command_pattern
 $(call gb_Helper_abbreviate_dirs,\
@@ -72,7 +78,7 @@ $(call gb_Helper_abbreviate_dirs,\
 		$(if $(WARNINGS_NOT_ERRORS),$(if $(ENABLE_WERROR),$(if $(PLUGIN_WARNINGS_AS_ERRORS),$(gb_COMPILER_PLUGINS_WARNINGS_AS_ERRORS))),$(gb_CFLAGS_WERROR)) \
 		$(if $(5),$(gb_COMPILER_PLUGINS)) \
 		$(if $(COMPILER_TEST),-fsyntax-only -ferror-limit=0 -Xclang -verify) \
-		$(2) \
+		$(if $(7), $(call gb_CObject__filter_out_clang_cflags,$(2)),$(2)) \
 		$(if $(WARNINGS_DISABLED),$(gb_CXXFLAGS_DISABLE_WARNINGS)) \
 		$(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \
 		-c $(3) \
@@ -125,7 +131,8 @@ $(call gb_Helper_abbreviate_dirs,\
 	CCACHE_DISABLE=1 $(gb_COMPILER_SETUP) \
 	$(if $(8),$(8),$(gb_CXX)) \
 		-x c++-header \
-		$(4) $(5) \
+		$(4) \
+		$(if $(7), $(call gb_CObject__filter_out_clang_cflags,$(5)),$(5)) \
 		$(if $(WARNINGS_DISABLED),$(gb_CXXFLAGS_DISABLE_WARNINGS)) \
 		$(gb_COMPILERDEPFLAGS) \
 		$(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index cc0eabc292f2..baeb215bfb9e 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -194,6 +194,7 @@ ifeq ($(gb_ENABLE_DBGUTIL),$(false))
 ifeq ($(HAVE_GCC_FNO_ENFORCE_EH_SPECS),TRUE)
 gb_LinkTarget_EXCEPTIONFLAGS += \
 	-fno-enforce-eh-specs
+gb_FilterOutClangCFLAGS += -fno-enforce-eh-specs
 endif
 endif
 


More information about the Libreoffice-commits mailing list