2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2010-12-31 12:39:01 +01:00
|
|
|
#
|
|
|
|
# binutils
|
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2010-12-31 12:39:01 +01:00
|
|
|
|
2011-06-08 15:57:26 +02:00
|
|
|
# Version is set when using buildroot toolchain.
|
|
|
|
# If not, we do like other packages
|
2010-12-31 12:39:01 +01:00
|
|
|
BINUTILS_VERSION = $(call qstrip,$(BR2_BINUTILS_VERSION))
|
2011-06-08 15:57:26 +02:00
|
|
|
ifeq ($(BINUTILS_VERSION),)
|
2015-03-15 16:56:00 +01:00
|
|
|
ifeq ($(BR2_arc),y)
|
2016-11-14 18:56:37 +01:00
|
|
|
BINUTILS_VERSION = arc-2016.09-rc1
|
2015-03-15 16:56:00 +01:00
|
|
|
else
|
2016-03-10 23:34:58 +01:00
|
|
|
BINUTILS_VERSION = 2.25.1
|
2011-06-08 15:57:26 +02:00
|
|
|
endif
|
2015-03-15 16:56:00 +01:00
|
|
|
endif # BINUTILS_VERSION
|
2011-06-08 15:57:26 +02:00
|
|
|
|
2013-05-02 11:51:25 +02:00
|
|
|
ifeq ($(BR2_arc),y)
|
2014-08-21 19:33:56 +02:00
|
|
|
BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(BINUTILS_VERSION))
|
2013-12-05 18:20:52 +01:00
|
|
|
BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.gz
|
2013-12-05 18:20:58 +01:00
|
|
|
BINUTILS_FROM_GIT = y
|
2013-12-05 18:20:52 +01:00
|
|
|
endif
|
2013-12-05 18:20:48 +01:00
|
|
|
BINUTILS_SITE ?= $(BR2_GNU_MIRROR)/binutils
|
|
|
|
BINUTILS_SOURCE ?= binutils-$(BINUTILS_VERSION).tar.bz2
|
2010-12-31 12:39:01 +01:00
|
|
|
BINUTILS_EXTRA_CONFIG_OPTIONS = $(call qstrip,$(BR2_BINUTILS_EXTRA_CONFIG_OPTIONS))
|
|
|
|
BINUTILS_INSTALL_STAGING = YES
|
2012-09-16 14:57:49 +02:00
|
|
|
BINUTILS_DEPENDENCIES = $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext)
|
2012-11-13 02:05:38 +01:00
|
|
|
BINUTILS_LICENSE = GPLv3+, libiberty LGPLv2.1+
|
|
|
|
BINUTILS_LICENSE_FILES = COPYING3 COPYING.LIB
|
2010-12-31 12:39:01 +01:00
|
|
|
|
2013-12-05 18:20:58 +01:00
|
|
|
ifeq ($(BINUTILS_FROM_GIT),y)
|
2016-10-11 14:02:33 +02:00
|
|
|
BINUTILS_DEPENDENCIES += host-flex host-bison
|
|
|
|
HOST_BINUTILS_DEPENDENCIES += host-flex host-bison
|
2016-07-05 11:46:59 +02:00
|
|
|
endif
|
|
|
|
|
binutils, gdb: support unified binutils-gdb git repository
If Binutils and/or GDB are fetched from the unified binutils-gdb
repository, then the tarball will contain both Binutils and GDB
sources, unlike the "normal" tarballs that contain only the titular
package. To keep packages separated in Buildroot we need to disable
undesired components when configuring.
Binutils and GDB migrated to a common Git repository in the October
2013 [1]. Previous Git repositories were incomplete copies of CVS
repository which copied only the relevant files (no binutils files in
GDB, and vice versa). In the new binutils-gdb repository there is no
such separation and a result all files exist in directory after
checkout. So if "configure" and "make" are used without explicit
targets, all projects will be built: binutils, ld, gas, bfd, opcodes,
gdb, etc. In case of Buildroot this would mean that selecting Binutils
only, still will build both Binutils and GDB. And if GDB is selected
as well, then both packages will be built two times, and Binutils from
GDB directory will overwrite initial build of Binutils (or vice versa
if Binutils will be built after the GDB). This is a serious problem,
because binutils and GDB use separate branches in this common
repository. In case of Buildroot this means that separate Git commits
(or tags) should be used when downloading source from Git.
This affects only Git repositories, because GNU release tarballs still
contain only relevant packages.
This change is backward compatible, because if "normal" tarball is
used (without extra directories), than --disable-* configure options
are just ignored by configure.
[1] https://sourceware.org/ml/gdb/2013-10/msg00071.html
[Thomas: use variables to factorize options, and add comments in the
relevant .mk files to explain what's going on.]
Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-29 14:54:37 +02:00
|
|
|
# When binutils sources are fetched from the binutils-gdb repository,
|
|
|
|
# they also contain the gdb sources, but gdb shouldn't be built, so we
|
|
|
|
# disable it.
|
2014-09-27 21:32:44 +02:00
|
|
|
BINUTILS_DISABLE_GDB_CONF_OPTS = \
|
2014-12-24 08:54:24 +01:00
|
|
|
--disable-sim \
|
|
|
|
--disable-gdb
|
binutils, gdb: support unified binutils-gdb git repository
If Binutils and/or GDB are fetched from the unified binutils-gdb
repository, then the tarball will contain both Binutils and GDB
sources, unlike the "normal" tarballs that contain only the titular
package. To keep packages separated in Buildroot we need to disable
undesired components when configuring.
Binutils and GDB migrated to a common Git repository in the October
2013 [1]. Previous Git repositories were incomplete copies of CVS
repository which copied only the relevant files (no binutils files in
GDB, and vice versa). In the new binutils-gdb repository there is no
such separation and a result all files exist in directory after
checkout. So if "configure" and "make" are used without explicit
targets, all projects will be built: binutils, ld, gas, bfd, opcodes,
gdb, etc. In case of Buildroot this would mean that selecting Binutils
only, still will build both Binutils and GDB. And if GDB is selected
as well, then both packages will be built two times, and Binutils from
GDB directory will overwrite initial build of Binutils (or vice versa
if Binutils will be built after the GDB). This is a serious problem,
because binutils and GDB use separate branches in this common
repository. In case of Buildroot this means that separate Git commits
(or tags) should be used when downloading source from Git.
This affects only Git repositories, because GNU release tarballs still
contain only relevant packages.
This change is backward compatible, because if "normal" tarball is
used (without extra directories), than --disable-* configure options
are just ignored by configure.
[1] https://sourceware.org/ml/gdb/2013-10/msg00071.html
[Thomas: use variables to factorize options, and add comments in the
relevant .mk files to explain what's going on.]
Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-29 14:54:37 +02:00
|
|
|
|
2010-12-31 12:39:01 +01:00
|
|
|
# We need to specify host & target to avoid breaking ARM EABI
|
2014-12-24 08:54:24 +01:00
|
|
|
BINUTILS_CONF_OPTS = \
|
|
|
|
--disable-multilib \
|
|
|
|
--disable-werror \
|
|
|
|
--host=$(GNU_TARGET_NAME) \
|
|
|
|
--target=$(GNU_TARGET_NAME) \
|
|
|
|
--enable-install-libiberty \
|
2016-08-19 18:29:21 +02:00
|
|
|
--enable-build-warnings=no \
|
2014-12-24 08:54:24 +01:00
|
|
|
$(BINUTILS_DISABLE_GDB_CONF_OPTS) \
|
|
|
|
$(BINUTILS_EXTRA_CONFIG_OPTIONS)
|
2010-12-31 12:39:01 +01:00
|
|
|
|
2016-03-19 21:14:56 +01:00
|
|
|
ifeq ($(BR2_STATIC_LIBS),y)
|
|
|
|
BINUTILS_CONF_OPTS += --disable-plugins
|
|
|
|
endif
|
|
|
|
|
2014-06-30 19:02:37 +02:00
|
|
|
# Don't build documentation. It takes up extra space / build time,
|
|
|
|
# and sometimes needs specific makeinfo versions to work
|
2016-10-11 14:02:33 +02:00
|
|
|
BINUTILS_CONF_ENV += MAKEINFO=true
|
|
|
|
BINUTILS_MAKE_OPTS += MAKEINFO=true
|
|
|
|
BINUTILS_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MAKEINFO=true install
|
|
|
|
HOST_BINUTILS_CONF_ENV += MAKEINFO=true
|
|
|
|
HOST_BINUTILS_MAKE_OPTS += MAKEINFO=true
|
|
|
|
HOST_BINUTILS_INSTALL_OPTS += MAKEINFO=true install
|
2014-06-30 19:02:37 +02:00
|
|
|
|
2016-08-22 00:20:24 +02:00
|
|
|
# gcc bug with Os/O2/O3, PR77311
|
|
|
|
# error: unable to find a register to spill in class 'CCREGS'
|
|
|
|
ifeq ($(BR2_bfin),y)
|
|
|
|
BINUTILS_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -O1"
|
|
|
|
endif
|
|
|
|
|
2016-09-04 16:14:00 +02:00
|
|
|
# Workaround a build issue with -Os for ARM Cortex-M cpus.
|
|
|
|
# (Binutils 2.25.1 and 2.26.1)
|
|
|
|
# https://sourceware.org/bugzilla/show_bug.cgi?id=20552
|
|
|
|
ifeq ($(BR2_ARM_CPU_ARMV7M)$(BR2_OPTIMIZE_S),yy)
|
|
|
|
BINUTILS_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -O2"
|
|
|
|
endif
|
|
|
|
|
2010-12-31 12:39:01 +01:00
|
|
|
# Install binutils after busybox to prefer full-blown utilities
|
|
|
|
ifeq ($(BR2_PACKAGE_BUSYBOX),y)
|
|
|
|
BINUTILS_DEPENDENCIES += busybox
|
|
|
|
endif
|
|
|
|
|
2016-02-21 19:09:12 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_ZLIB),y)
|
|
|
|
BINUTILS_DEPENDENCIES += zlib
|
|
|
|
endif
|
|
|
|
|
2010-12-31 12:39:01 +01:00
|
|
|
# "host" binutils should actually be "cross"
|
|
|
|
# We just keep the convention of "host utility" for now
|
2014-12-24 08:54:24 +01:00
|
|
|
HOST_BINUTILS_CONF_OPTS = \
|
|
|
|
--disable-multilib \
|
|
|
|
--disable-werror \
|
|
|
|
--target=$(GNU_TARGET_NAME) \
|
|
|
|
--disable-shared \
|
|
|
|
--enable-static \
|
|
|
|
--with-sysroot=$(STAGING_DIR) \
|
|
|
|
--enable-poison-system-directories \
|
|
|
|
$(BINUTILS_DISABLE_GDB_CONF_OPTS) \
|
|
|
|
$(BINUTILS_EXTRA_CONFIG_OPTIONS)
|
2010-12-31 12:39:01 +01:00
|
|
|
|
2016-02-01 23:42:35 +01:00
|
|
|
# binutils run configure script of subdirs at make time, so ensure
|
|
|
|
# our TARGET_CONFIGURE_ARGS are taken into consideration for those
|
|
|
|
define BINUTILS_BUILD_CMDS
|
2016-10-11 14:02:33 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_ARGS) $(MAKE) $(BINUTILS_MAKE_OPTS) -C $(@D)
|
2016-02-01 23:42:35 +01:00
|
|
|
endef
|
|
|
|
|
2014-08-06 01:00:09 +02:00
|
|
|
# We just want libbfd, libiberty and libopcodes,
|
|
|
|
# not the full-blown binutils in staging
|
2010-12-31 12:39:01 +01:00
|
|
|
define BINUTILS_INSTALL_STAGING_CMDS
|
2016-10-17 18:06:43 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/bfd DESTDIR=$(STAGING_DIR) install
|
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/opcodes DESTDIR=$(STAGING_DIR) install
|
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libiberty DESTDIR=$(STAGING_DIR) install
|
2010-12-31 12:39:01 +01:00
|
|
|
endef
|
|
|
|
|
2011-06-08 15:57:26 +02:00
|
|
|
# If we don't want full binutils on target
|
|
|
|
ifneq ($(BR2_PACKAGE_BINUTILS_TARGET),y)
|
2010-12-31 12:39:01 +01:00
|
|
|
define BINUTILS_INSTALL_TARGET_CMDS
|
2011-06-08 15:57:26 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/bfd DESTDIR=$(TARGET_DIR) install
|
2016-10-17 18:06:43 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libiberty DESTDIR=$(STAGING_DIR) install
|
2010-12-31 12:39:01 +01:00
|
|
|
endef
|
2011-06-08 15:57:26 +02:00
|
|
|
endif
|
2010-12-31 12:39:01 +01:00
|
|
|
|
2012-11-20 09:31:36 +01:00
|
|
|
XTENSA_CORE_NAME = $(call qstrip, $(BR2_XTENSA_CORE_NAME))
|
2012-11-15 04:53:52 +01:00
|
|
|
ifneq ($(XTENSA_CORE_NAME),)
|
|
|
|
define BINUTILS_XTENSA_PRE_PATCH
|
2012-11-20 09:31:36 +01:00
|
|
|
tar xf $(BR2_XTENSA_OVERLAY_DIR)/xtensa_$(XTENSA_CORE_NAME).tar \
|
|
|
|
-C $(@D) --strip-components=1 binutils
|
2012-11-15 04:53:52 +01:00
|
|
|
endef
|
2013-05-27 15:01:01 +02:00
|
|
|
BINUTILS_PRE_PATCH_HOOKS += BINUTILS_XTENSA_PRE_PATCH
|
2012-11-15 04:53:52 +01:00
|
|
|
HOST_BINUTILS_PRE_PATCH_HOOKS += BINUTILS_XTENSA_PRE_PATCH
|
|
|
|
endif
|
|
|
|
|
2015-03-06 13:34:06 +01:00
|
|
|
ifeq ($(BR2_BINUTILS_ENABLE_LTO),y)
|
|
|
|
HOST_BINUTILS_CONF_OPTS += --enable-plugins --enable-lto
|
|
|
|
endif
|
|
|
|
|
2012-07-03 00:07:32 +02:00
|
|
|
$(eval $(autotools-package))
|
2012-07-03 00:06:54 +02:00
|
|
|
$(eval $(host-autotools-package))
|