From patchwork Fri May 25 20:43:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 920760 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="AwXgz988"; dkim-atps=neutral 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 40syrM1Ymzz9s0x for ; Sat, 26 May 2018 06:43:14 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id F2671879E3; Fri, 25 May 2018 20:43:12 +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 IjYjF8AqT6sP; Fri, 25 May 2018 20:43:11 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id DA733879CE; Fri, 25 May 2018 20:43:11 +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 F19511C2092 for ; Fri, 25 May 2018 20:43:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id EE220886B3 for ; Fri, 25 May 2018 20:43:07 +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 LD2XSIzYIMNf for ; Fri, 25 May 2018 20:43:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by whitealder.osuosl.org (Postfix) with ESMTPS id 455D3886CC for ; Fri, 25 May 2018 20:43:07 +0000 (UTC) Received: by mail-wr0-f193.google.com with SMTP id u12-v6so11196597wrn.8 for ; Fri, 25 May 2018 13:43:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=SVUTlgKmYyoUVPVaVodM3wVNKJ2kbRroegFFJPPpjzM=; b=AwXgz988N6yQNJW74R8pFqTzoky39OXY1YEstJurWPMsqzQnxQZi1kpMoZo+eZHDvG iOGLIBUt6sWm5i+hv+nvg73FynieJ/9CFFP6WQfN6GSg48Dp/V3fFjQc9e58cJNG5tgj kQL8wS83sEGr9XC23QqJJKDFTNOqt6HzRUBknB+NxXWEbsiXWhPFsKP8nRU8fJZgWggC IrNEir1esQdDX4xBo/Kow6LUy/KZZuLBYZn/4DZwPSkzzHdT6V+t6cmSGjaTBdRNdBVU t/GqLdB8AWmrAjSK2QYmDJGk8bXMVOb+kMdNAZx7Q97IvJdKJg8OXCYUsZdd038FVcds d0vQ== 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 :in-reply-to:references; bh=SVUTlgKmYyoUVPVaVodM3wVNKJ2kbRroegFFJPPpjzM=; b=JqvVbdBxnduOeWU2NaVHEVhvdtpKW2UReP0ykfZmfrffnD9jeBaahJ3OCx1YfCaHw6 MBnXe/kr7ImxZGWag95X828tvc1YUm0/p+3afEG8r2yz28EDV5lrMjkrTktuIasghurE kyTSh4X5x9UTbFDF4AKtusKTC5BS15cOH8D0TSR7Uovo9ynGcANGtQpmlsvU0+EMC5iI WQQFBHzoE/oXo+dCS7AOBLN16Dz5CX/O37JGnqpU1ZcE9vMwP4foQNfv9KzVsXQAdgt1 VES0313F/W7gFktfZxsRmFJ2wrW1zE33M3/tYn2/I847x5i0e1RIIQwoC01hFn84ekgv +prw== X-Gm-Message-State: ALKqPwdEPPfIb78lUwYaoVSApY9SIXxzKX/3jmeNKgqc57YmMGmOlOAE g6dIIB4i/UB2BB6EbDz9JJHecw== X-Google-Smtp-Source: AB8JxZr4RjL38YJR90tN+BhUsCCKt9c7ZI0jFPSs/jFCkjS/ARG4bq8KNsuzAi2tVzRp1ol9LHFVKg== X-Received: by 2002:adf:85dd:: with SMTP id 29-v6mr3404574wru.120.1527280985677; Fri, 25 May 2018 13:43:05 -0700 (PDT) Received: from scaer.bzh.lan (2a01cb0886107300a556795e0851f8aa.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:a556:795e:851:f8aa]) by smtp.gmail.com with ESMTPSA id m35-v6sm26085655wrm.51.2018.05.25.13.43.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 13:43:05 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Fri, 25 May 2018 22:43:02 +0200 Message-Id: <59b3d35d7c805ebee29dc7185ea63e55aca768ca.1527280948.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: Subject: [Buildroot] [PATCH 2/2] package/elf2flt: replace hard-links with script wrappers to fix rpath X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christophe Priouzeau , "Yann E. MORIN" , Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Do for elf2flt what we did for binutils: replace the hardlinks (which break rpath handling) with script wrappers. See previous commit (package/binutils: switch from symlinks to script wrappers) and commit f9cffb6af4 (binutils: replace hard-links with soft-links to fix rpath) for the complete story. Fixes: #11031. Reported-by: Christophe Priouzeau Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Peter Korsgaard Cc: Christophe Priouzeau --- package/elf2flt/elf2flt.mk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/package/elf2flt/elf2flt.mk b/package/elf2flt/elf2flt.mk index 995dfedebd..6ce5cd34a2 100644 --- a/package/elf2flt/elf2flt.mk +++ b/package/elf2flt/elf2flt.mk @@ -29,4 +29,21 @@ endif HOST_ELF2FLT_CONF_ENV = LIBS="$(HOST_ELF2FLT_LIBS)" +# Hardlinks between binaries in different directories cause a problem +# # with rpath fixup, so we de-hardlink those binaries, and replace them +# with wrapper scripts. ld and ld.real are already wrappers, but they +# point to the binutils, so we have to replace them with wrappers to +# the elf2flt ones. +ELF2FLT_TOOLS = elf2flt flthdr ld ld.real +define HOST_ELF2FLT_FIXUP_HARDLINKS + $(foreach tool,$(ELF2FLT_TOOLS),\ + rm -f $(HOST_DIR)/$(GNU_TARGET_NAME)/bin/$(tool) && \ + printf '#!/usr/bin/env bash\nexec -a "$${0}" "$${0%%/*}/%s-$${0##*/}" "$${@}"\n' \ + ../../bin/$(GNU_TARGET_NAME) \ + >$(HOST_DIR)/$(GNU_TARGET_NAME)/bin/$(tool) + ) + chmod +x $(HOST_DIR)/$(GNU_TARGET_NAME)/bin/* +endef +HOST_ELF2FLT_POST_INSTALL_HOOKS += HOST_ELF2FLT_FIXUP_HARDLINKS + $(eval $(host-autotools-package))