clang doesn't support the GCC pragma to enable AVX2, but instead
requires the command line option -mavx2. Since GCC also supports that,
remove the pragma lines and add the -mavx2 option when building the
test. If AVX2 is supported, update QEMU_CFLAGS to include -mavx2 .
Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
configure | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index 714e7fb6a1..227fce6561 100755
--- a/configure
+++ b/configure
@@ -5392,8 +5392,6 @@ fi
if test "$cpuid_h" = "yes" && test "$avx2_opt" != "no"; then
cat > $TMPC << EOF
-#pragma GCC push_options
-#pragma GCC target("avx2")
#include <cpuid.h>
#include <immintrin.h>
static int bar(void *a) {
@@ -5402,7 +5400,8 @@ static int bar(void *a) {
}
int main(int argc, char *argv[]) { return bar(argv[0]); }
EOF
- if compile_object "" ; then
+ if compile_object "-mavx2" ; then
+ QEMU_CFLAGS="-mavx2 $QEMU_CFLAGS"
avx2_opt="yes"
else
avx2_opt="no"
--
2.22.0
On 8/8/19 9:29 PM, Rebecca Cran wrote: > clang doesn't support the GCC pragma to enable AVX2, but instead > requires the command line option -mavx2. Since GCC also supports that, > remove the pragma lines and add the -mavx2 option when building the > test. If AVX2 is supported, update QEMU_CFLAGS to include -mavx2 . > > Signed-off-by: Rebecca Cran <rebecca@bsdio.com> > --- > configure | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) No, this has the same problem as v1. r~
Patchew URL: https://patchew.org/QEMU/20190809042909.74988-1-rebecca@bsdio.com/ Hi, This series failed the asan build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN === #!/bin/bash make docker-image-fedora V=1 NETWORK=1 time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1 === TEST SCRIPT END === CC util/oslib-posix.o CC util/qemu-openpty.o CC util/qemu-thread-posix.o /tmp/qemu-test/src/util/bufferiszero.c:71:13: error: unknown pragma ignored [-Werror,-Wunknown-pragmas] #pragma GCC push_options ^ /tmp/qemu-test/src/util/bufferiszero.c:72:13: error: unknown pragma ignored [-Werror,-Wunknown-pragmas] #pragma GCC target("sse2") ^ /tmp/qemu-test/src/util/bufferiszero.c:108:13: error: unknown pragma ignored [-Werror,-Wunknown-pragmas] #pragma GCC pop_options ^ /tmp/qemu-test/src/util/bufferiszero.c:116:13: error: unknown pragma ignored [-Werror,-Wunknown-pragmas] #pragma GCC push_options ^ /tmp/qemu-test/src/util/bufferiszero.c:117:13: error: unknown pragma ignored [-Werror,-Wunknown-pragmas] #pragma GCC target("sse4") ^ /tmp/qemu-test/src/util/bufferiszero.c:148:13: error: unknown pragma ignored [-Werror,-Wunknown-pragmas] #pragma GCC pop_options ^ /tmp/qemu-test/src/util/bufferiszero.c:149:13: error: unknown pragma ignored [-Werror,-Wunknown-pragmas] #pragma GCC push_options ^ /tmp/qemu-test/src/util/bufferiszero.c:150:13: error: unknown pragma ignored [-Werror,-Wunknown-pragmas] #pragma GCC target("avx2") ^ /tmp/qemu-test/src/util/bufferiszero.c:187:13: error: unknown pragma ignored [-Werror,-Wunknown-pragmas] #pragma GCC pop_options ^ 9 errors generated. The full log is available at http://patchew.org/logs/20190809042909.74988-1-rebecca@bsdio.com/testing.asan/?type=message. --- Email generated automatically by Patchew [https://patchew.org/]. Please send your feedback to patchew-devel@redhat.com
© 2016 - 2025 Red Hat, Inc.