aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorAaron Lindsay <alindsay@codeaurora.org>2016-07-14 15:38:14 -0400
committerPeter Maydell <peter.maydell@linaro.org>2016-07-29 15:21:43 +0100
commit71fcd8eb6883605707309ad7921d43c8c02a938a (patch)
treebc9fb80a8781644c417af00c04307abebe1f560e /configure
parentcf4b61d5819da0b307502527c01d935bf07c9b38 (diff)
avx2 configure: Disable if static build
This avoids a segfault like the following for at least some 4.8 versions of gcc when configured with --static if avx2 instructions are also enabled: Program received signal SIGSEGV, Segmentation fault. buffer_find_nonzero_offset_ifunc () at ./util/cutils.c:333 333 { (gdb) bt #0 buffer_find_nonzero_offset_ifunc () at ./util/cutils.c:333 #1 0x0000000000939c58 in __libc_start_main () #2 0x0000000000419337 in _start () Signed-off-by: Aaron Lindsay <alindsay@codeaurora.org> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure17
1 files changed, 10 insertions, 7 deletions
diff --git a/configure b/configure
index 879324b0fd..f57fcc689d 100755
--- a/configure
+++ b/configure
@@ -1788,7 +1788,9 @@ fi
##########################################
# avx2 optimization requirement check
-cat > $TMPC << EOF
+
+if test "$static" = "no" ; then
+ cat > $TMPC << EOF
#pragma GCC push_options
#pragma GCC target("avx2")
#include <cpuid.h>
@@ -1801,12 +1803,13 @@ static void *bar_ifunc(void) {return (void*) bar;}
int foo(void *a) __attribute__((ifunc("bar_ifunc")));
int main(int argc, char *argv[]) { return foo(argv[0]);}
EOF
-if compile_object "" ; then
- if has readelf; then
- if readelf --syms $TMPO 2>/dev/null |grep -q "IFUNC.*foo"; then
- avx2_opt="yes"
- fi
- fi
+ if compile_object "" ; then
+ if has readelf; then
+ if readelf --syms $TMPO 2>/dev/null |grep -q "IFUNC.*foo"; then
+ avx2_opt="yes"
+ fi
+ fi
+ fi
fi
#########################################