Pass -mtune=i686 to assembler when compiling for i686
[glibc.git] / sysdeps / i386 / configure.in
blob9fc7fa59febc9f03caa20ba94534dde0f88f97d8
1 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2 # Local configure fragment for sysdeps/i386.
4 AC_HEADER_CHECK([cpuid.h], ,
5   [AC_MSG_ERROR([gcc must provide the <cpuid.h> header])])
7 AC_CACHE_CHECK(if -g produces usable source locations for assembler-with-cpp,
8                libc_cv_cpp_asm_debuginfo, [dnl
9 cat > conftest.S <<EOF
10 #include "confdefs.h"
12 /* comment on
13    two lines */
14         ${libc_cv_dot_text}
15         ${libc_cv_asm_global_directive} foo
16 foo:
17         /* Unfortunately this test only works for a real instruction,
18            not for any of the machine-independent pseudo-ops.
19            So we just have to assume everybody has a "nop".  */
20         nop
21         /* comment */
22         nop
23         /* comment */
24         nop
25 EOF
26 if AC_TRY_COMMAND([${CC-cc} $CPPFLAGS $ASFLAGS -g -c conftest.S 1>&AS_MESSAGE_LOG_FD]) && {
27    ac_pattern='conftest\.S'
28    AC_TRY_COMMAND([readelf --debug-dump=line conftest.o |
29                    grep $ac_pattern 1>&AS_MESSAGE_LOG_FD])
30   }; then
31   libc_cv_cpp_asm_debuginfo=yes
32 else
33   libc_cv_cpp_asm_debuginfo=no
35 rm -f conftest*])AC_SUBST(libc_cv_cpp_asm_debuginfo)
36 if test $libc_cv_cpp_asm_debuginfo = yes; then
37   AC_DEFINE(HAVE_CPP_ASM_DEBUGINFO)
40 dnl Check if -msse4 works.
41 AC_CACHE_CHECK(for SSE4 support, libc_cv_cc_sse4, [dnl
42 if AC_TRY_COMMAND([${CC-cc} -msse4 -xc /dev/null -S -o /dev/null]); then
43   libc_cv_cc_sse4=yes
44 else
45   libc_cv_cc_sse4=no
46 fi])
47 if test $libc_cv_cc_sse4 = yes; then
48   AC_DEFINE(HAVE_SSE4_SUPPORT)
51 dnl Check if -Wa,-mtune=i686 works.
52 AC_CACHE_CHECK(for assembler -mtune=i686 support, libc_cv_as_i686, [dnl
53 if AC_TRY_COMMAND([${CC-cc} -Wa,-mtune=i686 -xc /dev/null -S -o /dev/null]); then
54   libc_cv_as_i686=yes
55 else
56   libc_cv_as_i686=no
57 fi])