From patchwork Sun Feb 10 21:38:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 1039492 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=free.fr Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CLMEGe+g"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43yMjr0FBPz9s5c for ; Mon, 11 Feb 2019 08:38:38 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7EC5685F58; Sun, 10 Feb 2019 21:38:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EbRndDinutNZ; Sun, 10 Feb 2019 21:38:32 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4580385F55; Sun, 10 Feb 2019 21:38:32 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 2F3F01BF95C for ; Sun, 10 Feb 2019 21:38:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 2C5E687934 for ; Sun, 10 Feb 2019 21:38:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uJaejQvt8kK2 for ; Sun, 10 Feb 2019 21:38:29 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by hemlock.osuosl.org (Postfix) with ESMTPS id 43FCF87935 for ; Sun, 10 Feb 2019 21:38:29 +0000 (UTC) Received: by mail-wm1-f45.google.com with SMTP id m1so13755806wml.2 for ; Sun, 10 Feb 2019 13:38:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=xUoa56guWqzPmfhAKq0ZJ2PlPRHrv+7HkgjpBXfBNOY=; b=CLMEGe+g3NS1Ru4UFIFD9j2GbbZsjyTA/Cn/0Qwmm1Bax9Tm3vfYAu1iL4rh8DQuXH K3P1l8tzAFiIWmJ6v01S7PkVTKVQ8cGWXWXLTjzB2eOo3ygnh/eV1ftWYeTAddTnMi0j VdCPl0BZIvmZpr5nZVX0WGbcHYB6DMIZ0Nd8qGmFR9Vn69jfM//IdkOtEHos+7bjPg6j XQv6aiQAXC0fDWPbFFEEsGrJWLWxBU66uz2hZk3GevRSZbf/Q//ByMtp5iednjpFLHBg nQUFVv3twxnWtQM/dTGHhNXrtWXGcXMho14/IpKv4BP3etdEAN0e8c5uqJGy/9nF9twI kH2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=xUoa56guWqzPmfhAKq0ZJ2PlPRHrv+7HkgjpBXfBNOY=; b=EkBI6Muff61hc+Ulas2NxqE//Z1Czxiy+wP5MCsi0dJTEG0hidHJ0dyBK5CvX8nRQV k8gqMBNzMu/KJIg/hQRUyOYcWiO8GBEFCiyW7GYePPjsHoK88tO+KuUBABkaYqO5ebht /Geb4lpfMVZXPGg8aB87UTYobJ8n+n7uHA8XlMlIUOrKZTH3fghOYmcMMvrpFj9yAe+T QT2tL3SHBYLLsIh4l57EC/XwECVpTSgrzP7HDSTlKZuiUFv0dBbz6rN8HaFSbPXUNAlO 1GmkOnWIuMeo5OId8udJc53nRWVyn0vjAx3tbw7HMUgjI3hqw/hGJ81GRT6bMj59Wcg7 dsnw== X-Gm-Message-State: AHQUAuYxC7gW4kFE9Jr9gfK6zCXKGwd/zH4t9UuxDlXPy/x2JcC+cfpQ 0gcT13yDLH6kavRyyoFrjqiLZ6lv X-Google-Smtp-Source: AHgI3IZYakXYqWd3OEt65Wj4jL8HTzufegYnL6u0urv8TTrOHZ6s1z9riB5un3sD9q5/LrBva8oYGA== X-Received: by 2002:a1c:2d08:: with SMTP id t8mr7341366wmt.5.1549834707578; Sun, 10 Feb 2019 13:38:27 -0800 (PST) Received: from scaer.home ([2a01:cb19:829a:2800:68e8:7a61:9bb9:12a]) by smtp.gmail.com with ESMTPSA id c65sm10154663wma.24.2019.02.10.13.38.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Feb 2019 13:38:26 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 10 Feb 2019 22:38:18 +0100 Message-Id: <20190210213818.5232-1-yann.morin.1998@free.fr> X-Mailer: git-send-email 2.14.1 Subject: [Buildroot] [PATCH] core/pkg-infra: tweak only .la files that need it X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas De Schampheleire , "Yann E. MORIN" , Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Currently, when we tweak the .la files, we do so unconditionally on all .la files, even those we already fixed in a previous run. This has the nasty side effect that each .la file will be reported as being touched by all packages that are installed after the package that actually installed said .la file. Since we can't easily know what files were installed by a package (that is an instrumentation hook, and comes after the mangling), we use a trick (like is done in libtool?): we do mangle all files, each into a temporary location; if the result is identical to the input, we remove the temporary, while if the result differs from the output, we move the temporary to replace the input. Reported-by: Nicolas Cavallari Reported-by: Thomas Petazzoni Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Nicolas Cavallari Cc: Thomas De Schampheleire Cc: Arnout Vandecappelle --- Changes v1 -> v2: - drop spurious trailing semicolon on sed command line (Thomas DS.) - use $$(find ...) instead of $(find ...), as we don't want it to be evaluated by the Makefile, but by the shell - silence the output of cmp - typoes in commit log (Thomas DS.) --- package/pkg-generic.mk | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 6168b40e89..c97ce36b9d 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -294,7 +294,8 @@ $(BUILD_DIR)/%/.stamp_staging_installed: $(addprefix $(STAGING_DIR)/usr/bin/,$($(PKG)_CONFIG_SCRIPTS)) ;\ fi @$(call MESSAGE,"Fixing libtool files") - $(Q)find $(STAGING_DIR)/usr/lib* -name "*.la" | xargs --no-run-if-empty \ + for la in $$(find $(STAGING_DIR)/usr/lib* -name "*.la"); do \ + cp -a "$${la}" "$${la}.fixed" && \ $(SED) "s:$(BASE_DIR):@BASE_DIR@:g" \ -e "s:$(STAGING_DIR):@STAGING_DIR@:g" \ $(if $(TOOLCHAIN_EXTERNAL_INSTALL_DIR),\ @@ -303,7 +304,14 @@ $(BUILD_DIR)/%/.stamp_staging_installed: $(if $(TOOLCHAIN_EXTERNAL_INSTALL_DIR),\ -e "s:@TOOLCHAIN_EXTERNAL_INSTALL_DIR@:$(TOOLCHAIN_EXTERNAL_INSTALL_DIR):g") \ -e "s:@STAGING_DIR@:$(STAGING_DIR):g" \ - -e "s:@BASE_DIR@:$(BASE_DIR):g" + -e "s:@BASE_DIR@:$(BASE_DIR):g" \ + "$${la}.fixed" && \ + if cmp -s "$${la}" "$${la}.fixed"; then \ + rm -f "$${la}.fixed"; \ + else \ + mv "$${la}.fixed" "$${la}"; \ + fi || exit 1; \ + done @$(call step_end,install-staging) $(Q)touch $@