mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-19 16:40:46 -09:00
package/binutils: zlib is mandatory
As found out by Yann [1], binutils will use its bundled copy of zlib, whether it is already provided by the system or not, and unless explicitly told to use the system zlib with --with-system-zlib, which is available since version 2.21 and700d40ca16This will fix the following build failure with oprofile when compiling in a static configuration where zlib is not enabled: checking for bfd_openr in -lbfd... no checking for compress in -lz... no configure: error: libz library not found; required by libbfd As found out by Arnout [1], this fails infrequently because static is already pretty rare, but in addition zlib is almost always selected by some other package. Fixes: - http://autobuild.buildroot.org/results/0e1d16dfbb455a08db80ac5d35613908c3b4163f [1] https://patchwork.ozlabs.org/project/buildroot/patch/20211030214734.2154583-1-fontaine.fabrice@gmail.com/ Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> [yann.morin.1998@free.fr: - reword the explanations about the system zlib - extend the oprofile example with static and !zlib ] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> (cherry picked from commita3c1ba68f4) Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
committed by
Peter Korsgaard
parent
13398092df
commit
f1f1a0fd9b
@@ -2,6 +2,7 @@ config BR2_PACKAGE_BINUTILS
|
|||||||
bool "binutils"
|
bool "binutils"
|
||||||
depends on !BR2_nios2
|
depends on !BR2_nios2
|
||||||
depends on BR2_USE_WCHAR
|
depends on BR2_USE_WCHAR
|
||||||
|
select BR2_PACKAGE_ZLIB
|
||||||
help
|
help
|
||||||
Install binutils on the target
|
Install binutils on the target
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ BINUTILS_SITE ?= $(BR2_GNU_MIRROR)/binutils
|
|||||||
BINUTILS_SOURCE ?= binutils-$(BINUTILS_VERSION).tar.xz
|
BINUTILS_SOURCE ?= binutils-$(BINUTILS_VERSION).tar.xz
|
||||||
BINUTILS_EXTRA_CONFIG_OPTIONS = $(call qstrip,$(BR2_BINUTILS_EXTRA_CONFIG_OPTIONS))
|
BINUTILS_EXTRA_CONFIG_OPTIONS = $(call qstrip,$(BR2_BINUTILS_EXTRA_CONFIG_OPTIONS))
|
||||||
BINUTILS_INSTALL_STAGING = YES
|
BINUTILS_INSTALL_STAGING = YES
|
||||||
BINUTILS_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES)
|
BINUTILS_DEPENDENCIES = zlib $(TARGET_NLS_DEPENDENCIES)
|
||||||
BINUTILS_MAKE_OPTS = LIBS=$(TARGET_NLS_LIBS)
|
BINUTILS_MAKE_OPTS = LIBS=$(TARGET_NLS_LIBS)
|
||||||
BINUTILS_LICENSE = GPL-3.0+, libiberty LGPL-2.1+
|
BINUTILS_LICENSE = GPL-3.0+, libiberty LGPL-2.1+
|
||||||
BINUTILS_LICENSE_FILES = COPYING3 COPYING.LIB
|
BINUTILS_LICENSE_FILES = COPYING3 COPYING.LIB
|
||||||
@@ -57,6 +57,7 @@ BINUTILS_CONF_OPTS = \
|
|||||||
--target=$(GNU_TARGET_NAME) \
|
--target=$(GNU_TARGET_NAME) \
|
||||||
--enable-install-libiberty \
|
--enable-install-libiberty \
|
||||||
--enable-build-warnings=no \
|
--enable-build-warnings=no \
|
||||||
|
--with-system-zlib \
|
||||||
$(BINUTILS_DISABLE_GDB_CONF_OPTS) \
|
$(BINUTILS_DISABLE_GDB_CONF_OPTS) \
|
||||||
$(BINUTILS_EXTRA_CONFIG_OPTIONS)
|
$(BINUTILS_EXTRA_CONFIG_OPTIONS)
|
||||||
|
|
||||||
@@ -80,10 +81,6 @@ ifeq ($(BR2_ARM_CPU_ARMV7M)$(BR2_OPTIMIZE_S),yy)
|
|||||||
BINUTILS_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -O2"
|
BINUTILS_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -O2"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(BR2_PACKAGE_ZLIB),y)
|
|
||||||
BINUTILS_DEPENDENCIES += zlib
|
|
||||||
endif
|
|
||||||
|
|
||||||
# "host" binutils should actually be "cross"
|
# "host" binutils should actually be "cross"
|
||||||
# We just keep the convention of "host utility" for now
|
# We just keep the convention of "host utility" for now
|
||||||
HOST_BINUTILS_CONF_OPTS = \
|
HOST_BINUTILS_CONF_OPTS = \
|
||||||
|
|||||||
Reference in New Issue
Block a user