2005-01-05 10:39:54 +01:00
|
|
|
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
|
|
|
|
# Local configure fragment for sysdeps/i386.
|
|
|
|
|
2013-04-18 02:13:20 +02:00
|
|
|
# We no longer support i386 since it lacks the atomic instructions
|
|
|
|
# required to implement NPTL threading.
|
|
|
|
if test "$config_machine" = i386; then
|
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** ERROR: Support for i386 is deprecated.
|
|
|
|
*** Please use host i786, i686, i585 or i486.
|
|
|
|
*** For example: /src/glibc/configure --host=i686-pc-linux-gnu ..."])
|
|
|
|
fi
|
|
|
|
|
2013-04-06 18:00:35 +02:00
|
|
|
# The GNU C Library can't be built for i386. There are several reasons for
|
|
|
|
# this restriction. The primary reason is that i386 lacks the atomic
|
|
|
|
# operations required to support the current NPTL implementation. While it is
|
|
|
|
# possible that such atomic operations could be emulated in the kernel to date
|
|
|
|
# no such work has been done to enable this. Even with NPTL disabled you still
|
|
|
|
# have no atomic.h implementation. Given the declining use of i386 we disable
|
|
|
|
# support for building with `-march=i386' or `-mcpu=i386.' We don't explicitly
|
|
|
|
# check for i386, instead we make sure the compiler has support for inlining
|
|
|
|
# the builtin __sync_val_compare_and_swap. If it does then we should have no
|
|
|
|
# problem building for i386.
|
|
|
|
LIBC_COMPILER_BUILTIN_INLINED(
|
|
|
|
[__sync_val_compare_and_swap],
|
|
|
|
[int a, b, c; __sync_val_compare_and_swap (&a, b, c);],
|
|
|
|
[-O0],
|
|
|
|
[libc_cv_unsupported_i386=no],
|
|
|
|
[AC_MSG_ERROR([
|
|
|
|
*** Building with -march=i386/-mcpu=i386 is not supported.
|
2013-04-18 02:13:20 +02:00
|
|
|
*** Please use host i786, i686, i586, or i486.
|
|
|
|
*** For example: /source/glibc/configure CFLAGS='-O2 -march=i686' ...])])
|
2013-04-06 18:00:35 +02:00
|
|
|
|
2012-03-07 21:51:54 +01:00
|
|
|
AC_CHECK_HEADER([cpuid.h], ,
|
|
|
|
[AC_MSG_ERROR([gcc must provide the <cpuid.h> header])],
|
|
|
|
[/* No default includes. */])
|
2009-08-02 19:38:44 +02:00
|
|
|
|
2009-07-03 11:48:56 +02:00
|
|
|
dnl Check if -msse4 works.
|
|
|
|
AC_CACHE_CHECK(for SSE4 support, libc_cv_cc_sse4, [dnl
|
2012-03-21 17:33:57 +01:00
|
|
|
LIBC_TRY_CC_OPTION([-msse4], [libc_cv_cc_sse4=yes], [libc_cv_cc_sse4=no])
|
|
|
|
])
|
2009-07-03 11:48:56 +02:00
|
|
|
if test $libc_cv_cc_sse4 = yes; then
|
|
|
|
AC_DEFINE(HAVE_SSE4_SUPPORT)
|
|
|
|
fi
|
2013-03-20 23:37:06 +01:00
|
|
|
LIBC_CONFIG_VAR([config-cflags-sse4], [$libc_cv_cc_sse4])
|
2010-03-05 06:30:17 +01:00
|
|
|
|
|
|
|
dnl Check if -Wa,-mtune=i686 works.
|
|
|
|
AC_CACHE_CHECK(for assembler -mtune=i686 support, libc_cv_as_i686, [dnl
|
2012-03-21 17:33:57 +01:00
|
|
|
LIBC_TRY_CC_OPTION([-Wa,-mtune=i686],
|
|
|
|
[libc_cv_as_i686=yes],
|
|
|
|
[libc_cv_as_i686=no])
|
|
|
|
])
|
2013-03-20 23:37:06 +01:00
|
|
|
LIBC_CONFIG_VAR([config-asflags-i686], [$libc_cv_as_i686])
|
2010-04-15 07:27:59 +02:00
|
|
|
|
|
|
|
dnl Check if -mavx works.
|
|
|
|
AC_CACHE_CHECK(for AVX support, libc_cv_cc_avx, [dnl
|
2012-03-21 17:33:57 +01:00
|
|
|
LIBC_TRY_CC_OPTION([-mavx], [libc_cv_cc_avx=yes], [libc_cv_cc_avx=no])
|
|
|
|
])
|
2010-04-15 07:27:59 +02:00
|
|
|
if test $libc_cv_cc_avx = yes; then
|
|
|
|
AC_DEFINE(HAVE_AVX_SUPPORT)
|
|
|
|
fi
|
2013-03-20 23:37:06 +01:00
|
|
|
LIBC_CONFIG_VAR([config-cflags-avx], [$libc_cv_cc_avx])
|
2011-02-03 01:28:44 +01:00
|
|
|
|
2012-01-28 20:48:46 +01:00
|
|
|
dnl Check if -msse2avx works.
|
|
|
|
AC_CACHE_CHECK(for AVX encoding of SSE instructions, libc_cv_cc_sse2avx, [dnl
|
2012-03-21 17:33:57 +01:00
|
|
|
LIBC_TRY_CC_OPTION([-msse2avx],
|
|
|
|
[libc_cv_cc_sse2avx=yes],
|
|
|
|
[libc_cv_cc_sse2avx=no])
|
|
|
|
])
|
2012-01-28 20:48:46 +01:00
|
|
|
if test $libc_cv_cc_sse2avx = yes; then
|
|
|
|
AC_DEFINE(HAVE_SSE2AVX_SUPPORT)
|
|
|
|
fi
|
2013-03-20 23:37:06 +01:00
|
|
|
LIBC_CONFIG_VAR([config-cflags-sse2avx], [$libc_cv_cc_sse2avx])
|
2012-01-28 20:48:46 +01:00
|
|
|
|
2011-10-21 04:43:15 +02:00
|
|
|
dnl Check if -mfma4 works.
|
|
|
|
AC_CACHE_CHECK(for FMA4 support, libc_cv_cc_fma4, [dnl
|
2012-03-21 17:33:57 +01:00
|
|
|
LIBC_TRY_CC_OPTION([-mfma4], [libc_cv_cc_fma4=yes], [libc_cv_cc_fma4=no])
|
|
|
|
])
|
2011-10-21 04:43:15 +02:00
|
|
|
if test $libc_cv_cc_fma4 = yes; then
|
|
|
|
AC_DEFINE(HAVE_FMA4_SUPPORT)
|
|
|
|
fi
|
2013-03-20 23:37:06 +01:00
|
|
|
LIBC_CONFIG_VAR([have-mfma4], [$libc_cv_cc_fma4])
|
2011-10-21 04:43:15 +02:00
|
|
|
|
2011-02-03 01:28:44 +01:00
|
|
|
dnl Check if -mno-vzeroupper works.
|
|
|
|
AC_CACHE_CHECK(for -mno-vzeroupper support, libc_cv_cc_novzeroupper, [dnl
|
2012-03-21 17:33:57 +01:00
|
|
|
LIBC_TRY_CC_OPTION([-mno-vzeroupper],
|
|
|
|
[libc_cv_cc_novzeroupper=yes],
|
|
|
|
[libc_cv_cc_novzeroupper=no])
|
|
|
|
])
|
2013-03-20 23:37:06 +01:00
|
|
|
LIBC_CONFIG_VAR([config-cflags-novzeroupper], [$libc_cv_cc_novzeroupper])
|
2012-03-19 21:00:15 +01:00
|
|
|
|
2015-07-09 15:50:12 +02:00
|
|
|
dnl Check whether asm supports Intel MPX
|
|
|
|
AC_CACHE_CHECK(for Intel MPX support, libc_cv_asm_mpx, [dnl
|
|
|
|
cat > conftest.s <<\EOF
|
|
|
|
bndmov %bnd0,(%esp)
|
|
|
|
EOF
|
|
|
|
if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
|
|
|
|
libc_cv_asm_mpx=yes
|
|
|
|
else
|
|
|
|
libc_cv_asm_mpx=no
|
|
|
|
fi
|
|
|
|
rm -f conftest*])
|
|
|
|
if test $libc_cv_asm_mpx == yes; then
|
|
|
|
AC_DEFINE(HAVE_MPX_SUPPORT)
|
|
|
|
fi
|
|
|
|
|
2014-07-14 16:58:27 +02:00
|
|
|
dnl Check if -mavx2 works.
|
|
|
|
AC_CACHE_CHECK(for AVX2 support, libc_cv_cc_avx2, [dnl
|
|
|
|
LIBC_TRY_CC_OPTION([-mavx2], [libc_cv_cc_avx2=yes], [libc_cv_cc_avx2=no])
|
|
|
|
])
|
|
|
|
if test $libc_cv_cc_avx2 = yes; then
|
|
|
|
AC_DEFINE(HAVE_AVX2_SUPPORT)
|
|
|
|
fi
|
|
|
|
LIBC_CONFIG_VAR([config-cflags-avx2], [$libc_cv_cc_avx2])
|
|
|
|
|
2014-06-25 22:26:14 +02:00
|
|
|
AC_DEFINE(USE_REGPARMS)
|
|
|
|
|
2012-03-19 21:00:15 +01:00
|
|
|
dnl It is always possible to access static and hidden symbols in an
|
|
|
|
dnl position independent way.
|
|
|
|
AC_DEFINE(PI_STATIC_AND_HIDDEN)
|