From patchwork Thu Jul 20 14:35:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Grandegger X-Patchwork-Id: 791621 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xCxKD1rq5z9s03 for ; Fri, 21 Jul 2017 00:36:00 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id AE987885A0; Thu, 20 Jul 2017 14:35:57 +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 KECMV3HWuJBL; Thu, 20 Jul 2017 14:35:55 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id B344988573; Thu, 20 Jul 2017 14:35:55 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 611D71C409D for ; Thu, 20 Jul 2017 14:35:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5B79188A91 for ; Thu, 20 Jul 2017 14:35:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VfNkShKmRwlw for ; Thu, 20 Jul 2017 14:35:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mailproxy02.manitu.net (mailproxy02.manitu.net [217.11.48.66]) by whitealder.osuosl.org (Postfix) with ESMTPS id 5CE1A88B80 for ; Thu, 20 Jul 2017 14:35:35 +0000 (UTC) Received: from onex.fritz.box (aftr-185-17-207-248.dynamic.mnet-online.de [185.17.207.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: wg@grandegger.com) by mailproxy02.manitu.net (Postfix) with ESMTPSA id F00E31020203; Thu, 20 Jul 2017 16:35:32 +0200 (CEST) From: Wolfgang Grandegger To: buildroot@buildroot.org Date: Thu, 20 Jul 2017 16:35:16 +0200 Message-Id: <1500561321-6623-6-git-send-email-wg@grandegger.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1500561321-6623-1-git-send-email-wg@grandegger.com> References: <1500561321-6623-1-git-send-email-wg@grandegger.com> Cc: Thomas Petazzoni , Wolfgang Grandegger Subject: [Buildroot] [PATCH v8 05/10] core: sanitize RPATH in target tree before copying the overlay X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" We sanitize the RPATH of ELF files in the target tree to deal with stupid packages that don't correctly use --prefix/DESTDIR and that end up putting the full absolute build-time directory in the RPATH. We do it before copying the overlay and calling the post-build script. The user is completely responsible for what happens in the last two steps, and it should never be touched by us. Signed-off-by: Wolfgang Grandegger --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 188ce9a..d4faa02 100644 --- a/Makefile +++ b/Makefile @@ -709,6 +709,9 @@ endif echo "PRETTY_NAME=\"Buildroot $(BR2_VERSION)\"" \ ) > $(TARGET_DIR)/etc/os-release + @$(call MESSAGE,"Sanitizing RPATH in target tree") + $(TOPDIR)/support/scripts/fix-rpath target + @$(foreach d, $(call qstrip,$(BR2_ROOTFS_OVERLAY)), \ $(call MESSAGE,"Copying overlay $(d)"); \ rsync -a --ignore-times --keep-dirlinks $(RSYNC_VCS_EXCLUSIONS) \