From patchwork Thu Jun 23 22:36:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 14305 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 93F78C63A; Fri, 24 Jun 2016 00:36:14 +0200 (CEST) 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=EpLxKL9fTtTfof63HfcJZz/CppQiJF7O/UtKUYrlhCk=; b=poj1OApGS4EnuYPZbFd+qeWxLVR4sAUYzCzAwHipKJKpQAtdVtA0Unaz08Dk83HOki N7T4kuzl7+RgBjvvkbHGGTxU4WUyQmfxURJn61dKezLa0wYS8lFcA8USGOBCQs7cYn8e WIM21TM8sVNHe4OrtvDXFx0hMJsuuxMmKuNy8M1ET+GYsxR3z+NgZDQnD3kIz0pCux6I c5O1qU9foponRTpJI02VgIlOM0ppNWVXd+Iiap/SDRVMCA4p7q7BIzXMquT06vkcdyQc HpfeJCDiPR8ByLGvv5RzM8teyUJMOLKlsZTrM++OTIeoqErDWsuMhqYJmuvTui6FDLUR 35hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=EpLxKL9fTtTfof63HfcJZz/CppQiJF7O/UtKUYrlhCk=; b=FEoddDsmkG/jlQ25wypI37ASkClXYVriihE8tzoeP7y9w0A8HXFevrjh+7c+ak4JMc pD9lRX1x1EGp5Q6k7kO30rb5e0n2UN711JsDH9PmT5fUCdu1hOz1d/5vSy0slGZfliBp 0UXz9qKmp0J3STOo8hgKu/MsvfV+tGRTwG61BYBQ+D9oPEnXJVbKJpSWolmAzlXUpBzE rLGxgbXvZAFp2TIt7VUBVaK1WoAjdYU3pDiwjnKelcusCL+4s+1vS7vpe5XiZgZ94FHn drAzUz06EG+3LxKgEl0uZrG9RJuoHqrRIuNjqUNS/Nx/aRwBNUb7uSEzy+F4mUHRgrR6 Y7PA== X-Gm-Message-State: ALyK8tJIHvjl0Fz0JCZSP6+rIpoiqgfGAmLW2fLTNQwGY4nROah/irNq66rx/4e6jmIs03Aa X-Received: by 10.28.138.85 with SMTP id m82mr2850827wmd.88.1466721372648; Thu, 23 Jun 2016 15:36:12 -0700 (PDT) Received: from XPS13.localdomain (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id k3sm2104661wju.29.2016.06.23.15.36.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 23 Jun 2016 15:36:11 -0700 (PDT) From: Thomas Monjalon To: Jan Viktorin Cc: dev@dpdk.org Date: Fri, 24 Jun 2016 00:36:03 +0200 Message-Id: <1466721363-24546-1-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 2.7.0 Subject: [dpdk-dev] [PATCH] mk: fix parallel build of test resources X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list 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 [ "$$(