From 0aa8fff4e0c733420b694d897e70fae5402a0fc5 Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Thu, 4 Nov 2021 15:39:36 -0700 Subject: [PATCH 1/2] Fix build options for native test lib to not inadvertently enable avx-512 Just enable AVX2, so that we can run the lib on any of our test machines. --- src/tests/Interop/PInvoke/Generics/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/tests/Interop/PInvoke/Generics/CMakeLists.txt b/src/tests/Interop/PInvoke/Generics/CMakeLists.txt index 9d6a3f34adc1b2..b69706d111d7bd 100644 --- a/src/tests/Interop/PInvoke/Generics/CMakeLists.txt +++ b/src/tests/Interop/PInvoke/Generics/CMakeLists.txt @@ -22,9 +22,7 @@ if (MSVC) add_compile_options(/arch:AVX2) else() if (NOT CLR_CMAKE_TARGET_ARCH_ARM64 AND NOT CLR_CMAKE_TARGET_ARCH_ARM) - # We need -march=native so we can detect if AVX2 is present. - # ARM does not like that option too and it make no sense to have this detection there. - add_compile_options(-march=native) + add_compile_options(-mavx2) endif() endif() set(SOURCES From 55ba0bb648186578159c60686bffc448818064c4 Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Fri, 5 Nov 2021 08:54:22 -0700 Subject: [PATCH 2/2] only need avx, not avx2 --- src/tests/Interop/PInvoke/Generics/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/Interop/PInvoke/Generics/CMakeLists.txt b/src/tests/Interop/PInvoke/Generics/CMakeLists.txt index b69706d111d7bd..443fa4bf46222d 100644 --- a/src/tests/Interop/PInvoke/Generics/CMakeLists.txt +++ b/src/tests/Interop/PInvoke/Generics/CMakeLists.txt @@ -22,7 +22,7 @@ if (MSVC) add_compile_options(/arch:AVX2) else() if (NOT CLR_CMAKE_TARGET_ARCH_ARM64 AND NOT CLR_CMAKE_TARGET_ARCH_ARM) - add_compile_options(-mavx2) + add_compile_options(-mavx) endif() endif() set(SOURCES