tune distro mode
authorAndreas Beckmann <anbe@debian.org>
Mon, 14 Aug 2023 13:53:17 +0000 (14:53 +0100)
committerAndreas Beckmann <anbe@debian.org>
Mon, 14 Aug 2023 13:53:17 +0000 (14:53 +0100)
Forwarded: not-needed

Gbp-Pq: Name distro.patch

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

index 11bc2382c9ac673e6cd0d6517303d03335cd4ebc..c29eed45f573188e42071884f76dee458d0c1429 100644 (file)
@@ -1360,6 +1360,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()
@@ -1372,6 +1375,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 c5bbfc1fcc7c540b9d9ee4495f0a7dbbe6cbba33..383464c9b1e2dacb069730fc6f597c592be18da3 100644 (file)
@@ -382,8 +382,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")