Can't build ASAN tests on i586 without SSE2

Currently with release_34 branch I get the following on openSUSE 13.1 i586:

[ 88%] Generating ASAN_NOINST_TEST_OBJECTS.asan_fake_stack_test.cc.i386.oIn file included from /home/abuild/rpmbuild/BUILD/llvm/projects/compiler-rt/lib/asan/tests/asan_fake_stack_test.cc:17:
In file included from /home/abuild/rpmbuild/BUILD/llvm/projects/compiler-rt/lib/asan/tests/asan_test_utils.h:45:
/home/abuild/rpmbuild/BUILD/llvm/stage2/bin/…/lib/clang/3.4/include/emmintrin.h:28:2: error: “SSE2 instruction set not enabled”
#error “SSE2 instruction set not enabled”

This used to work so I think this is a regression.

This is strange, #include <emmintrin.h> has been there for ages and SSE2 is pretty old.
Maybe you are using some minimalistic version of vm?

–kcc

Hi,

Hi,

This is strange, #include <emmintrin.h> has been there for ages and SSE2
is pretty old.
Maybe you are using some minimalistic version of vm?

SSE2 support is disabled on purpose. i586 architecture does not have
SSE(2) support. Can we somehow make it optional in the asan tests please?

How to we understand at compile time that SSE2 is not supported?
Does i586 define some symbol like __i386__ or some such?

At least on openSUSE it does:

[~]> gcc -m32 -dM -E - < /dev/null|grep -i i586
#define __i586 1
#define __i586__ 1

Does the following work for you?

Index: asan/tests/asan_test.cc

I will try that but why not just

#if defined(__i686__) || defined(__x86_64__)

Since AFAIK the lowest arch having SSE support is i686 anyway.

Thanks.

Does the following work for you?

I will try that but why not just

#if defined(__i686__) || defined(__x86_64__)

Since AFAIK the lowest arch having SSE support is i686 anyway.

Thanks.

Btw, there are even better defines for SSE/2 support:

gcc -dM -E - < /dev/null|grep -i sse

#define __SSE2_MATH__ 1
#define __SSE_MATH__ 1
#define __SSE2__ 1
#define __SSE__ 1

i686 sounds quite reasonable, try r196375.

Please merge to release_34 :slight_smile:

__i686__ sounds quite reasonable, try r196375.

Please merge to release_34 :slight_smile:

Can you do this? In case you need owner's approval (mine) you've got it.

Sorry I have no commit access. However, I am testing it the __i686__ change
and will report back success/failure.

Please check if this patch works for you in 3.4:

Index: lib/asan/tests/asan_test.cc

Compiles fine. Please merge to release_34. There are some test errors but those look unrelated. Will report those.

Thanks.

done, r196478.