tune distro mode
authorAndreas Beckmann <anbe@debian.org>
Tue, 5 Jan 2021 01:08:00 +0000 (01:08 +0000)
committerAndreas Beckmann <anbe@debian.org>
Tue, 5 Jan 2021 01:08:00 +0000 (01:08 +0000)
Forwarded: no-needed

Gbp-Pq: Name distro.patch

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

index 87f10c62674811a913edb4c783d6032567e233e7..9712dee44f7e94900a0aad0d8aa66c30fc74d702 100644 (file)
@@ -1041,6 +1041,9 @@ endif()
 
 set(KERNELLIB_HOST_DISTRO_VARIANTS 0)
 if(KERNELLIB_HOST_CPU_VARIANTS STREQUAL "distro")
+  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()
@@ -1051,6 +1054,9 @@ if(KERNELLIB_HOST_CPU_VARIANTS STREQUAL "distro")
   else()
     message(FATAL_ERROR "Don't know what CPU variants to use for kernel library on this platform.")
   endif()
+  if("${LLC_HOST_CPU}" STREQUAL "GENERIC")
+    list(INSERT KERNELLIB_HOST_CPU_VARIANTS 0 ${LLC_HOST_CPU})
+  endif()
   set(KERNELLIB_HOST_DISTRO_VARIANTS 1)
 endif()
 
index 12c193501f08d7033412852d449a160c058e6609..3d25fd4b673de4d81bd60fc952389d4d5a34bc3b 100644 (file)
@@ -317,8 +317,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")