1 # gcc has a bunch of options that need to be shared with
2 # both gcc-uclibc-2.95.mk and gcc-uclibc-3.x.mk, and are
3 # use by other packages... So include them in this file
4 # and arrange to include it soon after invoking make from
7 GCC_VERSION
:=$(strip $(subst ",, $(BR2_GCC_VERSION)))
9 TARGET_OPTIMIZATION
:=$(strip $(subst ",, $(BR2_TARGET_OPTIMIZATION)))
11 EXTRA_GCC_CONFIG_OPTIONS
:=$(strip $(subst ",, $(BR2_EXTRA_GCC_CONFIG_OPTIONS)))
13 BR2_GCC_DECNUMBER
:=$(strip $(subst ",, $(BR2_GCC_DECNUMBER)))
16 ifeq ($(BR2_GCC_IS_SNAP
),y
)
17 GCC_SNAP_DATE
:=$(strip $(subst ",, $(BR2_GCC_SNAP_DATE)))
21 ifeq ($(BR2_GCC_USE_SJLJ_EXCEPTIONS
),y
)
22 GCC_USE_SJLJ_EXCEPTIONS
:=--enable-sjlj-exceptions
24 ifeq ($(BR2_ENABLE_SSP
),y
)
25 GCC_USE_LIBSSP
+=--enable-libssp
27 GCC_USE_LIBSSP
+=--disable-libssp
29 ifeq ($(BR2_ENABLE_MUDFLAP
),y
)
30 GCC_USE_LIBMUDFLAP
+=--enable-libmudflap
32 GCC_USE_LIBMUDFLAP
+=--disable-libmudflap
34 ifeq ($(BR2_ENABLE_LIBGOMP
),y
)
35 GCC_USE_LIBGOMP
+=--enable-libgomp
37 GCC_USE_LIBGOMP
+=--disable-libgomp
40 ifeq ($(BR2_SOFT_FLOAT
),y
)
41 # gcc 3.4.x soft float configuration is different than previous versions.
42 ifeq ($(findstring x3.4.
,x
$(GCC_VERSION
)),x3.4.
)
43 SOFT_FLOAT_CONFIG_OPTION
:=--with-float
=soft
45 SOFT_FLOAT_CONFIG_OPTION
:=--without-float
48 # again... there must be a better way
49 ifeq ($(findstring x4.
,x
$(GCC_VERSION
)),x4.
)
50 SOFT_FLOAT_CONFIG_OPTION
:=--with-float
=soft
51 ifeq ($(BR2_SOFT_FLOAT_FP
),y
)
52 TARGET_SOFT_FLOAT
:=-mfloat-abi
=softfp
54 ifneq ($(BR2_powerpc
),y
) # is rejected for e.g. "405":
55 TARGET_SOFT_FLOAT
:=-mfloat-abi
=soft
59 TARGET_SOFT_FLOAT
:=-msoft-float
61 else # no softfloat support
62 SOFT_FLOAT_CONFIG_OPTION
:=
64 endif # softfloat support
66 # Some arches (e.g. cris) do not have supported_defaults
67 # These are not allowed BR2_GCC_TARGET_ARCH but only BR2_GCC_TARGET_FLAGS_ARCH
68 GCC_TARGET_ARCH_
:=$(strip $(subst ",,$(BR2_GCC_TARGET_ARCH)))
70 GCC_TARGET_ABI_
:=$(strip $(subst ",,$(BR2_GCC_TARGET_ABI)))
72 GCC_TARGET_TUNE_
:=$(strip $(subst ",,$(BR2_GCC_TARGET_TUNE)))
74 GCC_TARGET_CPU_
:=$(strip $(subst ",,$(BR2_GCC_TARGET_CPU)))
76 GCC_TARGET_SUBCPU_
:=$(strip $(subst ",,$(BR2_GCC_TARGET_SUBCPU)))
78 GCC_TARGET_SUBCPU_SEPARATOR
:=$(strip $(subst ",,$(BR2_GCC_TARGET_SUBCPU_SEPARATOR)))
80 ifneq ($(strip $(GCC_TARGET_CPU_
)),)
81 GCC_WITH_CPU
:=--with-cpu
=$(GCC_TARGET_CPU_
)$(if
$(GCC_TARGET_SUBCPU_
),$(GCC_TARGET_SUBCPU_SEPARATOR
)$(GCC_TARGET_SUBCPU_
))
83 ifneq ($(strip $(GCC_TARGET_TUNE_
)),)
84 GCC_WITH_TUNE
:=--with-tune
=$(GCC_TARGET_TUNE_
)
86 ifneq ($(strip $(GCC_TARGET_ARCH_
)),)
87 GCC_WITH_ARCH
:=--with-arch
=$(GCC_TARGET_ARCH_
)
89 ifneq ($(strip $(GCC_TARGET_ABI_
)),)
90 GCC_WITH_ABI
:=--with-abi
=$(GCC_TARGET_ABI_
)
94 TARGET_GCC_FLAGS
= CFLAGS_FOR_TARGET
="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
95 CXXFLAGS_FOR_TARGET
="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
96 BOOT_CFLAGS
="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)"
98 EXTRA_GCC_CONFIG_OPTIONS
+=$(BR2_MAYBE_USE_INTERWORKING
) \
99 $(GCC_USE_LIBSSP
) $(GCC_USE_LIBSSP
) $(GCC_USE_LIBMUDFLAP
) \
101 --enable-decimal-float
=$(BR2_GCC_DECNUMBER
)
103 ####################### T A R G E T s e t t i n g s #######################
104 ifeq ($(BR2_PACKAGE_GCC_TARGET
),y
)
105 EXTRA_TARGET_GCC_CONFIG_OPTIONS
:= \
106 $(GCC_USE_LIBSSP
) $(GCC_USE_LIBSSP
) $(GCC_USE_LIBMUDFLAP
) \
109 # and finally pull in config opts from the user
110 EXTRA_TARGET_GCC_CONFIG_OPTIONS
+=$(strip $(subst ",, $(BR2_EXTRA_TARGET_GCC_CONFIG_OPTIONS)))
113 ifeq ($(BR2_PREFER_IMA
),y
)
115 ifneq ($(findstring x3.
,x
$(GCC_VERSION
)),x3.
)
116 EXTRA_TARGET_GCC_CONFIG_OPTIONS
+=--enable-intermodule
118 endif # BR2_PREFER_IMA=y