From mboxrd@z Thu Jan 1 00:00:00 1970 From: luca.boccassi@gmail.com Subject: [PATCH v8 6/6] mk: install symlinks before build step Date: Thu, 12 Oct 2017 14:15:54 +0100 Message-ID: <20171012131554.1533-7-luca.boccassi@gmail.com> References: <20170905205159.8606-1-luca.boccassi@gmail.com> <20171012131554.1533-1-luca.boccassi@gmail.com> Cc: ferruh.yigit@intel.com, thomas@monjalon.net, Luca Boccassi To: dev@dpdk.org Return-path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id 41D5D1B324 for ; Thu, 12 Oct 2017 15:16:47 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id q124so13139463wmb.0 for ; Thu, 12 Oct 2017 06:16:47 -0700 (PDT) In-Reply-To: <20171012131554.1533-1-luca.boccassi@gmail.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Luca Boccassi A race condition can happen during parallel builds, where a header might be installed in RTE_OUT/include before CFLAGS is recursively expanded. This causes GCC to sometimes pick the header path as SRCDIR/... and sometimes as RTE_OUT/include/... making the build unreproducible, as the full path is used for the expansion of __FILE__ and in the DWARF directory listing. Installing all symlinks before all builds solves the problem. It is still suboptimal, as the (fixed) path recorded in the DWARF dir listing will include the user-configurable build output directory, and thus will result in a different binary between different users despite all other conditions being equal, but it is a simpler approach that will anyway be obsolete once the build system is switched to Meson. Suggested-by: Ferruh Yigit Signed-off-by: Luca Boccassi --- mk/rte.lib.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk index 13115d146..4767ce4f2 100644 --- a/mk/rte.lib.mk +++ b/mk/rte.lib.mk @@ -59,14 +59,20 @@ endif _BUILD = $(LIB) -_INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB) +PREINSTALL = $(SYMLINK-FILES-y) +_INSTALL = $(INSTALL-FILES-y) $(RTE_OUTPUT)/lib/$(LIB) _CLEAN = doclean .PHONY: all all: install .PHONY: install +ifeq ($(SYMLINK-FILES-y),) install: build _postinstall +else +install: _preinstall build _postinstall +build: _preinstall +endif _postinstall: build -- 2.11.0