From patchwork Tue Dec 20 13:46:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 707451 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tjfKJ1Ns7z9t0m for ; Wed, 21 Dec 2016 00:49:24 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 5D2852FC38; Tue, 20 Dec 2016 13:49:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7C5LK5dt5dm1; Tue, 20 Dec 2016 13:49:14 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 5BB662FF93; Tue, 20 Dec 2016 13:48:05 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 916CC1BFA57 for ; Tue, 20 Dec 2016 13:47:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7BEFA2E96B for ; Tue, 20 Dec 2016 13:47:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rJR4vA4hUEFf for ; Tue, 20 Dec 2016 13:46:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lupi.sysmic.org (sysmic.org [62.210.89.17]) by silver.osuosl.org (Postfix) with ESMTPS id 0A0C72A17F for ; Tue, 20 Dec 2016 13:46:57 +0000 (UTC) Received: from lupi.online.net (sysmic.org [62.210.89.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jezz) by lupi.sysmic.org (Postfix) with ESMTPSA id 34B7243063; Tue, 20 Dec 2016 14:46:53 +0100 (CET) From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= To: buildroot@busybox.net Date: Tue, 20 Dec 2016 14:46:32 +0100 Message-Id: <1482241596-31688-16-git-send-email-jezz@sysmic.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1482241596-31688-1-git-send-email-jezz@sysmic.org> References: <1482241596-31688-1-git-send-email-jezz@sysmic.org> MIME-Version: 1.0 Cc: Thomas Petazzoni , =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= Subject: [Buildroot] [PATCH v5 15/19] infra-libtool: relink binaries on install 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: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Until now, libtool was not configured for cross-compilation. It did works, because Buildroot patched $libdir in .la files to include directories from sysroot. However, this was done after package installation. Thus, a package was not able to use its own (not yet patched) .la files. Because of that, libtool was not able to relink binaries during installation. So, Buildroot disabled relink on installation. Consequently, binaries that depends on internal libraries contains their build path in their RPATH: $ readelf -d target/bin/mount | grep RPATH 0x0000000f (RPATH) Library rpath: [/home/buildbot/output/build/util-linux-2.27.1/.libs] This particularity was incompatible with creation of reproducible binaries. However, with previous changes, libtool is now correctly configured and binaries can be relinked on install. So we can re-enable this feature. Note Yocto have a patch that remove extra paths during compilation and make relink unnecessary: http://git.yoctoproject.org/cgit.cgi/poky/tree/meta/recipes-devtools/libtool/libtool/fixinstall.patch Signed-off-by: Jérôme Pouiller Acked-by: Arnout Vandecappelle (Essensium/Mind) --- support/libtool/buildroot-libtool-v1.5.patch | 9 --------- support/libtool/buildroot-libtool-v2.2.patch | 9 --------- support/libtool/buildroot-libtool-v2.4.4.patch | 9 --------- support/libtool/buildroot-libtool-v2.4.patch | 9 --------- 4 files changed, 36 deletions(-) diff --git a/support/libtool/buildroot-libtool-v1.5.patch b/support/libtool/buildroot-libtool-v1.5.patch index 51d049f..0429c58 100644 --- a/support/libtool/buildroot-libtool-v1.5.patch +++ b/support/libtool/buildroot-libtool-v1.5.patch @@ -34,15 +34,6 @@ if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" -@@ -2272,7 +2279,7 @@ - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then - if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" -- need_relink=yes -+ need_relink=no - fi - # This is a shared library - @@ -2412,7 +2419,7 @@ if test -n "$inst_prefix_dir"; then case "$libdir" in diff --git a/support/libtool/buildroot-libtool-v2.2.patch b/support/libtool/buildroot-libtool-v2.2.patch index be4e5e3..b2058b4 100644 --- a/support/libtool/buildroot-libtool-v2.2.patch +++ b/support/libtool/buildroot-libtool-v2.2.patch @@ -67,15 +67,6 @@ # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects -@@ -5891,7 +5890,7 @@ - *) - if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" -- need_relink=yes -+ need_relink=no - fi - ;; - esac @@ -6094,7 +6093,7 @@ if test -n "$inst_prefix_dir"; then case $libdir in diff --git a/support/libtool/buildroot-libtool-v2.4.4.patch b/support/libtool/buildroot-libtool-v2.4.4.patch index 1458b5e..8e25d3d 100644 --- a/support/libtool/buildroot-libtool-v2.4.4.patch +++ b/support/libtool/buildroot-libtool-v2.4.4.patch @@ -73,15 +73,6 @@ Signed-off-by: Gustavo Zacarias # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects -@@ -8112,7 +8112,7 @@ - *) - if test no = "$installed"; then - func_append notinst_deplibs " $lib" -- need_relink=yes -+ need_relink=no - fi - ;; - esac @@ -8854,7 +8854,7 @@ if test -n "$inst_prefix_dir"; then case $libdir in diff --git a/support/libtool/buildroot-libtool-v2.4.patch b/support/libtool/buildroot-libtool-v2.4.patch index c2edd99..c475ec9 100644 --- a/support/libtool/buildroot-libtool-v2.4.patch +++ b/support/libtool/buildroot-libtool-v2.4.patch @@ -67,15 +67,6 @@ # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects -@@ -6697,7 +6696,7 @@ - *) - if test "$installed" = no; then - func_append notinst_deplibs " $lib" -- need_relink=yes -+ need_relink=no - fi - ;; - esac @@ -8854,7 +8854,7 @@ if test -n "$inst_prefix_dir"; then case $libdir in