From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: [PATCH] mk: fix parallel build of test resources Date: Fri, 24 Jun 2016 00:36:03 +0200 Message-ID: <1466721363-24546-1-git-send-email-thomas.monjalon@6wind.com> Cc: dev@dpdk.org To: Jan Viktorin Return-path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id 1C5F7C628 for ; Fri, 24 Jun 2016 00:36:13 +0200 (CEST) Received: by mail-wm0-f47.google.com with SMTP id 187so6207242wmz.1 for ; Thu, 23 Jun 2016 15:36:13 -0700 (PDT) List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The build was failing sometimes when building with multiple parallel jobs: # rm build/build/app/test/*res* # make -j6 objcopy: 'resource.tmp': No such file The reason is that each resource was built from the same temporary file. The failure is seen because of a race condition when removing the temporary file after each resource creation. It also means that some resources may be created from the wrong source. The fix is to have a different temporary file for each resource. We do not use the original source file because it has a long path which is used by objcopy to name the symbols after some transformations. The trick is to create a symbolic link of the source file if it is not already in the current build directory. Then we just have to replace the dot by an underscore to predict the symbol names to redefine. Fixes: 1e9e0a6270 ("app/test: fix resource creation with objcopy on FreeBSD") Signed-off-by: Thomas Monjalon --- app/test/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/test/Makefile b/app/test/Makefile index 9fa03fb..46f6005 100644 --- a/app/test/Makefile +++ b/app/test/Makefile @@ -43,14 +43,14 @@ define linked_resource SRCS-y += $(1).res.o $(1).res.o: $(2) @ echo ' MKRES $$@' - $Q ln -fs $$< resource.tmp + $Q [ "$$(