Skip to content

Commit

Permalink
buildilb: Fix -msse breakage on ARM builds
Browse files Browse the repository at this point in the history
Travis was broken when this patch was accepted, so this was missed.
Non-x86 arches do not like the attribute(target) on main, so conditionalize
the entire thing.

Cc: [email protected] # v15
Signed-off-by: Jason Gunthorpe <[email protected]>
  • Loading branch information
jgunthorpe authored and nmorey committed Jun 11, 2018
1 parent c2080f9 commit 7844b3f
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions buildlib/RDMA_EnableCStd.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,24 @@ endfunction()

function(RDMA_Check_SSE TO_VAR)
set(SSE_CHECK_PROGRAM "
#include <string.h>
#if defined(__i386__)
#include <xmmintrin.h>
#endif
int __attribute__((target(\"sse\"))) main(int argc, char *argv[])
{
int ret = 0;
#if defined(__i386__)
#if defined(__i386__)
#include <string.h>
#include <xmmintrin.h>
int __attribute__((target(\"sse\"))) main(int argc, char *argv[])
{
__m128 tmp = {};
tmp = _mm_loadl_pi(tmp, (__m64 *)&main);
_mm_storel_pi((__m64 *)&main, tmp);
ret = memchr(&tmp, 0, sizeof(tmp)) == &tmp;
#endif
return ret;
}")
return memchr(&tmp, 0, sizeof(tmp)) == &tmp;
}
#else
int main(int argc, char *argv[])
{
return 0;
}
#endif
")

CHECK_C_SOURCE_COMPILES(
"${SSE_CHECK_PROGRAM}"
Expand Down

0 comments on commit 7844b3f

Please sign in to comment.