From patchwork Fri May 20 17:52:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Fornero X-Patchwork-Id: 624577 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rBFrQ1CHMz9sf9 for ; Sat, 21 May 2016 03:52:22 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 84593968E1; Fri, 20 May 2016 17:52:20 +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 W1E25zeuhXoc; Fri, 20 May 2016 17:52:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 80DFB968D8; Fri, 20 May 2016 17:52:19 +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 9BAE21C1536 for ; Fri, 20 May 2016 17:52:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 97185930F8 for ; Fri, 20 May 2016 17:52:18 +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 bpZHzwyGEB3E for ; Fri, 20 May 2016 17:52:17 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mxsea-00-ah.mathworks.com (mxsea-00-ah.mathworks.com [144.212.100.38]) by whitealder.osuosl.org (Postfix) with ESMTPS id D831D930F7 for ; Fri, 20 May 2016 17:52:16 +0000 (UTC) Received: from mxsea-00-ah.mathworks.com (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id AE3A61955E7_73F4ECFB for ; Fri, 20 May 2016 17:52:15 +0000 (GMT) Received: from mail-vif.mathworks.com (turing.mathworks.com [144.212.95.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxsea-00-ah.mathworks.com (Sophos Email Appliance) with ESMTPS id A53141919C8_73F4ECFF for ; Fri, 20 May 2016 17:52:15 +0000 (GMT) Received: from mfornero1-deb7-64.mathworks.com (mfornero1-deb7-64.dhcp.mathworks.com [172.31.165.86]) by mail-vif.mathworks.com (8.14.7/8.14.7) with ESMTP id u4KHqF1a014513; Fri, 20 May 2016 13:52:15 -0400 From: Matthew Fornero To: buildroot@busybox.net Date: Fri, 20 May 2016 13:52:05 -0400 Message-Id: <1463766725-15724-1-git-send-email-mfornero@mathworks.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1459381580-18169-1-git-send-email-mfornero@mathworks.com> References: <1459381580-18169-1-git-send-email-mfornero@mathworks.com> Cc: Matthew Fornero Subject: [Buildroot] [PATCH v4] toolchain-external: Commonize /lib/ symlinks 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" Commonize the creation of symlinks from {/usr}/lib to {/usr}/lib/. These were originally defined on a per-toolchain basis for the Linaro toolchains, but there is currently no support for creating symlinks for custom toolchains that may have been based on Linaro (or older versions of the Linaro toolchain). Add common code for all supported Linaro toolchains and add a new config option, BR2_TOOLCHAIN_EXTERNAL_PREFIX_SYMLINK to enable custom toolchains to enable the symbolic link creation. Signed-off-by: Matthew Fornero --- v4: Rebase to current master v3: Invert Kconfig and cleanup as suggested by Arnout and Baruch Siach v2: Cleanup as suggested by Arnout Vandecappelle --- toolchain/toolchain-external/Config.in | 17 +++++++++++++ toolchain/toolchain-external/toolchain-external.mk | 26 ++++++-------------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in index b7f9241..fa698b1 100644 --- a/toolchain/toolchain-external/Config.in +++ b/toolchain/toolchain-external/Config.in @@ -23,6 +23,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_ARM depends on !BR2_STATIC_LIBS select BR2_TOOLCHAIN_EXTERNAL_GLIBC select BR2_TOOLCHAIN_HAS_NATIVE_RPC + select BR2_TOOLCHAIN_EXTERNAL_NEEDS_PREFIX_SYMLINK select BR2_INSTALL_LIBSTDCPP select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1 select BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 @@ -45,6 +46,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_ARM depends on !BR2_STATIC_LIBS select BR2_TOOLCHAIN_EXTERNAL_GLIBC select BR2_TOOLCHAIN_HAS_NATIVE_RPC + select BR2_TOOLCHAIN_EXTERNAL_NEEDS_PREFIX_SYMLINK select BR2_INSTALL_LIBSTDCPP select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_0 select BR2_TOOLCHAIN_GCC_AT_LEAST_5 @@ -67,6 +69,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_ARMEB depends on !BR2_STATIC_LIBS select BR2_TOOLCHAIN_EXTERNAL_GLIBC select BR2_TOOLCHAIN_HAS_NATIVE_RPC + select BR2_TOOLCHAIN_EXTERNAL_NEEDS_PREFIX_SYMLINK select BR2_INSTALL_LIBSTDCPP select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1 select BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 @@ -89,6 +92,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_ARMEB depends on !BR2_STATIC_LIBS select BR2_TOOLCHAIN_EXTERNAL_GLIBC select BR2_TOOLCHAIN_HAS_NATIVE_RPC + select BR2_TOOLCHAIN_EXTERNAL_NEEDS_PREFIX_SYMLINK select BR2_INSTALL_LIBSTDCPP select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_0 select BR2_TOOLCHAIN_GCC_AT_LEAST_5 @@ -523,6 +527,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64 select BR2_TOOLCHAIN_EXTERNAL_GLIBC select BR2_INSTALL_LIBSTDCPP select BR2_TOOLCHAIN_HAS_NATIVE_RPC + select BR2_TOOLCHAIN_EXTERNAL_NEEDS_PREFIX_SYMLINK select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7 select BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 help @@ -538,6 +543,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64 select BR2_TOOLCHAIN_EXTERNAL_GLIBC select BR2_INSTALL_LIBSTDCPP select BR2_TOOLCHAIN_HAS_NATIVE_RPC + select BR2_TOOLCHAIN_EXTERNAL_NEEDS_PREFIX_SYMLINK select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_0 select BR2_TOOLCHAIN_GCC_AT_LEAST_5 help @@ -692,6 +698,9 @@ config BR2_TOOLCHAIN_EXTERNAL_PREFIX default BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX \ if BR2_TOOLCHAIN_EXTERNAL_CUSTOM +config BR2_TOOLCHAIN_EXTERNAL_NEEDS_PREFIX_SYMLINK + bool + config BR2_TOOLCHAIN_EXTERNAL_GLIBC bool select BR2_TOOLCHAIN_USES_GLIBC @@ -1005,6 +1014,14 @@ config BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS need to be copied to the target filesystem, enter them here, separated by spaces. +config BR2_TOOLCHAIN_EXTERNAL_PREFIX_SYMLINK + bool "Symlink /lib/" + select BR2_TOOLCHAIN_EXTERNAL_NEEDS_PREFIX_SYMLINK + help + Select this option if your external toolchain needs a symlink + from {/usr}/lib to {/usr}/lib/. This may be required if + your toolchain is based on one from Linaro. + endif # BR2_TOOLCHAIN_EXTERNAL_CUSTOM config BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk index 34217c0..6706fbf 100644 --- a/toolchain/toolchain-external/toolchain-external.mk +++ b/toolchain/toolchain-external/toolchain-external.mk @@ -244,23 +244,16 @@ ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y) TOOLCHAIN_EXTERNAL_DEPENDENCIES += netbsd-queue endif -# The Linaro ARMhf toolchain expects the libraries in -# {/usr,}/lib/arm-linux-gnueabihf, but Buildroot copies them to +# Some toolchains, such as Linaro, expect the libraries in +# {/usr,}/lib/, but Buildroot copies them to # {/usr,}/lib, so we need to create a symbolic link. -define TOOLCHAIN_EXTERNAL_LINARO_ARMHF_SYMLINK - ln -snf . $(TARGET_DIR)/lib/arm-linux-gnueabihf - ln -snf . $(TARGET_DIR)/usr/lib/arm-linux-gnueabihf -endef - -define TOOLCHAIN_EXTERNAL_LINARO_ARMEBHF_SYMLINK - ln -snf . $(TARGET_DIR)/lib/armeb-linux-gnueabihf - ln -snf . $(TARGET_DIR)/usr/lib/armeb-linux-gnueabihf -endef - -define TOOLCHAIN_EXTERNAL_LINARO_AARCH64_SYMLINK - ln -snf . $(TARGET_DIR)/lib/aarch64-linux-gnu - ln -snf . $(TARGET_DIR)/usr/lib/aarch64-linux-gnu +ifeq ($(BR2_TOOLCHAIN_EXTERNAL_NEEDS_PREFIX_SYMLINK),y) +define TOOLCHAIN_EXTERNAL_PREFIX_SYMLINK + ln -snf . $(TARGET_DIR)/lib/$(TOOLCHAIN_EXTERNAL_PREFIX) + ln -snf . $(TARGET_DIR)/usr/lib/$(TOOLCHAIN_EXTERNAL_PREFIX) endef +TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_PREFIX_SYMLINK +endif # Special fixup for Codescape MIPS toolchains, that have bin- and # sbin- directories. We create symlinks bin -> bin- and sbin @@ -318,7 +311,6 @@ ifeq ($(HOSTARCH),x86) TOOLCHAIN_EXTERNAL_SITE = https://releases.linaro.org/14.09/components/toolchain/binaries TOOLCHAIN_EXTERNAL_SOURCE = gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz TOOLCHAIN_EXTERNAL_ACTUAL_SOURCE_TARBALL = gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_src.tar.bz2 -TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_LINARO_ARMHF_SYMLINK else TOOLCHAIN_EXTERNAL_SITE = https://releases.linaro.org/components/toolchain/binaries/5.3-2016.02/arm-linux-gnueabihf TOOLCHAIN_EXTERNAL_SOURCE = gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz @@ -328,7 +320,6 @@ ifeq ($(HOSTARCH),x86) TOOLCHAIN_EXTERNAL_SITE = https://releases.linaro.org/14.09/components/toolchain/binaries TOOLCHAIN_EXTERNAL_SOURCE = gcc-linaro-armeb-linux-gnueabihf-4.9-2014.09_linux.tar.xz TOOLCHAIN_EXTERNAL_ACTUAL_SOURCE_TARBALL = gcc-linaro-armeb-linux-gnueabihf-4.9-2014.09_src.tar.bz2 -TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_LINARO_ARMEBHF_SYMLINK else TOOLCHAIN_EXTERNAL_SITE = https://releases.linaro.org/components/toolchain/binaries/5.3-2016.02/armeb-linux-gnueabihf TOOLCHAIN_EXTERNAL_SOURCE = gcc-linaro-5.3-2016.02-x86_64_armeb-linux-gnueabihf.tar.xz @@ -369,7 +360,6 @@ ifeq ($(HOSTARCH),x86) TOOLCHAIN_EXTERNAL_SITE = https://releases.linaro.org/14.09/components/toolchain/binaries TOOLCHAIN_EXTERNAL_SOURCE = gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux.tar.xz TOOLCHAIN_EXTERNAL_ACTUAL_SOURCE_TARBALL = gcc-linaro-aarch64-linux-gnu-4.9-2014.09_src.tar.bz2 -TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_LINARO_AARCH64_SYMLINK else TOOLCHAIN_EXTERNAL_SITE = https://releases.linaro.org/components/toolchain/binaries/5.3-2016.02/aarch64-linux-gnu TOOLCHAIN_EXTERNAL_SOURCE = gcc-linaro-5.3-2016.02-x86_64_aarch64-linux-gnu.tar.xz