From: Amos Jeffries Date: Wed, 2 Oct 2013 12:21:20 +0000 (-0600) Subject: Add --disable-arch-native build option X-Git-Tag: SQUID_3_5_0_1~616 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c8640c9af9f43f037b7065eba138bda66c3e26ae;p=thirdparty%2Fsquid.git Add --disable-arch-native build option The -march-native option is required by Clang 3.2 on some CPU and produces better optimization in binaries by GCC. But building inside a virtual machine environment has been found to cause random Illegal Instruction errors due to mis-detection of CPU. This option is added to permit selective disabling of teh preferred default (which is to use the compiler flag when available). --- diff --git a/configure.ac b/configure.ac index 89855dd319..de127d8c63 100644 --- a/configure.ac +++ b/configure.ac @@ -35,9 +35,22 @@ AC_PROG_CXX AC_LANG([C++]) AC_CANONICAL_HOST -# Clang 3.2 on some CPUs requires -march-native to detect correctly -# GCC 4.3+ can also produce faster executables when its used -SQUID_CC_CHECK_ARGUMENT([squid_cv_check_marchnative],[-march=native]) +# Clang 3.2 on some CPUs requires -march-native to detect correctly. +# GCC 4.3+ can also produce faster executables when its used. +# But building inside a virtual machine environment has been found to +# cause random Illegal Instruction errors due to mis-detection of CPU. +AC_ARG_ENABLE(arch-native, + AS_HELP_STRING([--disable-arch-native],[Some compilers offer CPU-specific + optimizations with the -march=native parameter. + This flag disables the optimization. The default is to + auto-detect compiler support and use where available.]), [ + SQUID_YESNO([$enableval], + [Unrecognized argument to --disable-arch-native: $enableval]) +]) +AC_MSG_NOTICE([CPU -march=native optimization enabled: ${enable_arch_native:=auto}]) +if test "x${enable_arch_native}" != "xno"; then + SQUID_CC_CHECK_ARGUMENT([squid_cv_check_marchnative],[-march=native]) +fi # might be cross-compiling. if test "x$HOSTCXX" = "x"; then