summaryrefslogtreecommitdiff
path: root/solenv/gbuild
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-04-21 10:26:37 +0200
committerLuboš Luňák <l.lunak@collabora.com>2020-04-21 12:01:08 +0200
commit71de470ef2e7bac21a59d6baad8d12d1cc181628 (patch)
treeb08424a0363ca2fc971ac443409cee4a0d17ae0a /solenv/gbuild
parent57839969381d93e96e98fdaee65e8593c8f07893 (diff)
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@collabora.com>
Diffstat (limited to 'solenv/gbuild')
-rw-r--r--solenv/gbuild/platform/com_GCC_class.mk11
-rw-r--r--solenv/gbuild/platform/com_GCC_defs.mk1
2 files changed, 10 insertions, 2 deletions
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