Define correct default gcc target march/mtune/mfpmath flags for x86
Pavel Chupin [Wed, 30 Jan 2013 08:43:15 +0000 (12:43 +0400)]
This is required to enforce correct x86 -march/-mtune flags which are
currently hardcoded in gcc (see gcc/config/i386/gnu-user.h). The problem
is that gcc hardcode doesn't work, it is overridden by generic values.
It can be seen with -### option for any compilation.
This patch adds correct configure flags and after it is merged
-march/-mtune flags in gcc can be removed.

Default -mfpmath can't be seen in -### but can be configured as well to
eliminate hardcode.

Also cleanup old flags which didn't work anyway. target_cpu is i686 and
not x86.

Change-Id: I43ea7034e855629933da2d1bede90cd74a238861
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>

Makefile.in

index f55c7c3..c0c7ee2 100644 (file)
@@ -463,32 +463,8 @@ GCC_CONFIG_ARGS += $(GCC_CONFIG_LIBSTDCXX_V3) --disable-libssp \
 
 CFLAGS_FOR_TARGET += -DTARGET_POSIX_IO -fno-short-enums
 
-ifeq ($(target_cpu),x86)
-# Options brought in from core/combo/* for IA
-CFLAGS_FOR_TARGET += \
-       -DANDROID -D__ANDROID__ -Ulinux \
-       -fPIC -Wa,--noexecstack -m32 -fstack-protector \
-       -W -Wall -Werror=address -Werror=format-security -Werror=non-virtual-dtor -Werror=return-type \
-       -Werror=sequence-point -Winit-self -Wno-multichar -Wno-unused -Wpointer-arith -Wstrict-aliasing=2 \
-       -fexceptions -ffunction-sections -finline-functions \
-       -finline-limit=300 -fmessage-length=0 -fno-inline-functions-called-once \
-       -fno-strict-aliasing -frtti \
-       -fstrict-aliasing -funswitch-loops -funwind-tables \
-       -march=i686 -mtune=atom -mbionic -mfpmath=sse -mstackrealign -DUSE_SSE2
-
-LDFLAGS_FOR_TARGET += \
-       -m32 -O2 -g -fPIC \
-       -nostartfiles \
-       -Wl,-z,noexecstack -Wl,--gc-sections -nostdlib \
-       -fexceptions -frtti -fstrict-aliasing -ffunction-sections -finline-functions  \
-       -finline-limit=300 -fno-inline-functions-called-once \
-       -funswitch-loops -funwind-tables -mstackrealign \
-       -ffunction-sections -funwind-tables -fmessage-length=0 \
-       -march=atom -mstackrealign -mfpmath=sse -mbionic \
-       -Wno-multichar -Wl,-z,noexecstack -Werror=format-security -Wstrict-aliasing=2 \
-       -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Werror=return-type -Werror=non-virtual-dtor \
-       -Werror=address -Werror=sequence-point \
-       -Werror=format-security -Wl,--no-undefined
+ifeq ($(target_cpu),i686)
+GCC_CONFIG_ARGS += --with-arch=i686 --with-tune=atom --with-fpmath=sse
 endif
 
 # ARM specific options.