tune distro mode
authorAndreas Beckmann <anbe@debian.org>
Wed, 29 Jul 2020 10:52:56 +0000 (11:52 +0100)
committerAndreas Beckmann <anbe@debian.org>
Wed, 29 Jul 2020 10:52:56 +0000 (11:52 +0100)
Forwarded: no-needed

Gbp-Pq: Name distro.patch

CMakeLists.txt
lib/kernel/host/CMakeLists.txt

index 6df8cee3111e2837a3c6b235ce6f41c254c1275d..1ac85034a915ca336b0cf50f1781934d81164cf3 100644 (file)
@@ -1053,10 +1053,16 @@ endif()
 set(KERNELLIB_HOST_DISTRO_VARIANTS 0)
 if(KERNELLIB_HOST_CPU_VARIANTS STREQUAL "distro")
   if(X86_64 OR I386)
+    if("${LLC_HOST_CPU}" STREQUAL "GENERIC")
+      set(HOST_CPU_FORCED 0 CACHE INTERNAL "CPU is forced by user")
+    endif()
     if(HOST_CPU_FORCED)
       message(FATAL_ERROR "Cannot build with CPU autodetection distro variants build, and enforce LLC_HOST_CPU at the same time. Please pick one")
     endif()
     set(KERNELLIB_HOST_CPU_VARIANTS sse2 ssse3 sse41 avx avx_f16c avx_fma4 avx2 avx512)
+    if("${LLC_HOST_CPU}" STREQUAL "GENERIC")
+      list(INSERT KERNELLIB_HOST_CPU_VARIANTS 0 ${LLC_HOST_CPU})
+    endif()
   else()
     message(FATAL_ERROR "Don't know what CPU variants to use for kernel library on this platform.")
   endif()
index c7a1aee77cc6497ce2de6be9ba2be23f260e8be7..37b0844f9c2b8d72d51c8b0115a6582e6b712f46 100644 (file)
@@ -311,8 +311,8 @@ separate_arguments(DEVICE_C_FLAGS)
 function(x86_distro_variant_to_flags VARIANT OUT_LLC_FLAGS OUT_CLANG_FLAGS)
 
   if("${VARIANT}" STREQUAL "sse2")
-    set(CLANG_F "${CLANG_MARCH_FLAG}athlon64")
-    set(LLC_F "-mcpu=athlon64")
+    set(CLANG_F "${CLANG_MARCH_FLAG}x86-64")
+    set(LLC_F "-mcpu=x86-64")
 
   elseif("${VARIANT}" STREQUAL "ssse3")
     set(CLANG_F "${CLANG_MARCH_FLAG}core2")