kumquat-buildroot/package/guile/guile.mk
Romain Naour 401c47e44b package/guile: dont't use -Os for CS 2014.05 ARM toolchain
With this toolchain, guile tigger an assembler error with -Os which is
probably caused by the binutils version being used:

arm-none-linux-gnueabi-ld --version
GNU ld (Sourcery CodeBench Lite 2014.05-29) 2.24.51.20140217

arm-none-linux-gnueabi-gcc --version
arm-none-linux-gnueabi-gcc (Sourcery CodeBench Lite 2014.05-29) 4.8.3 20140320 (prerelease)

Nowaday, even with a Buildroot internal toolchain using the oldest
Binutils GCC version (2.25.1 and 4.8.6), guile build fine with -Os.

So, force -O2 when this toolchain is used and BR2_OPTIMIZE_S is set.

Fixes:
http://autobuild.buildroot.net/results/976/976b3477407e64c8c2fc2309ed952d0083903a19

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-11-09 22:45:44 +01:00

60 lines
2.0 KiB
Makefile

################################################################################
#
# guile
#
################################################################################
GUILE_VERSION = 2.0.13
GUILE_SOURCE = guile-$(GUILE_VERSION).tar.xz
GUILE_SITE = $(BR2_GNU_MIRROR)/guile
GUILE_INSTALL_STAGING = YES
# For 0002-calculate-csqrt_manually.patch
GUILE_AUTORECONF = YES
GUILE_LICENSE = LGPLv3+
GUILE_LICENSE_FILES = LICENSE COPYING COPYING.LESSER
# libtool dependency is needed because guile uses libltdl
GUILE_DEPENDENCIES = host-guile libunistring libffi gmp bdwgc host-pkgconf libtool
HOST_GUILE_DEPENDENCIES = host-libunistring host-libffi host-gmp host-bdwgc host-flex host-pkgconf host-gettext
# The HAVE_GC* CFLAGS specify that we will use internal callbacks
# instead of the ones provided by
# bdwgc. Eg. HAVE_GC_SET_FINALIZER_NOTIFIER specifies that we won't
# use bdwgc's GC_finalizer_notifier callback. Trying to use these
# specific bdwgc's callbacks breaks guile's building.
GUILE_CFLAGS = \
-DHAVE_GC_SET_FINALIZER_NOTIFIER \
-DHAVE_GC_GET_HEAP_USAGE_SAFE \
-DHAVE_GC_GET_FREE_SPACE_DIVISOR \
-DHAVE_GC_SET_FINALIZE_ON_DEMAND
ifeq ($(BR2_STATIC_LIBS),y)
GUILE_CFLAGS += -DGC_NO_DLOPEN
endif
# Triggers assembler error with -Os
ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM)$(BR2_OPTIMIZE_S),yy)
GUILE_CFLAGS += -O2
endif
# It can use readline, but on the condition that it was build against
# ncurses. If both aren't present disable readline support since the
# host readline/ncurses support can poison the build.
ifeq ($(BR2_PACKAGE_NCURSES)$(BR2_PACKAGE_READLINE),yy)
GUILE_CONF_OPTS += --with-libreadline-prefix=$(STAGING_DIR)/usr
GUILE_DEPENDENCIES += readline
else
GUILE_CONF_OPTS += --without-libreadline-prefix
endif
GUILE_CONF_ENV += GUILE_FOR_BUILD=$(HOST_DIR)/usr/bin/guile \
CFLAGS="$(TARGET_CFLAGS) $(GUILE_CFLAGS)"
GUILE_CONF_OPTS += \
--with-libltdl-prefix=$(STAGING_DIR)/usr/lib \
--with-libgmp-prefix=$(STAGING_DIR)/usr/lib \
--with-libunistring-prefix=$(STAGING_DIR)/usr/lib
$(eval $(autotools-package))
$(eval $(host-autotools-package))