From patchwork Fri Feb 16 00:56:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Mayer X-Patchwork-Id: 874245 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.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zjFKm15jkz9t5n for ; Fri, 16 Feb 2018 12:04:44 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0C2138957F; Fri, 16 Feb 2018 01:04:42 +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 xEuBXCiL7GUJ; Fri, 16 Feb 2018 01:04:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id E77F988FE7; Fri, 16 Feb 2018 01:04:40 +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 E2A821C0AD8 for ; Fri, 16 Feb 2018 01:04:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id DEDE188FE7 for ; Fri, 16 Feb 2018 01:04:39 +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 1KzuXzlOdmRx for ; Fri, 16 Feb 2018 01:04:39 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) by whitealder.osuosl.org (Postfix) with ESMTPS id 4FA6988810 for ; Fri, 16 Feb 2018 01:04:39 +0000 (UTC) Received: from triton.mmayer.net ([96.48.174.102]) by shaw.ca with ESMTP id mUKFengEyJZWxmUKGeJOf6; Thu, 15 Feb 2018 17:56:32 -0700 X-Authority-Analysis: v=2.3 cv=D6Jp1MZj c=1 sm=1 tr=0 a=IfKG9KDHjPrX0SZ8gMoyrg==:117 a=IfKG9KDHjPrX0SZ8gMoyrg==:17 a=Op4juWPpsa0A:10 a=Q-fNiiVtAAAA:8 a=6otiWbpBAhokGPIsjdAA:9 a=Fp8MccfUoT0GBdDC_Lng:22 Received: by triton.mmayer.net (Postfix, from userid 501) id 6ECA92025E4B6C; Thu, 15 Feb 2018 16:56:31 -0800 (PST) From: Markus Mayer To: buildroot@buildroot.org Date: Thu, 15 Feb 2018 16:56:07 -0800 Message-Id: <20180216005612.69593-2-mmayer@broadcom.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180216005612.69593-1-mmayer@broadcom.com> References: <20180216005612.69593-1-mmayer@broadcom.com> X-CMAE-Envelope: MS4wfLk4UGW3AN9HZ9HJ6hwRODGKWi8lzLkFJ3BnZMsiqgQG52KrUzWZigiCbelenAc9hWDDxMoCqbUkB6GRV1kZfXcVnQo/vOU0XdFNoVGqFxkY9U+ovLBH SpcIkMRyeZXJY6YJGB1jilec4YuKyM+pHlAyeQOd5VOS2Et9CNAgeaY7Q1W/1GVtbptjeS8eH0OQumJoiLVFSq6jxun33J7zFFs= Subject: [Buildroot] [RFC 1/6] support/scripts/check-bin-arch: improve architecture check 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: Markus Mayer MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" On 64-bit targets, allow 32-bit binaries of the same architecture (MIPS64 -> MIPS32, AArch64 -> ARM, etc.) In order for 32-bit binaries to run on the target, the corresponding 32-bit libraries need to be present in the target's root file system and the kernel needs to support execution of 32-bit binaries. Signed-off-by: Markus Mayer --- support/scripts/check-bin-arch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/support/scripts/check-bin-arch b/support/scripts/check-bin-arch index 887b6613cdb8..31711769eabd 100755 --- a/support/scripts/check-bin-arch +++ b/support/scripts/check-bin-arch @@ -58,6 +58,21 @@ while read f; do continue fi + # Didn't find a straight match. See if we are on a 64-bit architecture + # and our binary is a 32-bit binary of the same architecture. + if [[ "${arch_name}" =~ 64$ ]]; then + if [[ ${arch_name} = "AArch64" ]]; then + arch32='ARM' + else + arch32=${arch_name/64/32} + fi + + if [ "${arch}" = "${arch32}" ]; then + echo "Accepting ${arch32} binary on ${arch_name} ($f)" + continue + fi + fi + printf 'ERROR: architecture for "%s" is "%s", should be "%s"\n' \ "${f}" "${arch}" "${arch_name}" From patchwork Fri Feb 16 00:56:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Mayer X-Patchwork-Id: 874246 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=) 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 3zjFKx5bHyz9ryk for ; Fri, 16 Feb 2018 12:04:53 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 772F48730F; Fri, 16 Feb 2018 01:04:51 +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 i7WPo-yLvCGa; Fri, 16 Feb 2018 01:04:50 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id D634E87398; Fri, 16 Feb 2018 01:04:50 +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 2D1251C0AD8 for ; Fri, 16 Feb 2018 01:04:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 28DA9307CC for ; Fri, 16 Feb 2018 01:04:50 +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 xZBZCzahe-uU for ; Fri, 16 Feb 2018 01:04:49 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) by silver.osuosl.org (Postfix) with ESMTPS id 4E46B30774 for ; Fri, 16 Feb 2018 01:04:49 +0000 (UTC) Received: from triton.mmayer.net ([96.48.174.102]) by shaw.ca with ESMTP id mUKOe4w5vppe1mUKPemnj5; Thu, 15 Feb 2018 17:56:41 -0700 X-Authority-Analysis: v=2.3 cv=Bo6zP7f5 c=1 sm=1 tr=0 a=IfKG9KDHjPrX0SZ8gMoyrg==:117 a=IfKG9KDHjPrX0SZ8gMoyrg==:17 a=Op4juWPpsa0A:10 a=Q-fNiiVtAAAA:8 a=Y0gsduMI-OLrY6WKg9kA:9 a=Fp8MccfUoT0GBdDC_Lng:22 Received: by triton.mmayer.net (Postfix, from userid 501) id 129D02025E4B73; Thu, 15 Feb 2018 16:56:40 -0800 (PST) From: Markus Mayer To: buildroot@buildroot.org Date: Thu, 15 Feb 2018 16:56:08 -0800 Message-Id: <20180216005612.69593-3-mmayer@broadcom.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180216005612.69593-1-mmayer@broadcom.com> References: <20180216005612.69593-1-mmayer@broadcom.com> X-CMAE-Envelope: MS4wfDVbpGpzSbDFU0EcLGp6LBE835+qKY1hh13B56I10LJRiu0UnxnYXtA0+NJoITxEmiH9DTJ1eeS8Yj9EcfZqOV7MXMn0wfLosyzrJjiyJsIu/V0c2Yak HYTcmu+1GYR00WU+G13RWyH6TAkHPa6Y3TXN4UTpm1B87jCnNIToag7YV6Z3VWGvFfpM04UMa6vOsfkq2002d7g5ncx7BKAWYOA= Subject: [Buildroot] [RFC 2/6] system/Config.in: add configuration options for 32-bit library support 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: Markus Mayer MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" In order to support 32-bit shared libraries in a 64-bit root file system, we need several configuration options that let us tell buildroot which libraries to put where. Specifically, we introduce the following: BR2_ROOTFS_LIB_DIR ------------------ Tells buildroot where to put the main system libraries. On 32-bit setups, this will mean 32-bit libraries. On 64-bit setups, this setting will apply to 64-bit libraries. Typical values for BR2_ROOTFS_LIB_DIR are "lib", "lib32" or "lib64". The default value for 32-bit setups is "lib". For 64-bit setups it is "lib64". BR2_ROOTFS_LIB32_DIR -------------------- This tells buildroot where to put 32-bit libraries on a 64-bit system. Typical values for BR2_ROOTFS_LIB32_DIR are "lib" or "lib32". The default value is "lib". On 32-bit setups, this variable is not available. On 64-bit systems with 32-bit support disabled, this variable will not be used. BR2_ROOTFS_RUNTIME32 -------------------- Tells buildroot whether it should install 32-bit shared libraries into a 64-bit root file system. If set to false, the root file system will not be able to support 32-bit binaries. This variable is not available on 32-bit setups. BR2_ROOTFS_RUNTIME32_PATH ------------------------- Points to the sys-root of a 32-bit toolchain for the current 64-bit architecture (i.e. an ARM sys-root on AArch64 or MIPS32 on MIPS64). This path is used to copy all 32-bit shared libraries from the 32-bit sys-root into the buildroot staging area. From there, they will be included into the root file system. Care is taken that 32-bit libraries will not interfere with 64-bit libraries already in staging. We need the ability to specify a separate sys-root for 32-bit, because the 64-bit sys-root may not include 32-bit libraries. This variable is not available on 32-bit setups. Signed-off-by: Markus Mayer --- system/Config.in | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/system/Config.in b/system/Config.in index d48cf8d8c4ed..1e9415ae6f6d 100644 --- a/system/Config.in +++ b/system/Config.in @@ -24,6 +24,40 @@ config BR2_ROOTFS_SKELETON_CUSTOM endchoice +config BR2_ROOTFS_LIB_DIR + string "Name of system library directories (e.g. lib or lib64)" + default "lib64" if BR2_ARCH_IS_64 + default "lib" + help + The name of the directories where system libraries live. This will + most often be "lib", "lib32" or "lib64". This name will be used in + the root directory (e.g. /lib64) as well as the /usr directory (e.g. + /usr/lib64). + +if BR2_ARCH_IS_64 + +config BR2_ROOTFS_LIB32_DIR + string "Name of directory for 32-bit libraries (e.g. lib or lib32)" + default "lib" + help + The name of the directories where 32-bit libraries live. This will + most often be "lib" or "lib32". This name will be used in the root + directory (e.g. /lib) as well as the /usr directory (e.g. /usr/lib). + +config BR2_ROOTFS_RUNTIME32 + bool "Install 32-bit runtime on 64-bit system" + help + Install 32-bit libraries and the 32-bit shared library loader on a + 64-bit system, so it is possible to execute 32-bit applications. + +config BR2_ROOTFS_RUNTIME32_PATH + string "Path to the 32-bit run-time" + help + Specifies the path to the 32-bit run-time that should be copied into + the root file system. + +endif + if BR2_ROOTFS_SKELETON_CUSTOM config BR2_ROOTFS_SKELETON_CUSTOM_PATH From patchwork Fri Feb 16 00:56:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Mayer X-Patchwork-Id: 874247 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=) 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 3zjFL666RGz9ryk for ; Fri, 16 Feb 2018 12:05:02 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4B4E687453; Fri, 16 Feb 2018 01:05:01 +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 vkTKEKbJYFb9; Fri, 16 Feb 2018 01:05:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id AD9B4877F3; Fri, 16 Feb 2018 01:05:00 +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 C4EEF1C0AD8 for ; Fri, 16 Feb 2018 01:04:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id C0BE8307CC for ; Fri, 16 Feb 2018 01:04:59 +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 ZPrvlEJxCGy3 for ; Fri, 16 Feb 2018 01:04:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) by silver.osuosl.org (Postfix) with ESMTPS id 0A5D330774 for ; Fri, 16 Feb 2018 01:04:59 +0000 (UTC) Received: from triton.mmayer.net ([96.48.174.102]) by shaw.ca with ESMTP id mUKWe4w8mppe1mUKZemnkk; Thu, 15 Feb 2018 17:56:51 -0700 X-Authority-Analysis: v=2.3 cv=Bo6zP7f5 c=1 sm=1 tr=0 a=IfKG9KDHjPrX0SZ8gMoyrg==:117 a=IfKG9KDHjPrX0SZ8gMoyrg==:17 a=Op4juWPpsa0A:10 a=Q-fNiiVtAAAA:8 a=mHJtBT_O1KTNUE6Zx1UA:9 a=Fp8MccfUoT0GBdDC_Lng:22 Received: by triton.mmayer.net (Postfix, from userid 501) id 822612025E4B7C; Thu, 15 Feb 2018 16:56:48 -0800 (PST) From: Markus Mayer To: buildroot@buildroot.org Date: Thu, 15 Feb 2018 16:56:09 -0800 Message-Id: <20180216005612.69593-4-mmayer@broadcom.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180216005612.69593-1-mmayer@broadcom.com> References: <20180216005612.69593-1-mmayer@broadcom.com> X-CMAE-Envelope: MS4wfHoYRvmcX0c356uqqZTWcVI+0n3vuaYHc+oPXhlarwDEYFM20GUBOKnovguL4S37hMVDxhHbNSUhsZnjZklxwsB6UO/Bd/Ivj9oRER1wWYNCEWGNIybu brDZSqtVpJWriwXecDvTKKfUGrh0HvcF3hV5l8cq0vOeD0Bvlu21NfY0ubvoFl6pBfUzjjwMP2kg1zQ4l0eaPJBScr+lRuNAaGY= Subject: [Buildroot] [RFC 3/6] core: system and toolchain: 32-bit run-time support on 64-bit platform 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: Markus Mayer MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Set up library symlinks only if we don't want to support 32-bit libraries on 64-bit platforms. We cannot set up sym-links such as "lib64" -> "lib" if we want to support 32-bit binaries on a 64-bit platform. Instead, we need to keep 32-bit and 64-bit libraries in separate directories, so we must skip generating sym-links that would prevent this. Signed-off-by: Markus Mayer --- system/system.mk | 11 ++++++++++- toolchain/toolchain-external/pkg-toolchain-external.mk | 6 ++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/system/system.mk b/system/system.mk index ca6bf1388f39..e0d45356fe66 100644 --- a/system/system.mk +++ b/system/system.mk @@ -55,6 +55,14 @@ define SYSTEM_RSYNC $(1)/ $(2)/ endef +ifeq ($(BR2_ROOTFS_RUNTIME32),y) + +define SYSTEM_LIB_SYMLINK + @echo "SYSTEM_LIB_SYMLINK: nothing to do" +endef + +else + # Make a symlink lib32->lib or lib64->lib as appropriate. # MIPS64/n32 requires lib32 even though it's a 64-bit arch. # $(1): base dir (either staging or target) @@ -68,7 +76,8 @@ define SYSTEM_LIB_SYMLINK ln -snf lib $(1)/lib32 ln -snf lib $(1)/usr/lib32 endef -endif +endif # BR2_ARCH_IS_64 +endif # BR2_ROOTFS_RUNTIME32 SYSTEM_GETTY_PORT = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)) SYSTEM_GETTY_BAUDRATE = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE)) diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk index 3bf9fac4121c..d7cf97d170ca 100644 --- a/toolchain/toolchain-external/pkg-toolchain-external.mk +++ b/toolchain/toolchain-external/pkg-toolchain-external.mk @@ -448,6 +448,7 @@ define TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS $(call copy_toolchain_sysroot,$${SYSROOT_DIR},$${ARCH_SYSROOT_DIR},$${ARCH_SUBDIR},$${ARCH_LIB_DIR},$${SUPPORT_LIB_DIR}) endef +ifeq ($(BR2_ROOTFS_RUNTIME32),) # Create a symlink from (usr/)$(ARCH_LIB_DIR) to lib. # Note: the skeleton package additionally creates lib32->lib or lib64->lib # (as appropriate) @@ -462,6 +463,11 @@ create_lib_symlinks = \ ln -snf $${relpath}lib "$${DESTDIR}/usr/$${ARCH_LIB_DIR}" ; \ fi +else +create_lib_symlinks = \ + @echo "BR2_ROOTFS_RUNTIME32 is set, skipping lib symlinks creation" +endif + define TOOLCHAIN_EXTERNAL_CREATE_STAGING_LIB_SYMLINK $(call create_lib_symlinks,$(STAGING_DIR)) endef From patchwork Fri Feb 16 00:56:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Mayer X-Patchwork-Id: 874241 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=) 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 3zjFGP52JCz9t3G for ; Fri, 16 Feb 2018 12:01:48 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0DD3B88B0C; Fri, 16 Feb 2018 01:01:46 +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 yxrO1sm-QDXm; Fri, 16 Feb 2018 01:01:45 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 742AE88B00; Fri, 16 Feb 2018 01:01:45 +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 5596B1C25D2 for ; Fri, 16 Feb 2018 01:01:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 51D7886AE6 for ; Fri, 16 Feb 2018 01:01:44 +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 uP1zX+hmpHv9 for ; Fri, 16 Feb 2018 01:01:43 +0000 (UTC) X-Greylist: delayed 00:05:01 by SQLgrey-1.7.6 Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) by hemlock.osuosl.org (Postfix) with ESMTPS id 4C07186CCE for ; Fri, 16 Feb 2018 01:01:43 +0000 (UTC) Received: from triton.mmayer.net ([96.48.174.102]) by shaw.ca with ESMTP id mUKee4wCDppe1mUKfemnlz; Thu, 15 Feb 2018 17:56:58 -0700 X-Authority-Analysis: v=2.3 cv=Bo6zP7f5 c=1 sm=1 tr=0 a=IfKG9KDHjPrX0SZ8gMoyrg==:117 a=IfKG9KDHjPrX0SZ8gMoyrg==:17 a=Op4juWPpsa0A:10 a=Q-fNiiVtAAAA:8 a=WCprPTpFbenn5dj9npAA:9 a=Fp8MccfUoT0GBdDC_Lng:22 Received: by triton.mmayer.net (Postfix, from userid 501) id 907752025E4B7F; Thu, 15 Feb 2018 16:56:56 -0800 (PST) From: Markus Mayer To: buildroot@buildroot.org Date: Thu, 15 Feb 2018 16:56:10 -0800 Message-Id: <20180216005612.69593-5-mmayer@broadcom.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180216005612.69593-1-mmayer@broadcom.com> References: <20180216005612.69593-1-mmayer@broadcom.com> X-CMAE-Envelope: MS4wfE7zqbVDxTexJrT/mVjJsH4qlqDX4g9GMWV79EW8XUePiPI59KNZJyoQ1PmoPqly+wU8aHjJwcQe2LzvnBzatvKXLT0BlUuyxj1NOKfX68XLZUb94SUx OOx8ySnd1Fsa0tdGEpqep+PdeR4dRIDx99nHGCNeJ0paQJA8e+8vJaPE9RJ1+gzBpHnUxSshdejA704Iy+3nRx7zrnWL6hpeAFU= Subject: [Buildroot] [RFC 4/6] core/pkg-toolchain-external: copy external 32-bit libraries to staging 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: Markus Mayer MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" We use rsync to copy the 32-bit libraries from the 32-bit sysroot into staging. Signed-off-by: Markus Mayer --- toolchain/toolchain-external/pkg-toolchain-external.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk index d7cf97d170ca..0c5cd4b9f6d7 100644 --- a/toolchain/toolchain-external/pkg-toolchain-external.mk +++ b/toolchain/toolchain-external/pkg-toolchain-external.mk @@ -445,7 +445,12 @@ define TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS ARCH_SUBDIR=`echo $${ARCH_SYSROOT_DIR} | sed -r -e "s:^$${SYSROOT_DIR}(.*)/$$:\1:"` ; \ fi ; \ $(call MESSAGE,"Copying external toolchain sysroot to staging...") ; \ - $(call copy_toolchain_sysroot,$${SYSROOT_DIR},$${ARCH_SYSROOT_DIR},$${ARCH_SUBDIR},$${ARCH_LIB_DIR},$${SUPPORT_LIB_DIR}) + $(call copy_toolchain_sysroot,$${SYSROOT_DIR},$${ARCH_SYSROOT_DIR},$${ARCH_SUBDIR},$${ARCH_LIB_DIR},$${SUPPORT_LIB_DIR}); \ + if [ "$(BR2_ROOTFS_RUNTIME32)" = "y" ]; then \ + $(call MESSAGE,"Copying external toolchain 32-bit libraries to staging...") ; \ + mkdir -p "$${STAGING_DIR}/$(BR2_ROOTFS_LIB32_DIR)"; \ + rsync -a --exclude '*.a' "$(BR2_ROOTFS_RUNTIME32_PATH)/$(BR2_ROOTFS_LIB32_DIR)" "$${STAGING_DIR}"; \ + fi endef ifeq ($(BR2_ROOTFS_RUNTIME32),) From patchwork Fri Feb 16 00:56:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Mayer X-Patchwork-Id: 874242 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=) 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 3zjFGX2NdSz9t3G for ; Fri, 16 Feb 2018 12:01:56 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id C069288B3F; Fri, 16 Feb 2018 01:01:54 +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 9OIajsVHBdR9; Fri, 16 Feb 2018 01:01:54 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2A49A88B00; Fri, 16 Feb 2018 01:01:54 +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 166D61C25D2 for ; Fri, 16 Feb 2018 01:01:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 136D389087 for ; Fri, 16 Feb 2018 01:01:52 +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 IyzC+K9I5FHV for ; Fri, 16 Feb 2018 01:01:51 +0000 (UTC) X-Greylist: delayed 00:05:27 by SQLgrey-1.7.6 Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) by whitealder.osuosl.org (Postfix) with ESMTPS id 5163B8903E for ; Fri, 16 Feb 2018 01:01:51 +0000 (UTC) Received: from triton.mmayer.net ([96.48.174.102]) by shaw.ca with ESMTP id mUKmengVxJZWxmUKneJOlL; Thu, 15 Feb 2018 17:57:06 -0700 X-Authority-Analysis: v=2.3 cv=D6Jp1MZj c=1 sm=1 tr=0 a=IfKG9KDHjPrX0SZ8gMoyrg==:117 a=IfKG9KDHjPrX0SZ8gMoyrg==:17 a=Op4juWPpsa0A:10 a=Q-fNiiVtAAAA:8 a=gqbErFBLv9MTW4m7zPUA:9 a=Fp8MccfUoT0GBdDC_Lng:22 Received: by triton.mmayer.net (Postfix, from userid 501) id 9B80D2025E4B82; Thu, 15 Feb 2018 16:57:04 -0800 (PST) From: Markus Mayer To: buildroot@buildroot.org Date: Thu, 15 Feb 2018 16:56:11 -0800 Message-Id: <20180216005612.69593-6-mmayer@broadcom.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180216005612.69593-1-mmayer@broadcom.com> References: <20180216005612.69593-1-mmayer@broadcom.com> X-CMAE-Envelope: MS4wfJGO4/Err6Bou1DrXCsFbYbA79/n1rEepYtVODpf0NQEC9BFQpGam8zK0wMxyZqYMExo3gb0qprXNhPCPietIoUU3jGC2Z1kcjGQFDF6ywcVoQfUjONb 4x594XCSKwGgU7YNJNicTwC+2VfqnUyg339lx9mc/lODAJpXdGef5tUumqiItT2Ke6LlDKniMMTemEa4hyAC0rLXDByP6GLL4RU= Subject: [Buildroot] [RFC 5/6] bzip2: introduce make variable $(LIBDIR) 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: Markus Mayer MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" In order to allow us to install libz2 into a location other than /usr/lib, we introduce a variable called $(LIBDIR) that can be set by the build system to an alternate location. $(LIBDIR) defaults to /usr/lib, so the behaviour doesn't change if $(LIBDIR) is never set. Signed-off-by: Markus Mayer --- package/bzip2/0003-add-libdir-to-makefile.patch | 36 ++++++++++++++++++++++ .../bzip2/0004-add-libdir-to-makefile-libbz2.patch | 31 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 package/bzip2/0003-add-libdir-to-makefile.patch create mode 100644 package/bzip2/0004-add-libdir-to-makefile-libbz2.patch diff --git a/package/bzip2/0003-add-libdir-to-makefile.patch b/package/bzip2/0003-add-libdir-to-makefile.patch new file mode 100644 index 000000000000..8a724484bd1e --- /dev/null +++ b/package/bzip2/0003-add-libdir-to-makefile.patch @@ -0,0 +1,36 @@ +Introduce $(LIBDIR) to Makefile + +The variable $(LIBDIR) allows us to override where libbz2 is installed. + +Index: bzip2-1.0.6/Makefile +=================================================================== +--- bzip2-1.0.6.orig/Makefile 2010-09-10 15:46:02.000000000 -0700 ++++ bzip2-1.0.6/Makefile 2017-11-23 12:51:53.318896836 -0800 +@@ -19,6 +19,7 @@ + AR=ar + RANLIB=ranlib + LDFLAGS= ++LIBDIR ?= lib + + override CFLAGS += -Wall + +@@ -71,7 +73,7 @@ + + install: bzip2 bzip2recover + if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi +- if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi ++ if ( test ! -d $(PREFIX)/$(LIBDIR) ) ; then mkdir -p $(PREFIX)/$(LIBDIR) ; fi + if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi + if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi + if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi +@@ -87,8 +89,8 @@ + chmod a+r $(PREFIX)/man/man1/bzip2.1 + cp -f bzlib.h $(PREFIX)/include + chmod a+r $(PREFIX)/include/bzlib.h +- cp -f libbz2.a $(PREFIX)/lib +- chmod a+r $(PREFIX)/lib/libbz2.a ++ cp -f libbz2.a $(PREFIX)/$(LIBDIR) ++ chmod a+r $(PREFIX)/$(LIBDIR)/libbz2.a + cp -f bzgrep $(PREFIX)/bin/bzgrep + ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep + ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep diff --git a/package/bzip2/0004-add-libdir-to-makefile-libbz2.patch b/package/bzip2/0004-add-libdir-to-makefile-libbz2.patch new file mode 100644 index 000000000000..9b2f6b114fc6 --- /dev/null +++ b/package/bzip2/0004-add-libdir-to-makefile-libbz2.patch @@ -0,0 +1,31 @@ +Introduce $(LIBDIR) to Makefile-libbz2_so + +The variable $(LIBDIR) allows us to override where libbz2 is installed. + +Index: bzip2-1.0.6/Makefile +=================================================================== +--- bzip2-1.0.6/Makefile-libbz2_so.orig 2017-11-23 11:08:33.067637637 -0800 ++++ bzip2-1.0.6/Makefile-libbz2_so 2017-11-23 12:51:38.694728036 -0800 +@@ -23,6 +23,9 @@ + + SHELL=/bin/sh + CC=gcc ++ ++LIBDIR ?= lib ++ + override CFLAGS += -fpic -fPIC -Wall + + OBJS= blocksort.sho \ +@@ -38,9 +41,9 @@ + $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6 + + install: +- install -m 0755 -D libbz2.so.1.0.6 $(PREFIX)/lib/libbz2.so.1.0.6 +- ln -sf libbz2.so.1.0.6 $(PREFIX)/lib/libbz2.so +- ln -sf libbz2.so.1.0.6 $(PREFIX)/lib/libbz2.so.1.0 ++ install -m 0755 -D libbz2.so.1.0.6 $(PREFIX)/$(LIBDIR)/libbz2.so.1.0.6 ++ ln -sf libbz2.so.1.0.6 $(PREFIX)/$(LIBDIR)/libbz2.so ++ ln -sf libbz2.so.1.0.6 $(PREFIX)/$(LIBDIR)/libbz2.so.1.0 + + clean: + rm -f $(OBJS) bzip2.o libbz2.so.1.0.6 libbz2.so.1.0 bzip2-shared From patchwork Fri Feb 16 00:56:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Mayer X-Patchwork-Id: 874243 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.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zjFGk20cVz9t5R for ; Fri, 16 Feb 2018 12:02:05 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 88A7589580; Fri, 16 Feb 2018 01:02:02 +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 XOe2KI7dbB9q; Fri, 16 Feb 2018 01:02:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 4D7E689087; Fri, 16 Feb 2018 01:02:00 +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 B77011C25D2 for ; Fri, 16 Feb 2018 01:01:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B3FF48903E for ; Fri, 16 Feb 2018 01:01:59 +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 ew2tlRcWGTxQ for ; Fri, 16 Feb 2018 01:01:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) by whitealder.osuosl.org (Postfix) with ESMTPS id 0BD1B89087 for ; Fri, 16 Feb 2018 01:01:59 +0000 (UTC) Received: from triton.mmayer.net ([96.48.174.102]) by shaw.ca with ESMTP id mUKvengadJZWxmUKweJOnb; Thu, 15 Feb 2018 17:57:14 -0700 X-Authority-Analysis: v=2.3 cv=D6Jp1MZj c=1 sm=1 tr=0 a=IfKG9KDHjPrX0SZ8gMoyrg==:117 a=IfKG9KDHjPrX0SZ8gMoyrg==:17 a=Op4juWPpsa0A:10 a=Q-fNiiVtAAAA:8 a=GXWBbpyBEKo4-PA354wA:9 a=Fp8MccfUoT0GBdDC_Lng:22 Received: by triton.mmayer.net (Postfix, from userid 501) id 31D852025E4B86; Thu, 15 Feb 2018 16:57:13 -0800 (PST) From: Markus Mayer To: buildroot@buildroot.org Date: Thu, 15 Feb 2018 16:56:12 -0800 Message-Id: <20180216005612.69593-7-mmayer@broadcom.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180216005612.69593-1-mmayer@broadcom.com> References: <20180216005612.69593-1-mmayer@broadcom.com> X-CMAE-Envelope: MS4wfEH29XEKYFhXD8q4QWdcGXGG6S0bEoCPuVqWTvAH/sxqcX64d9mP+TnTgwz7E9RB9JqqFfE4I2cNrOVzDsJolmdD0p39b7eG/fsqSefLZFBPq9luLfRq jpjufg0wlnPtQSgiL6aKqfcrEYyf6mDmePpXls0QSRc4i/tzqj5foIP/zQZPB7Uggo2HKd8gY/hOgMUUPZzN38/hZnH/8r+ig8U= Subject: [Buildroot] [RFC 6/6] package: use BR2_ROOTFS_LIB_DIR for all libraries we use 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: Markus Mayer MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Make sure to pass $(BR2_ROOTFS_LIB_DIR) as the library directory name to all library packages we use. Autoconf packages are easy. They only require a single added line in pkg-autotools.mk. It is the generic packages not using autoconf that need to be tweaked individually. Signed-off-by: Markus Mayer --- package/bzip2/bzip2.mk | 4 +++- package/dmalloc/dmalloc.mk | 7 ++++--- package/e2fsprogs/e2fsprogs.mk | 2 ++ package/libzlib/libzlib.mk | 3 ++- package/linux-tools/linux-tool-cpupower.mk.in | 7 ++++++- package/pciutils/pciutils.mk | 2 ++ package/pkg-autotools.mk | 1 + package/readline/readline.mk | 2 +- 9 files changed, 23 insertions(+), 8 deletions(-) diff --git a/package/bzip2/bzip2.mk b/package/bzip2/bzip2.mk index e43533072b2d..67f0239944ca 100644 --- a/package/bzip2/bzip2.mk +++ b/package/bzip2/bzip2.mk @@ -39,6 +39,7 @@ endef ifeq ($(BR2_STATIC_LIBS),) define BZIP2_INSTALL_TARGET_SHARED_CMDS $(TARGET_MAKE_ENV) $(MAKE) \ + LIBDIR=$(TARGET_DIR)/usr/$(BR2_ROOTFS_LIB_DIR) \ -f Makefile-libbz2_so PREFIX=$(TARGET_DIR)/usr -C $(@D) install endef endif @@ -47,7 +48,8 @@ endif define BZIP2_INSTALL_TARGET_CMDS rm -f $(addprefix $(TARGET_DIR)/usr/bin/,bzip2 bunzip2 bzcat) $(TARGET_MAKE_ENV) $(MAKE) \ - PREFIX=$(TARGET_DIR)/usr -C $(@D) install + PREFIX=$(TARGET_DIR)/usr \ + LIBDIR=$(TARGET_DIR)/usr/$(BR2_ROOTFS_LIB_DIR) -C $(@D) install $(BZIP2_INSTALL_TARGET_SHARED_CMDS) endef diff --git a/package/dmalloc/dmalloc.mk b/package/dmalloc/dmalloc.mk index 6ebb44c5c068..d54950fec5a1 100644 --- a/package/dmalloc/dmalloc.mk +++ b/package/dmalloc/dmalloc.mk @@ -50,15 +50,16 @@ DMALLOC_POST_PATCH_HOOKS += DMALLOC_POST_PATCH define DMALLOC_INSTALL_STAGING_CMDS $(TARGET_MAKE_ENV) $(MAKE) includedir="$(STAGING_DIR)/usr/include" \ bindir="$(STAGING_DIR)/usr/bin" \ - libdir="$(STAGING_DIR)/usr/lib" \ - shlibdir="$(STAGING_DIR)/usr/lib" \ + libdir="$(STAGING_DIR)/usr/$(BR2_ROOTFS_LIB_DIR)" \ + shlibdir="$(STAGING_DIR)/usr/$(BR2_ROOTFS_LIB_DIR)" \ infodir="$(STAGING_DIR)/usr/share/info/" \ -C $(@D) install endef ifeq ($(BR2_STATIC_LIBS),) define DMALLOC_INSTALL_SHARED_LIB - cp -dpf $(STAGING_DIR)/usr/lib/libdmalloc*.so $(TARGET_DIR)/usr/lib + cp -dpf $(STAGING_DIR)/usr/$(BR2_ROOTFS_LIB_DIR)/libdmalloc*.so \ + $(TARGET_DIR)/usr/$(BR2_ROOTFS_LIB_DIR) endef endif diff --git a/package/e2fsprogs/e2fsprogs.mk b/package/e2fsprogs/e2fsprogs.mk index e77b10f26dae..5cf2445562c9 100644 --- a/package/e2fsprogs/e2fsprogs.mk +++ b/package/e2fsprogs/e2fsprogs.mk @@ -65,6 +65,8 @@ ifeq ($(BR2_nios2),y) E2FSPROGS_CONF_ENV += ac_cv_func_fallocate=no endif +E2FSPROGS_CONF_ENV += PKG_CONFIG_PATH="$(TARGET_DIR)/usr/$(BR2_ROOTFS_LIB_DIR)/pkgconfig" + # Some programs are built for the host, but use definitions guessed by # the configure script (i.e with the cross-compiler). Help them by # saying that is available on the host, which is needed diff --git a/package/libzlib/libzlib.mk b/package/libzlib/libzlib.mk index eea0c12f2209..7ef79bac21b7 100644 --- a/package/libzlib/libzlib.mk +++ b/package/libzlib/libzlib.mk @@ -31,6 +31,7 @@ define LIBZLIB_CONFIGURE_CMDS ./configure \ $(LIBZLIB_SHARED) \ --prefix=/usr \ + --libdir='$${exec_prefix}/$(BR2_ROOTFS_LIB_DIR)' \ ) endef @@ -65,7 +66,7 @@ endef # assembling the filesystem images anyway. ifeq ($(BR2_SHARED_LIBS),y) define LIBZLIB_RM_STATIC_STAGING - rm -f $(STAGING_DIR)/usr/lib/libz.a + rm -f $(STAGING_DIR)/usr/$(BR2_ROOTFS_LIB_DIR)/libz.a endef LIBZLIB_POST_INSTALL_STAGING_HOOKS += LIBZLIB_RM_STATIC_STAGING endif diff --git a/package/linux-tools/linux-tool-cpupower.mk.in b/package/linux-tools/linux-tool-cpupower.mk.in index 2a2d3e01dd5a..9a5a32efb2de 100644 --- a/package/linux-tools/linux-tool-cpupower.mk.in +++ b/package/linux-tools/linux-tool-cpupower.mk.in @@ -8,10 +8,13 @@ LINUX_TOOLS += cpupower CPUPOWER_DEPENDENCIES = pciutils $(TARGET_NLS_DEPENDENCIES) +CPUPOWER_LDFLAGS = -L$(TARGET_DIR)/usr/$(BR2_ROOTFS_LIB_DIR) +CPUPOWER_LDFLAGS += $(TARGET_NLS_LIBS) + CPUPOWER_MAKE_OPTS = CROSS=$(TARGET_CROSS) \ CPUFREQ_BENCH=false \ NLS=false \ - LDFLAGS=$(TARGET_NLS_LIBS) \ + LDFLAGS=$(CPUPOWER_LDFLAGS) \ DEBUG=false define CPUPOWER_BUILD_CMDS @@ -30,6 +33,7 @@ define CPUPOWER_INSTALL_STAGING_CMDS $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \ $(CPUPOWER_MAKE_OPTS) \ DESTDIR=$(STAGING_DIR) \ + libdir=/usr/$(BR2_ROOTFS_LIB_DIR) \ cpupower_install endef @@ -37,5 +41,6 @@ define CPUPOWER_INSTALL_TARGET_CMDS $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \ $(CPUPOWER_MAKE_OPTS) \ DESTDIR=$(TARGET_DIR) \ + libdir=/usr/$(BR2_ROOTFS_LIB_DIR) \ cpupower_install endef diff --git a/package/pciutils/pciutils.mk b/package/pciutils/pciutils.mk index 2dd5771f2193..775425c1d5a4 100644 --- a/package/pciutils/pciutils.mk +++ b/package/pciutils/pciutils.mk @@ -67,12 +67,14 @@ endef define PCIUTILS_INSTALL_TARGET_CMDS $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) $(PCIUTILS_MAKE_OPTS) \ PREFIX=$(TARGET_DIR)/usr SBINDIR=$(TARGET_DIR)/usr/bin \ + LIBDIR=$(TARGET_DIR)/usr/$(BR2_ROOTFS_LIB_DIR) \ install install-lib install-pcilib endef define PCIUTILS_INSTALL_STAGING_CMDS $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) $(PCIUTILS_MAKE_OPTS) \ PREFIX=$(STAGING_DIR)/usr SBINDIR=$(STAGING_DIR)/usr/bin \ + LIBDIR=$(TARGET_DIR)/usr/$(BR2_ROOTFS_LIB_DIR) \ install install-lib install-pcilib endef diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk index 45de99356f5f..95f423737074 100644 --- a/package/pkg-autotools.mk +++ b/package/pkg-autotools.mk @@ -189,6 +189,7 @@ define $(2)_CONFIGURE_CMDS --build=$$(GNU_HOST_NAME) \ --prefix=/usr \ --exec-prefix=/usr \ + --libdir='$$$${exec_prefix}/$(BR2_ROOTFS_LIB_DIR)' \ --sysconfdir=/etc \ --localstatedir=/var \ --program-prefix="" \ diff --git a/package/readline/readline.mk b/package/readline/readline.mk index cc5d4f29201e..decb88cfa73c 100644 --- a/package/readline/readline.mk +++ b/package/readline/readline.mk @@ -27,7 +27,7 @@ READLINE_POST_INSTALL_TARGET_HOOKS += READLINE_INSTALL_INPUTRC ifneq ($(BR2_STATIC_LIBS),y) # libraries get installed read only, so strip fails define READLINE_INSTALL_FIXUPS_SHARED - chmod +w $(addprefix $(TARGET_DIR)/usr/lib/,libhistory.so.* libreadline.so.*) + chmod +w $(addprefix $(TARGET_DIR)/usr/$(BR2_ROOTFS_LIB_DIR)/,libhistory.so.* libreadline.so.*) endef READLINE_POST_INSTALL_TARGET_HOOKS += READLINE_INSTALL_FIXUPS_SHARED endif