From f198318fa564bead33bb0e389ddae1f5cbec0b6c Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sun, 30 Jun 2013 21:28:59 +0200 Subject: gcc: common definitions [Peter: tweak file header] Signed-off-by: Thomas Petazzoni Signed-off-by: Peter Korsgaard --- package/gcc/gcc.mk | 162 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 package/gcc/gcc.mk (limited to 'package/gcc/gcc.mk') diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk new file mode 100644 index 000000000..3b61ffd45 --- /dev/null +++ b/package/gcc/gcc.mk @@ -0,0 +1,162 @@ +################################################################################ +# +# Common variables for the gcc-initial, gcc-intermediate and gcc-final +# packages. +# +################################################################################ + +# +# Version, site and source +# + +GCC_VERSION = $(call qstrip,$(BR2_GCC_VERSION)) + +ifeq ($(BR2_GCC_VERSION_SNAP),y) +GCC_SNAP_DATE = $(call qstrip,$(BR2_GCC_SNAP_DATE)) +endif + +ifneq ($(GCC_SNAP_DATE),) +GCC_SITE = ftp://gcc.gnu.org/pub/gcc/snapshots/$(GCC_SNAP_DATE)/ +else ifeq ($(findstring avr32,$(GCC_VERSION)),avr32) +GCC_SITE = ftp://www.at91.com/pub/buildroot/ +else +GCC_SITE = $(BR2_GNU_MIRROR:/=)/gcc/gcc-$(GCC_VERSION) +endif + +GCC_SOURCE = gcc-$(GCC_VERSION).tar.bz2 + +# +# Xtensa special hook +# + +define HOST_GCC_XTENSA_OVERLAY_EXTRACT + tar xf $(BR2_XTENSA_OVERLAY_DIR)/xtensa_$(call qstrip,\ + $(BR2_XTENSA_CORE_NAME)).tar -C $(@D) --strip-components=1 gcc +endef + +# +# Apply patches +# + +define HOST_GCC_APPLY_PATCHES + support/scripts/apply-patches.sh $(@D) package/gcc/$(GCC_VERSION) \*.patch +endef + +# +# Create 'build' directory and configure symlink +# + +define HOST_GCC_CONFIGURE_SYMLINK + mkdir -p $(@D)/build + ln -s ../configure $(@D)/build/configure +endef + +# +# Common configuration options +# + +HOST_GCC_COMMON_DEPENDENCIES = \ + host-binutils \ + host-gmp \ + host-mpfr + +HOST_GCC_COMMON_CONF_OPT = \ + --target=$(GNU_TARGET_NAME) \ + --with-sysroot=$(STAGING_DIR) \ + --disable-__cxa_atexit \ + --with-gnu-ld \ + --disable-libssp \ + --disable-multilib \ + --with-gmp=$(HOST_DIR)/usr \ + --with-mpfr=$(HOST_DIR)/usr \ + +# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43810 +# Workaround until it's fixed in 4.5.4 or later +ifeq ($(ARCH),powerpc) +ifeq ($(findstring x4.5.,x$(GCC_VERSION)),x4.5.) +HOST_GCC_COMMON_CONF_OPT += --disable-target-optspace +endif +else +HOST_GCC_COMMON_CONF_OPT += --enable-target-optspace +endif + +# gcc 4.6.x quadmath requires wchar +ifneq ($(BR2_TOOLCHAIN_BUILDROOT_WCHAR),y) +HOST_GCC_COMMON_CONF_OPT += --disable-libquadmath +endif + +ifeq ($(BR2_GCC_ENABLE_TLS),y) +HOST_GCC_COMMON_CONF_OPT += --enable-tls +else +HOST_GCC_COMMON_CONF_OPT += --disable-tls +endif + +ifeq ($(BR2_PTHREADS_NONE),y) +HOST_GCC_COMMON_CONF_OPT += \ + --disable-threads \ + --disable-libitm \ + --disable-libatomic +else +HOST_GCC_COMMON_CONF_OPT += --enable-threads +endif + +ifeq ($(BR2_GCC_NEEDS_MPC),y) +HOST_GCC_COMMON_DEPENDENCIES += host-mpc +HOST_GCC_COMMON_CONF_OPT += --with-mpc=$(HOST_DIR)/usr +endif + +ifeq ($(BR2_GCC_VERSION_4_4_7_ARC),y) +HOST_GCC_COMMON_DEPENDENCIES += host-flex host-bison +endif + +ifeq ($(BR2_SOFT_FLOAT),y) +# only mips*-*-*, arm*-*-* and sparc*-*-* accept --with-float +# powerpc seems to be needing it as well +ifeq ($(BR2_arm)$(BR2_armeb)$(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el)$(BR2_powerpc)$(BR2_sparc),y) +HOST_GCC_COMMON_CONF_OPT += --with-float=soft +endif +endif + +ifeq ($(BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE),y) +HOST_GCC_COMMON_CONF_OPT += --disable-decimal-float +endif + +# Determine arch/tune/abi/cpu options +ifneq ($(call qstrip,$(BR2_GCC_TARGET_ARCH)),) +HOST_GCC_COMMON_CONF_OPT += --with-arch=$(BR2_GCC_TARGET_ARCH) +endif +ifneq ($(call qstrip,$(BR2_GCC_TARGET_TUNE)),) +HOST_GCC_COMMON_CONF_OPT += --with-tune=$(BR2_GCC_TARGET_TUNE) +endif +ifneq ($(call qstrip,$(BR2_GCC_TARGET_ABI)),) +HOST_GCC_COMMON_CONF_OPT += --with-abi=$(BR2_GCC_TARGET_ABI) +endif +ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU)),) +ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU_REVISION)),) +HOST_GCC_COMMON_CONF_OPT += --with-cpu=$(call qstrip,$(BR2_GCC_TARGET_CPU)-$(BR2_GCC_TARGET_CPU_REVISION)) +else +HOST_GCC_COMMON_CONF_OPT += --with-cpu=$(call qstrip,$(BR2_GCC_TARGET_CPU)) +endif +endif + +# Branding works on >= 4.3 +ifneq ($(findstring x4.2.,x$(GCC_VERSION)),x4.2.) +HOST_GCC_COMMON_CONF_OPT += \ + --with-pkgversion="Buildroot $(BR2_VERSION_FULL)" \ + --with-bugurl="http://bugs.buildroot.net/" +endif + +# AVR32 GCC special configuration +ifeq ($(BR2_avr32),y) +HOST_GCC_COMMON_CONF_OPT += --disable-libmudflap +endif + +# Disable mudflap and enable proper double/long double for SPE ABI +ifeq ($(BR2_powerpc_SPE),y) +HOST_GCC_COMMON_CONF_OPT += \ + --disable-libmudflap \ + --enable-e500_double \ + --with-long-double-128 +endif + +include package/gcc/*/*.mk -- cgit v1.2.3