openwrtv3/toolchain/binutils/Makefile

98 lines
2.5 KiB
Makefile
Raw Normal View History

#
# Copyright (C) 2006-2013 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=binutils
PKG_VERSION:=$(call qstrip,$(CONFIG_BINUTILS_VERSION))
BIN_VERSION:=$(PKG_VERSION)
ifeq ($(findstring linaro, $(CONFIG_BINUTILS_VERSION)),linaro)
PKG_SOURCE_URL:=https://releases.linaro.org/14.09/components/toolchain/binutils-linaro/
PKG_REV:=2.24.0-2014.09
PKG_SOURCE:=$(PKG_NAME)-linaro-$(PKG_REV).tar.xz
PKG_MD5SUM:=8f9b2b2e049d59b1b86ce9657802a353
BINUTILS_DIR:=$(PKG_NAME)-linaro-$(PKG_REV)
HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(BINUTILS_DIR)
else
PKG_SOURCE_URL:=@GNU/binutils/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
ifeq ($(PKG_VERSION),2.20.1)
PKG_MD5SUM:=9cdfb9d6ec0578c166d3beae5e15c4e5
endif
endif
HOST_BUILD_PARALLEL:=1
PATCH_DIR:=./patches/$(PKG_VERSION)
REAL_STAGING_DIR_HOST:=$(STAGING_DIR_HOST)
include $(INCLUDE_DIR)/toolchain-build.mk
BINUTILS_CONFIGURE:= \
./configure \
--prefix=$(TOOLCHAIN_DIR) \
--build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \
--with-sysroot=$(TOOLCHAIN_DIR) \
--disable-multilib \
--disable-werror \
--disable-nls \
$(GRAPHITE_CONFIGURE) \
$(SOFT_FLOAT_CONFIG_OPTION) \
$(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
ifneq ($(CONFIG_SSP_SUPPORT),)
BINUTILS_CONFIGURE+= \
--enable-libssp
else
BINUTILS_CONFIGURE+= \
--disable-libssp
endif
ifneq ($(CONFIG_EXTRA_TARGET_ARCH),)
BINUTILS_CONFIGURE+= \
--enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX)
endif
define Host/Prepare
$(call Host/Prepare/Default)
ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
$(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
endef
define Host/Configure
(cd $(HOST_BUILD_DIR); \
$(BINUTILS_CONFIGURE) \
);
endef
define Host/Compile
+$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all
endef
define Host/Install
mkdir -p $(TOOLCHAIN_DIR)/initial
$(MAKE) -C $(HOST_BUILD_DIR) \
prefix=$(TOOLCHAIN_DIR)/initial \
install
$(call FixupLibdir,$(TOOLCHAIN_DIR)/initial)
toolchain/binutils: do not install host libiberty.a into target lib dir Binutils target build will pick it up and break build on e.g. arm: libtool: link: arm-openwrt-linux-uclibcgnueabi-gcc -shared .libs/archive.o .libs/archures.o .libs/bfd.o .libs/bfdio.o .libs/bfdwin.o .libs/cache.o .libs/coffgen.o .libs/corefile.o .libs/format.o .libs/init.o .libs/libbfd.o .libs/opncls.o .libs/reloc.o .libs/section.o .libs/syms.o .libs/targets.o .libs/hash.o .libs/linker.o .libs/srec.o .libs/binary.o .libs/tekhex.o .libs/ihex.o .libs/stabs.o .libs/stab-syms.o .libs/merge.o .libs/dwarf2.o .libs/simple.o .libs/compress.o .libs/verilog.o .libs/elf32-arm.o .libs/elf32.o .libs/elf-nacl.o .libs/elf-vxworks.o .libs/elf.o .libs/elflink.o .libs/elf-attrs.o .libs/elf-strtab.o .libs/elf-eh-frame.o .libs/dwarf1.o .libs/elf32-gen.o .libs/cpu-arm.o -L/mnt/dl/slave/at91/build/staging_dir/target-arm_arm926ej-s_uClibc-0.9.33.2_eabi/usr/lib -L/mnt/dl/slave/at91/build/staging_dir/target-arm_arm926ej-s_uClibc-0.9.33.2_eabi/lib -L/mnt/dl/slave/at91/build/staging_dir/toolchain-arm_arm926ej-s_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/usr/lib -L/mnt/dl/slave/at91/build/staging_dir/toolchain-arm_arm926ej-s_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/lib -L/mnt/dl/slave/at91/build/build_dir/target-arm_arm926ej-s_uClibc-0.9.33.2_eabi/binutils-2.24/bfd/../libiberty/pic -liberty -lz -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -Wl,-lc -Wl,--as-needed -Wl,-lm -Wl,--no-as-needed -Wl,-soname -Wl,libbfd-2.24.so -o .libs/libbfd-2.24.so /mnt/dl/slave/at91/build/staging_dir/toolchain-arm_arm926ej-s_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/lib/libiberty.a: could not read symbols: File format not recognized Signed-off-by: Jonas Gorski <jogo@openwrt.org> SVN-Revision: 42430
2014-09-07 09:38:10 +00:00
$(RM) $(TOOLCHAIN_DIR)/initial/lib/libiberty.a
$(CP) $(TOOLCHAIN_DIR)/initial/. $(TOOLCHAIN_DIR)/
$(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(REAL_STAGING_DIR_HOST)/bin/readelf
endef
define Host/Clean
rm -rf \
$(HOST_BUILD_DIR) \
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
endef
$(eval $(call HostBuild))