diff options
author | Michael Stahl <mstahl@redhat.com> | 2011-10-21 20:10:04 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2011-10-21 20:17:19 +0200 |
commit | 3e5eece31d93ed378613991c8a8bbe451aa5c081 (patch) | |
tree | b70c5eda84bafb37a619fc9ebacd7ef3c6598cb9 /solenv/gbuild/LinkTarget.mk | |
parent | 68cde28252e6b1b84b5b831200d0c89c247b203a (diff) |
LinkTarget: new check for duplicate objects
Always enabled, as this runs for me with an overhead in the range of
measurement error (in tail_build):
current implementation: time make -nsrj8
17.269s 16.470s 17.537s 16.754s 16.595s
disabled: time make -nsrj8 gb_CHECKOBJECTOWNER=
13.212s 13.345s 13.470s 13.852s 13.712s
new implementation: time make -nsrj8 gb_CHECKOBJECTOWNER=
13.477s 13.911s 13.624s 13.606s 13.535s
Diffstat (limited to 'solenv/gbuild/LinkTarget.mk')
-rw-r--r-- | solenv/gbuild/LinkTarget.mk | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk index 49dd0762955a..f9c9917f5847 100644 --- a/solenv/gbuild/LinkTarget.mk +++ b/solenv/gbuild/LinkTarget.mk @@ -90,6 +90,13 @@ endif # dependencies prefixed with | are build-order only dependencies +# check that objects are only linked into one link target: +# multiple linking may cause problems because different link targets may +# require different compiler flags +define gb_Object__owner +$$(if $$(OBJECTOWNER),\ + $$(call gb_Output_warn,$(1) is linked in by $$(OBJECTOWNER) $(2)))$(2) +endef # For every object there is a dep file (if gb_FULLDEPS is active). # The dep file depends on the object: the Object__command also updates the @@ -760,6 +767,8 @@ $(call gb_LinkTarget_get_clean_target,$(1)) : COBJECTS += $(2) $(call gb_LinkTarget_get_target,$(1)) : $(call gb_CObject_get_target,$(2)) $(call gb_CObject_get_target,$(2)) : | $(call gb_LinkTarget_get_headers_target,$(1)) $(call gb_CObject_get_target,$(2)) : T_CFLAGS += $(3) +$(call gb_CObject_get_target,$(2)) : \ + OBJECTOWNER := $(call gb_Object__owner,$(2),$(1)) ifeq ($(gb_FULLDEPS),$(true)) $(call gb_LinkTarget_get_dep_target,$(1)) : COBJECTS += $(2) @@ -781,6 +790,8 @@ $(call gb_LinkTarget_get_clean_target,$(1)) : CXXOBJECTS += $(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)) : T_CXXFLAGS += $(3) +$(call gb_CxxObject_get_target,$(2)) : \ + OBJECTOWNER := $(call gb_Object__owner,$(2),$(1)) ifeq ($(gb_FULLDEPS),$(true)) $(call gb_LinkTarget_get_dep_target,$(1)) : CXXOBJECTS += $(2) @@ -802,6 +813,8 @@ $(call gb_LinkTarget_get_clean_target,$(1)) : OBJCOBJECTS += $(2) $(call gb_LinkTarget_get_target,$(1)) : $(call gb_ObjCObject_get_target,$(2)) $(call gb_ObjCObject_get_target,$(2)) : | $(call gb_LinkTarget_get_headers_target,$(1)) $(call gb_ObjCObject_get_target,$(2)) : T_OBJCFLAGS += $(3) +$(call gb_ObjCObject_get_target,$(2)) : \ + OBJECTOWNER := $(call gb_Object__owner,$(2),$(1)) ifeq ($(gb_FULLDEPS),$(true)) $(call gb_LinkTarget_get_dep_target,$(1)) : OBJCOBJECTS += $(2) @@ -823,6 +836,8 @@ $(call gb_LinkTarget_get_clean_target,$(1)) : OBJCXXOBJECTS += $(2) $(call gb_LinkTarget_get_target,$(1)) : $(call gb_ObjCxxObject_get_target,$(2)) $(call gb_ObjCxxObject_get_target,$(2)) : | $(call gb_LinkTarget_get_headers_target,$(1)) $(call gb_ObjCxxObject_get_target,$(2)) : T_OBJCXXFLAGS += $(3) +$(call gb_ObjCxxObject_get_target,$(2)) : \ + OBJECTOWNER := $(call gb_Object__owner,$(2),$(1)) ifeq ($(gb_FULLDEPS),$(true)) $(call gb_LinkTarget_get_dep_target,$(1)) : OBJCXXOBJECTS += $(2) @@ -843,6 +858,8 @@ $(call gb_LinkTarget_get_clean_target,$(1)) : ASMOBJECTS += $(2) $(call gb_LinkTarget_get_target,$(1)) : $(call gb_AsmObject_get_target,$(2)) $(call gb_AsmObject_get_target,$(2)) : | $(call gb_LinkTarget_get_headers_target,$(1)) +$(call gb_AsmObject_get_target,$(2)) : \ + OBJECTOWNER := $(call gb_Object__owner,$(2),$(1)) ifeq ($(gb_FULLDEPS),$(true)) $(call gb_LinkTarget_get_dep_target,$(1)) : ASMOBJECTS += $(2) @@ -863,6 +880,8 @@ $(call gb_LinkTarget_get_clean_target,$(1)) : GENCOBJECTS += $(2) $(call gb_LinkTarget_get_target,$(1)) : $(call gb_GenCObject_get_target,$(2)) $(call gb_GenCObject_get_source,$(2)) : | $(call gb_LinkTarget_get_headers_target,$(1)) $(call gb_GenCObject_get_target,$(2)) : T_CFLAGS += $(3) +$(call gb_GenCObject_get_target,$(2)) : \ + OBJECTOWNER := $(call gb_Object__owner,$(2),$(1)) ifeq ($(gb_FULLDEPS),$(true)) $(call gb_LinkTarget_get_dep_target,$(1)) : GENCOBJECTS += $(2) @@ -883,6 +902,8 @@ $(call gb_LinkTarget_get_clean_target,$(1)) : GENCXXOBJECTS += $(2) $(call gb_LinkTarget_get_target,$(1)) : $(call gb_GenCxxObject_get_target,$(2)) $(call gb_GenCxxObject_get_source,$(2)) : | $(call gb_LinkTarget_get_headers_target,$(1)) $(call gb_GenCxxObject_get_target,$(2)) : T_CXXFLAGS += $(3) +$(call gb_GenCxxObject_get_target,$(2)) : \ + OBJECTOWNER := $(call gb_Object__owner,$(2),$(1)) ifeq ($(gb_FULLDEPS),$(true)) $(call gb_LinkTarget_get_dep_target,$(1)) : GENCXXOBJECTS += $(2) |