diff options
Diffstat (limited to 'package/gcc/gcc.mk')
-rw-r--r-- | package/gcc/gcc.mk | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk index b834269adc..5e419f7ede 100644 --- a/package/gcc/gcc.mk +++ b/package/gcc/gcc.mk @@ -98,6 +98,12 @@ ifeq ($(BR2_ENABLE_DEBUG),y) GCC_COMMON_TARGET_CFLAGS += -Wno-error endif +# Make sure libgcc & libstdc++ always get built with -matomic on ARC700 +ifeq ($(GCC_TARGET_CPU):$(BR2_ARC_ATOMIC_EXT),arc700:y) +GCC_COMMON_TARGET_CFLAGS += -matomic +GCC_COMMON_TARGET_CXXFLAGS += -matomic +endif + # Propagate options used for target software building to GCC target libs HOST_GCC_COMMON_CONF_ENV += CFLAGS_FOR_TARGET="$(GCC_COMMON_TARGET_CFLAGS)" HOST_GCC_COMMON_CONF_ENV += CXXFLAGS_FOR_TARGET="$(GCC_COMMON_TARGET_CXXFLAGS)" @@ -116,17 +122,7 @@ endif ifeq ($(BR2_USE_WCHAR)$(BR2_TOOLCHAIN_HAS_LIBQUADMATH),yy) HOST_GCC_COMMON_CONF_OPTS += --enable-libquadmath else -HOST_GCC_COMMON_CONF_OPTS += --disable-libquadmath -endif - -# Disable libsanitizer due to a build issue with gcc 7.5 and glibc 2.31. -# It would require to backport the following upstream commit -# https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=4abc46b51af5751d657764d0c44b8a4aeed06302 -# but it conflict with gcc 7.5 libsanitizer code. -# Disable libsanitizer since the gcc 7.5 branch is now closed -# (unmaintained) and it's not a trivial merge. -ifeq ($(BR2_TOOLCHAIN_BUILDROOT_GLIBC)$(BR2_GCC_VERSION_7_X),yy) -HOST_GCC_COMMON_CONF_OPTS += --disable-libsanitizer +HOST_GCC_COMMON_CONF_OPTS += --disable-libquadmath --disable-libquadmath-support endif # libsanitizer requires wordexp, not in default uClibc config. Also @@ -141,6 +137,14 @@ ifeq ($(BR2_sparc)$(BR2_sparc64),y) HOST_GCC_COMMON_CONF_OPTS += --disable-libsanitizer endif +# The logic in libbacktrace/configure.ac to detect if __sync builtins +# are available assumes they are as soon as target_subdir is not +# empty, i.e when cross-compiling. However, some platforms do not have +# __sync builtins, so help the configure script a bit. +ifeq ($(BR2_TOOLCHAIN_HAS_SYNC_4),) +HOST_GCC_COMMON_CONF_ENV += target_configargs="libbacktrace_cv_sys_sync=no" +endif + # TLS support is not needed on uClibc/no-thread and # uClibc/linux-threads, otherwise, for all other situations (glibc, # musl and uClibc/NPTL), we need it. @@ -219,10 +223,18 @@ endif # Enable proper double/long double for SPE ABI ifeq ($(BR2_powerpc_SPE),y) HOST_GCC_COMMON_CONF_OPTS += \ + --enable-obsolete \ --enable-e500_double \ --with-long-double-128 endif +# Set default to Secure-PLT to prevent run-time +# generation of PLT stubs (supports RELRO and +# SELinux non-exemem capabilities) +ifeq ($(BR2_powerpc),y) +HOST_GCC_COMMON_CONF_OPTS += --enable-secureplt +endif + # PowerPC64 big endian by default uses the elfv1 ABI, and PowerPC 64 # little endian by default uses the elfv2 ABI. However, musl has # decided to use the elfv2 ABI for both, so we force the elfv2 ABI for @@ -241,6 +253,11 @@ HOST_GCC_COMMON_CONF_OPTS += \ --with-long-double-128 endif +ifeq ($(BR2_s390x),y) +HOST_GCC_COMMON_CONF_OPTS += \ + --with-long-double-128 +endif + HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_CROSS_PATH_SUFFIX='".br_real"' # For gcc-initial, we need to tell gcc that the C library will be @@ -271,11 +288,6 @@ HOST_GCC_COMMON_CCACHE_HASH_FILES += \ ifeq ($(BR2_xtensa),y) HOST_GCC_COMMON_CCACHE_HASH_FILES += $(ARCH_XTENSA_OVERLAY_TAR) endif -ifeq ($(ARCH),powerpc) -ifneq ($(BR2_SOFT_FLOAT),) -HOST_GCC_COMMON_CCACHE_HASH_FILES += package/gcc/$(GCC_VERSION)/1000-powerpc-link-with-math-lib.patch.conditional -endif -endif # _CONF_OPTS contains some references to the absolute path of $(HOST_DIR) # and a reference to the Buildroot git revision (BR2_VERSION_FULL), |