2011-02-21 12:43:16 +01:00
|
|
|
#
|
2013-09-11 15:18:23 +02:00
|
|
|
# Copyright (C) 2006-2013 OpenWrt.org
|
2006-06-27 02:44:04 +02:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2005-03-06 04:34:52 +01:00
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
2006-06-21 08:19:43 +02:00
|
|
|
PKG_NAME:=binutils
|
2008-07-15 01:24:58 +02:00
|
|
|
PKG_VERSION:=$(call qstrip,$(CONFIG_BINUTILS_VERSION))
|
2009-10-19 04:09:59 +02:00
|
|
|
BIN_VERSION:=$(PKG_VERSION)
|
2005-03-06 04:34:52 +01:00
|
|
|
|
2015-11-10 13:03:59 +01:00
|
|
|
PKG_SOURCE_URL:=@GNU/binutils/
|
2018-04-17 01:15:30 +02:00
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
2015-11-10 13:03:59 +01:00
|
|
|
|
2018-03-12 21:29:07 +01:00
|
|
|
TAR_OPTIONS += --exclude='*.rej'
|
|
|
|
|
2019-02-09 02:22:02 +01:00
|
|
|
ifeq ($(PKG_VERSION),2.32)
|
|
|
|
PKG_HASH:=0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
|
|
|
|
endif
|
|
|
|
|
2020-02-03 16:30:06 +01:00
|
|
|
ifeq ($(PKG_VERSION),2.34)
|
|
|
|
PKG_HASH:=f00b0e8803dc9bab1e2165bd568528135be734df3fabf8d0161828cd56028952
|
|
|
|
endif
|
|
|
|
|
2020-09-28 10:54:09 +02:00
|
|
|
ifeq ($(PKG_VERSION),2.35.1)
|
|
|
|
PKG_HASH:=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
|
2020-08-25 05:55:05 +02:00
|
|
|
endif
|
|
|
|
|
2012-09-15 16:18:16 +02:00
|
|
|
HOST_BUILD_PARALLEL:=1
|
|
|
|
|
2007-06-28 09:20:42 +02:00
|
|
|
PATCH_DIR:=./patches/$(PKG_VERSION)
|
2008-11-08 22:18:33 +01:00
|
|
|
|
2009-02-24 00:52:27 +01:00
|
|
|
include $(INCLUDE_DIR)/toolchain-build.mk
|
2005-07-20 16:58:27 +02:00
|
|
|
|
2019-04-22 14:22:40 +02:00
|
|
|
HOST_CONFIGURE_ARGS = \
|
|
|
|
--prefix=$(TOOLCHAIN_DIR) \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--host=$(GNU_HOST_NAME) \
|
|
|
|
--target=$(REAL_GNU_TARGET_NAME) \
|
|
|
|
--with-sysroot=$(TOOLCHAIN_DIR) \
|
|
|
|
--enable-deterministic-archives \
|
|
|
|
--enable-plugins \
|
|
|
|
--disable-multilib \
|
|
|
|
--disable-werror \
|
|
|
|
--disable-nls \
|
|
|
|
--disable-sim \
|
|
|
|
--disable-gdb \
|
|
|
|
$(GRAPHITE_CONFIGURE) \
|
|
|
|
$(SOFT_FLOAT_CONFIG_OPTION) \
|
|
|
|
$(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
|
2008-04-13 01:14:42 +02:00
|
|
|
|
2009-02-03 00:45:33 +01:00
|
|
|
ifneq ($(CONFIG_SSP_SUPPORT),)
|
2019-04-22 14:22:40 +02:00
|
|
|
HOST_CONFIGURE_ARGS+= \
|
2009-02-03 22:25:48 +01:00
|
|
|
--enable-libssp
|
2009-02-03 00:45:33 +01:00
|
|
|
else
|
2019-04-22 14:22:40 +02:00
|
|
|
HOST_CONFIGURE_ARGS+= \
|
2009-02-03 22:25:48 +01:00
|
|
|
--disable-libssp
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(CONFIG_EXTRA_TARGET_ARCH),)
|
2019-04-22 14:22:40 +02:00
|
|
|
HOST_CONFIGURE_ARGS+= \
|
2009-02-03 22:25:48 +01:00
|
|
|
--enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX)
|
2009-02-03 00:45:33 +01:00
|
|
|
endif
|
|
|
|
|
2009-02-22 05:37:20 +01:00
|
|
|
define Host/Prepare
|
|
|
|
$(call Host/Prepare/Default)
|
2014-10-18 21:25:24 +02:00
|
|
|
ln -snf $(notdir $(HOST_BUILD_DIR)) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
|
2009-02-22 05:37:20 +01:00
|
|
|
$(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
|
2014-10-20 13:43:08 +02:00
|
|
|
$(SED) 's, " Linaro.*,,' $(HOST_BUILD_DIR)/bfd/version.h
|
2009-01-08 02:49:11 +01:00
|
|
|
endef
|
|
|
|
|
2009-02-22 05:37:20 +01:00
|
|
|
define Host/Compile
|
2012-09-23 11:50:01 +02:00
|
|
|
+$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all
|
2006-06-21 08:19:43 +02:00
|
|
|
endef
|
2005-07-20 16:58:27 +02:00
|
|
|
|
2009-02-22 05:37:20 +01:00
|
|
|
define Host/Install
|
2012-06-30 20:12:15 +02:00
|
|
|
mkdir -p $(TOOLCHAIN_DIR)/initial
|
|
|
|
$(MAKE) -C $(HOST_BUILD_DIR) \
|
|
|
|
prefix=$(TOOLCHAIN_DIR)/initial \
|
|
|
|
install
|
2014-12-27 14:00:09 +01:00
|
|
|
$(MAKE) -C $(HOST_BUILD_DIR) \
|
|
|
|
prefix=$(TOOLCHAIN_DIR) \
|
|
|
|
install
|
2012-06-30 23:43:59 +02:00
|
|
|
$(call FixupLibdir,$(TOOLCHAIN_DIR)/initial)
|
2014-09-07 11:38:10 +02:00
|
|
|
$(RM) $(TOOLCHAIN_DIR)/initial/lib/libiberty.a
|
2017-05-03 15:01:03 +02:00
|
|
|
$(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(HOST_BUILD_PREFIX)/bin/readelf
|
2015-11-10 13:03:59 +01:00
|
|
|
# ARC gcc requires extlib.
|
|
|
|
# If extlib is not available in "initial" folder
|
|
|
|
# initial gcc will fail to build libc.
|
|
|
|
if [ -d $(TOOLCHAIN_DIR)/extlib ]; then \
|
|
|
|
$(CP) -r $(TOOLCHAIN_DIR)/extlib $(TOOLCHAIN_DIR)/initial/; \
|
|
|
|
fi
|
2006-06-21 08:19:43 +02:00
|
|
|
endef
|
2005-07-20 16:58:27 +02:00
|
|
|
|
2009-02-22 05:37:20 +01:00
|
|
|
define Host/Clean
|
2009-01-08 02:49:11 +01:00
|
|
|
rm -rf \
|
2009-02-22 05:37:20 +01:00
|
|
|
$(HOST_BUILD_DIR) \
|
2009-01-08 02:49:11 +01:00
|
|
|
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
|
|
|
|
endef
|
|
|
|
|
2006-06-21 08:19:43 +02:00
|
|
|
$(eval $(call HostBuild))
|