kumquat-buildroot/package/gcc/gcc-initial/gcc-initial.mk
Thomas Petazzoni c5c9d0fe1d gcc/gcc-initial: fix build of the AVR32 toolchain
Since we switched to a two stage gcc build process, the AVR32
toolchain stopped building. This is because with such an old gcc
version, we cannot use the all-target-libgcc and install-target-libgcc
targets.

Before the two stage gcc, libgcc was only built in gcc-intermediate,
which carried a similar logic. This commit basically restores in
gcc-initial the logic that used to be in gcc-intermediate, which
consists in using the all-target-libcc and install-target-libgcc
targets only for gcc versions others than the AVR32 one.

Using the BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE option has a way of
distinguishing the old AVR32 compiler from the other gcc versions is a
bit ugly, but it's what was done in gcc-intermediate before. And since
the AVR32 support is due to go away at some point in the hopefully
near future, we don't care that much.

This will fix the build of the two AVR32 defconfig that have been
constantly failing since switching to the two stage gcc process.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-09 15:27:31 +02:00

65 lines
2.1 KiB
Makefile

################################################################################
#
# gcc-initial
#
################################################################################
GCC_INITIAL_VERSION = $(GCC_VERSION)
GCC_INITIAL_SITE = $(GCC_SITE)
GCC_INITIAL_SOURCE = $(GCC_SOURCE)
HOST_GCC_INITIAL_DEPENDENCIES = $(HOST_GCC_COMMON_DEPENDENCIES)
HOST_GCC_INITIAL_EXTRACT_CMDS = $(HOST_GCC_EXTRACT_CMDS)
ifneq ($(call qstrip, $(BR2_XTENSA_CORE_NAME)),)
HOST_GCC_INITIAL_POST_EXTRACT_HOOKS += HOST_GCC_XTENSA_OVERLAY_EXTRACT
endif
HOST_GCC_INITIAL_POST_PATCH_HOOKS += HOST_GCC_APPLY_PATCHES
# gcc doesn't support in-tree build, so we create a 'build'
# subdirectory in the gcc sources, and build from there.
HOST_GCC_INITIAL_SUBDIR = build
HOST_GCC_INITIAL_PRE_CONFIGURE_HOOKS += HOST_GCC_CONFIGURE_SYMLINK
# gcc on ARC has a bug: in its libgcc, even when no C library is
# available (--with-newlib is passed, and therefore inhibit_libc is
# defined), it tries to use the C library for the libgmon
# library. Since it's not needed in gcc-initial, we disabled it here.
ifeq ($(BR2_GCC_VERSION_4_8_ARC),y)
define HOST_GCC_INITIAL_DISABLE_LIBGMON
$(SED) 's/crtbeginS.o libgmon.a crtg.o/crtbeginS.o crtg.o/' \
$(@D)/libgcc/config.host
endef
HOST_GCC_INITIAL_POST_PATCH_HOOKS += HOST_GCC_INITIAL_DISABLE_LIBGMON
endif
HOST_GCC_INITIAL_CONF_OPTS = \
$(HOST_GCC_COMMON_CONF_OPTS) \
--enable-languages=c \
--disable-shared \
--without-headers \
--disable-threads \
--with-newlib \
--disable-largefile \
--disable-nls \
$(call qstrip,$(BR2_EXTRA_GCC_CONFIG_OPTIONS))
HOST_GCC_INITIAL_CONF_ENV = \
$(HOST_GCC_COMMON_CONF_ENV)
# We need to tell gcc that the C library will be providing the ssp
# support, as it can't guess it since the C library hasn't been built
# yet (we're gcc-initial).
HOST_GCC_INITIAL_MAKE_OPTS = $(if $(BR2_TOOLCHAIN_HAS_SSP),gcc_cv_libc_provides_ssp=yes) all-gcc
HOST_GCC_INITIAL_INSTALL_OPTS = install-gcc
ifeq ($(BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE),y)
HOST_GCC_INITIAL_MAKE_OPTS += all-target-libgcc
HOST_GCC_INITIAL_INSTALL_OPTS += install-target-libgcc
endif
$(eval $(host-autotools-package))