toolchain: expose BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS for all toolchain types

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 <mmayer@broadcom.com>
Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
This commit is contained in:
Matt Weber 2019-10-27 15:59:02 -05:00 committed by Arnout Vandecappelle (Essensium/Mind)
parent d4773b610a
commit 25a5b9665d
5 changed files with 28 additions and 9 deletions

View File

@ -146,6 +146,17 @@ endif
comment "Legacy options removed in 2019.11"
config BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS
string "toolchain-external extra libs option has been renamed"
help
The option BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS has
been renamed to BR2_TOOLCHAIN_EXTRA_LIBS.
config BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS_WRAP
bool
default y if BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS != ""
select BR2_LEGACY
config BR2_PACKAGE_PYTHON_PYSNMP_APPS
bool "python-pysnmp-apps was removed"
select BR2_LEGACY

View File

@ -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 \

View File

@ -221,6 +221,20 @@ 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"
default BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS if BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS != "" # legacy
depends on !BR2_STATIC_LIBS
help
If your toolchain provides extra libraries that need to be
copied to the target filesystem, enter them here, separated
by spaces. The library should not include a suffix or any
type of pre/post wildcard.
Examples where this can be useful is for adding debug
libraries to the target like the GCC libsanitizer.
e.g. "libasan liblsan libtsan libubsan"
# 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)

View File

@ -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 += $(addsuffix .so*,$(call qstrip,$(BR2_TOOLCHAIN_EXTRA_LIBS)))
#

View File

@ -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