From patchwork Sun Oct 27 13:49:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Weber X-Patchwork-Id: 1185012 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rockwellcollins.com Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 471K3R4Nkmz9sCJ for ; Mon, 28 Oct 2019 00:49:55 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 0B05B8710D; Sun, 27 Oct 2019 13:49:53 +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 4R56zEBEQFbc; Sun, 27 Oct 2019 13:49:51 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 239CA8709D; Sun, 27 Oct 2019 13:49:51 +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 C3CF11BF3E9 for ; Sun, 27 Oct 2019 13:49:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id B984F2037E for ; Sun, 27 Oct 2019 13:49:49 +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 0PbNB0Ar3h1C for ; Sun, 27 Oct 2019 13:49:48 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ch3vs02.rockwellcollins.com (ch3vs02.rockwellcollins.com [205.175.226.29]) by silver.osuosl.org (Postfix) with ESMTPS id 4C98820130 for ; Sun, 27 Oct 2019 13:49:48 +0000 (UTC) IronPort-SDR: vkA5SEKA2woweajpfJ0LHR1mPMHEazyazjscGK8FY7CZlDM2+KCy3jwpCW9QtipZZHnZioNTx6 2eG3MEDQnv/cnjYycMNPwo70mIynBpLYJ53eJAS7utgBwLBfecQ5lnyE25CIpN9YA7FF00ACP4 EeINHM5c4/KWe9Pd22yVGKoMTNTFSpxCkEBahUYpNequtBQgtEy/z43dJxetjvPpJzegcfiigS 3sasjFAWW2+LkM1hV8+o02QOWQfFSe68GWAD/mLA7Kq353G5An5fThlKkDrLDAO8FuVc52DRrq p0I= Received: from ofwch3n02.rockwellcollins.com (HELO dtulimr02.rockwellcollins.com) ([205.175.226.14]) by ch3vs02.rockwellcollins.com with ESMTP; 27 Oct 2019 08:49:47 -0500 X-Received: from biscuits.rockwellcollins.lab (biscuits.rockwellcollins.lab [10.148.119.137]) by dtulimr02.rockwellcollins.com (Postfix) with ESMTP id 352122020B; Sun, 27 Oct 2019 08:49:47 -0500 (CDT) From: Matt Weber To: buildroot@buildroot.org Date: Sun, 27 Oct 2019 08:49:46 -0500 Message-Id: <20191027134946.11701-1-matthew.weber@rockwellcollins.com> X-Mailer: git-send-email 2.17.1 Subject: [Buildroot] [PATCH] toolchain: expose BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS for all toolchain types X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 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" This patch extends the "copy extra GCC libraries to target" feature to also work for internal toolchains. The variable has been renamed to be BR2_TOOLCHAIN_EXTRA_LIBS and the configuration option moved under the generic toolchain package. For external toolchains, the step that does the copy is still in the copy_toolchain_lib_root() helper which copies from the sysroot to the target. For the internal toolchain, the host gcc-final package does a post install hook to copy the libraries from the toolchain build folders to both the sysroot and target(!static). Examples where this can be useful is for adding debug libraries to the target like the GCC libsanitizer (libasan/liblsan/...). Cc: Markus Mayer Signed-off-by: Matthew Weber --- Note: this generic extra library copy is proposed as an alternative to http://patchwork.ozlabs.org/patch/1110787/ --- package/gcc/gcc-final/gcc-final.mk | 2 ++ toolchain/Config.in | 12 ++++++++++++ .../toolchain-external/pkg-toolchain-external.mk | 2 +- .../toolchain-external-custom/Config.in.options | 8 -------- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk index 30fb87856c..24d034b720 100644 --- a/package/gcc/gcc-final/gcc-final.mk +++ b/package/gcc/gcc-final/gcc-final.mk @@ -187,6 +187,8 @@ ifeq ($(BR2_GCC_ENABLE_OPENMP),y) HOST_GCC_FINAL_USR_LIBS += libgomp endif +HOST_GCC_FINAL_USR_LIBS += $(call qstrip,$(BR2_TOOLCHAIN_EXTRA_LIBS)) + ifneq ($(HOST_GCC_FINAL_USR_LIBS),) define HOST_GCC_FINAL_INSTALL_STATIC_LIBS for i in $(HOST_GCC_FINAL_USR_LIBS) ; do \ diff --git a/toolchain/Config.in b/toolchain/Config.in index c9aa95985f..29289d22a6 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -221,6 +221,18 @@ config BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_LIST Note: the full set of gconv libs are ~8MiB (on ARM). +config BR2_TOOLCHAIN_EXTRA_LIBS + string "Extra toolchain libraries to be copied to target" + help + If your toolchain provides extra libraries that need to be + copied to the target filesystem, enter them here, separated + by spaces. + + NOTE: The library name should not include a suffix or wildcard. + + Examples where this can be useful is for adding debug libraries + to the target like the GCC libsanitizer (libasan/liblsan/...). + # This boolean is true if the toolchain provides a built-in full # featured gettext implementation (glibc), and false if only a stub # gettext implementation is provided (uclibc, musl) diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk index 5147da0104..e339773a96 100644 --- a/toolchain/toolchain-external/pkg-toolchain-external.mk +++ b/toolchain/toolchain-external/pkg-toolchain-external.mk @@ -156,7 +156,7 @@ ifeq ($(BR2_TOOLCHAIN_HAS_DLANG),y) TOOLCHAIN_EXTERNAL_LIBS += libgdruntime.so* libgphobos.so* endif -TOOLCHAIN_EXTERNAL_LIBS += $(call qstrip,$(BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS)) +TOOLCHAIN_EXTERNAL_LIBS += $(call qstrip,$(BR2_TOOLCHAIN_EXTRA_LIBS)) # diff --git a/toolchain/toolchain-external/toolchain-external-custom/Config.in.options b/toolchain/toolchain-external/toolchain-external-custom/Config.in.options index a36747f490..fd95f8201b 100644 --- a/toolchain/toolchain-external/toolchain-external-custom/Config.in.options +++ b/toolchain/toolchain-external/toolchain-external-custom/Config.in.options @@ -438,12 +438,4 @@ config BR2_TOOLCHAIN_EXTERNAL_OPENMP support. If you don't know, leave the default value, Buildroot will tell you if it's correct or not. -config BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS - string "Extra toolchain libraries to be copied to target" - help - If your external toolchain provides extra libraries that - need to be copied to the target filesystem, enter them - here, separated by spaces. They will be copied to the - target's /lib directory. - endif