Make avx2 configure test work with -O2
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Fri, 10 Jun 2016 11:16:17 +0000 (12:16 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 16 Jun 2016 16:39:04 +0000 (18:39 +0200)
When configured with --extra-cflags=-O2 gcc optimised out the test
and the readelf failed the check leaving avx2 disabled.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <1465557378-24105-2-git-send-email-dgilbert@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
configure

index cbe013b6bdc5c88282213375e3454e41911c8067..3c0e2797623ac3055324e8bd515638b6e0be679a 100755 (executable)
--- a/configure
+++ b/configure
@@ -1781,7 +1781,7 @@ fi
 cat > $TMPC << EOF
 static void bar(void) {}
 static void *bar_ifunc(void) {return (void*) bar;}
-static void foo(void) __attribute__((ifunc("bar_ifunc")));
+void foo(void) __attribute__((ifunc("bar_ifunc")));
 int main(void) { foo(); return 0; }
 EOF
 if compile_prog "-mavx2" "" ; then