pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/cpu_features cpu_features: update to 0.7.0



details:   https://anonhg.NetBSD.org/pkgsrc/rev/34e9d51ce66c
branches:  trunk
changeset: 379214:34e9d51ce66c
user:      tnn <tnn%pkgsrc.org@localhost>
date:      Fri May 13 10:39:35 2022 +0000

description:
cpu_features: update to 0.7.0

API Change
[x86] Embed brand_string and mark FillX86BrandString as deprecated
New code layout - breaking change in cpu_features_macros.h

New features / Enhancements
[cmake] Use of CMAKE_POSITION_INDEPENDENT_CODE instead of BUILD_PIC
Add support for ZHAOXIN CPU
Fix a getauxval comment and expand the Krait idiv workaround
Update AArch64 features to Linux 5.10
Detect Zen 3 (K19) cpus
Detect AVX512 on Darwin use GetDarwinSysCtlByName("hw.optional.avx512f")
Detect Intel's Multi-Precision Add-Carry Instruction Extensions
CPU features for AMD
Update uarch detection for Intel processors
Add cache info for new AMD CPUs (0x8000001D)
[NFC] Add bazel support to cpu_features
Add support for FreeBSD on x86
[cmake] cmake: use CTest default

diffstat:

 devel/cpu_features/Makefile                                              |   8 +-
 devel/cpu_features/distinfo                                              |  15 +-
 devel/cpu_features/patches/patch-CMakeLists.txt                          |  14 +-
 devel/cpu_features/patches/patch-include_cpu__features__macros.h         |   6 +-
 devel/cpu_features/patches/patch-src_cpuinfo__x86.c                      |  48 ----------
 devel/cpu_features/patches/patch-src_impl__aarch64__linux__or__android.c |  15 +++
 devel/cpu_features/patches/patch-src_impl__x86__linux__or__android.c     |  23 ++++
 7 files changed, 60 insertions(+), 69 deletions(-)

diffs (186 lines):

diff -r 42151167fa58 -r 34e9d51ce66c devel/cpu_features/Makefile
--- a/devel/cpu_features/Makefile       Fri May 13 09:49:31 2022 +0000
+++ b/devel/cpu_features/Makefile       Fri May 13 10:39:35 2022 +0000
@@ -1,8 +1,7 @@
-# $NetBSD: Makefile,v 1.5 2020/12/31 10:57:03 nia Exp $
+# $NetBSD: Makefile,v 1.6 2022/05/13 10:39:35 tnn Exp $
 
 GITHUB_TAG=    v${PKGVERSION_NOREV}
-DISTNAME=      cpu_features-0.6.0
-PKGREVISION=   1
+DISTNAME=      cpu_features-0.7.0
 CATEGORIES=    devel
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=google/}
 
@@ -13,7 +12,8 @@
 
 USE_CMAKE=     yes
 USE_LANGUAGES= c c++
-CMAKE_ARGS+=   -DBUILD_PIC=ON
+CMAKE_ARGS+=   -DCMAKE_POSITION_INDEPENDENT_CODE=ON
+CMAKE_ARGS+=   -DBUILD_TESTING=OFF
 
 .include "../../mk/bsd.prefs.mk"
 
diff -r 42151167fa58 -r 34e9d51ce66c devel/cpu_features/distinfo
--- a/devel/cpu_features/distinfo       Fri May 13 09:49:31 2022 +0000
+++ b/devel/cpu_features/distinfo       Fri May 13 10:39:35 2022 +0000
@@ -1,8 +1,9 @@
-$NetBSD: distinfo,v 1.5 2022/01/09 22:03:17 tnn Exp $
+$NetBSD: distinfo,v 1.6 2022/05/13 10:39:35 tnn Exp $
 
-BLAKE2s (cpu_features-0.6.0.tar.gz) = 4c59c3a8b3f9b5beefa5a39fb9cd760eec0f8e95b599954efe11c955042d6296
-SHA512 (cpu_features-0.6.0.tar.gz) = 006a2e05253712cf605ecabccdda63dd9325445f8d145d5e2432c4342332e652f318810997321849be131082db435d88143020fdc85268fba204586cf37eef0d
-Size (cpu_features-0.6.0.tar.gz) = 63255 bytes
-SHA1 (patch-CMakeLists.txt) = a2eace73c45b85fac81b14d3e14b26b89cba74f2
-SHA1 (patch-include_cpu__features__macros.h) = 4d93afe4ac314895f0823b992af463bf39d67379
-SHA1 (patch-src_cpuinfo__x86.c) = 91d43472c195f1db377231136725be676419bd0c
+BLAKE2s (cpu_features-0.7.0.tar.gz) = b442c655fd0e0d8d92a8559459585c73bac39c976fbfbc475089088f155c90fc
+SHA512 (cpu_features-0.7.0.tar.gz) = e602c88c4a104d69dff0297a4c4f8e26d02d548fc35ce2616429ff8280f2a37e9eaa99451a38b7c302907352cf15bdf8c09c2e0e52b09bf4cd3b7e2b21f8ddb0
+Size (cpu_features-0.7.0.tar.gz) = 85986 bytes
+SHA1 (patch-CMakeLists.txt) = 7e8c409b6a4fcb3f98153d33be658d501c17b1c7
+SHA1 (patch-include_cpu__features__macros.h) = 5bef216cceab5442b89351f96c78aa9d1a69ae1f
+SHA1 (patch-src_impl__aarch64__linux__or__android.c) = f4ef0a8273fe403658fd79c80f615e5c3d6b4e5d
+SHA1 (patch-src_impl__x86__linux__or__android.c) = a9b7c73c1d25302c4986f8a732f3ae01ea902f1b
diff -r 42151167fa58 -r 34e9d51ce66c devel/cpu_features/patches/patch-CMakeLists.txt
--- a/devel/cpu_features/patches/patch-CMakeLists.txt   Fri May 13 09:49:31 2022 +0000
+++ b/devel/cpu_features/patches/patch-CMakeLists.txt   Fri May 13 10:39:35 2022 +0000
@@ -1,15 +1,15 @@
-$NetBSD: patch-CMakeLists.txt,v 1.1 2020/12/31 10:03:15 nia Exp $
+$NetBSD: patch-CMakeLists.txt,v 1.2 2022/05/13 10:39:35 tnn Exp $
 
 Recognize earm as arm.
 
---- CMakeLists.txt.orig        2020-10-15 09:09:51.000000000 +0000
+--- CMakeLists.txt.orig        2022-03-08 10:31:24.000000000 +0000
 +++ CMakeLists.txt
-@@ -57,7 +57,7 @@ set(PROCESSOR_IS_POWER FALSE)
- 
- if(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
+@@ -54,7 +54,7 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips
    set(PROCESSOR_IS_MIPS TRUE)
+ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)")
+   set(PROCESSOR_IS_AARCH64 TRUE)
 -elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
 +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|earm)")
    set(PROCESSOR_IS_ARM TRUE)
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64")
-   set(PROCESSOR_IS_AARCH64 TRUE)
+ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(AMD64|amd64)|(^i.86$)")
+   set(PROCESSOR_IS_X86 TRUE)
diff -r 42151167fa58 -r 34e9d51ce66c devel/cpu_features/patches/patch-include_cpu__features__macros.h
--- a/devel/cpu_features/patches/patch-include_cpu__features__macros.h  Fri May 13 09:49:31 2022 +0000
+++ b/devel/cpu_features/patches/patch-include_cpu__features__macros.h  Fri May 13 10:39:35 2022 +0000
@@ -1,11 +1,11 @@
-$NetBSD: patch-include_cpu__features__macros.h,v 1.1 2020/12/14 15:07:49 tnn Exp $
+$NetBSD: patch-include_cpu__features__macros.h,v 1.2 2022/05/13 10:39:35 tnn Exp $
 
 NetBSD support.
 
---- include/cpu_features_macros.h.orig 2020-10-15 09:09:51.000000000 +0000
+--- include/cpu_features_macros.h.orig 2022-03-08 10:31:24.000000000 +0000
 +++ include/cpu_features_macros.h
 @@ -71,6 +71,10 @@
- #define CPU_FEATURES_OS_LINUX_OR_ANDROID
+ #define CPU_FEATURES_OS_FREEBSD
  #endif
  
 +#if defined(__NetBSD__)
diff -r 42151167fa58 -r 34e9d51ce66c devel/cpu_features/patches/patch-src_cpuinfo__x86.c
--- a/devel/cpu_features/patches/patch-src_cpuinfo__x86.c       Fri May 13 09:49:31 2022 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-$NetBSD: patch-src_cpuinfo__x86.c,v 1.2 2022/01/09 22:03:17 tnn Exp $
-
-Use /proc/cpuinfo on NetBSD/x86 for now.
-fix build on SunOS (just don't report any SSE support for now)
-
---- src/cpuinfo_x86.c.orig     2020-10-15 09:09:51.000000000 +0000
-+++ src/cpuinfo_x86.c
-@@ -1,3 +1,4 @@
-+
- // Copyright 2017 Google LLC
- // Copyright 2020 Intel Corporation
- //
-@@ -97,7 +98,7 @@
- // microarchitectures.
- #if defined(CPU_FEATURES_OS_WINDOWS)
- #include <windows.h>  // IsProcessorFeaturePresent
--#elif defined(CPU_FEATURES_OS_LINUX_OR_ANDROID)
-+#elif defined(CPU_FEATURES_OS_LINUX_OR_ANDROID) || defined(CPU_FEATURES_OS_NETBSD)
- #include "internal/filesystem.h"         // Needed to parse /proc/cpuinfo
- #include "internal/stack_line_reader.h"  // Needed to parse /proc/cpuinfo
- #include "internal/string_view.h"        // Needed to parse /proc/cpuinfo
-@@ -106,6 +107,8 @@
- #error "Darwin needs support for sysctlbyname"
- #endif
- #include <sys/sysctl.h>
-+#elif defined(__sun__)
-+#warning No support for SunOS
- #else
- #error "Unsupported OS"
- #endif  // CPU_FEATURES_OS
-@@ -1239,7 +1242,7 @@ static void DetectSseViaOs(X86Features* 
-   features->ssse3 = GetDarwinSysCtlByName("hw.optional.supplementalsse3");
-   features->sse4_1 = GetDarwinSysCtlByName("hw.optional.sse4_1");
-   features->sse4_2 = GetDarwinSysCtlByName("hw.optional.sse4_2");
--#elif defined(CPU_FEATURES_OS_LINUX_OR_ANDROID)
-+#elif defined(CPU_FEATURES_OS_LINUX_OR_ANDROID) || defined(CPU_FEATURES_OS_NETBSD)
-   // Handling Linux platform through /proc/cpuinfo.
-   const int fd = CpuFeatures_OpenFile("/proc/cpuinfo");
-   if (fd >= 0) {
-@@ -1264,6 +1267,8 @@ static void DetectSseViaOs(X86Features* 
-     }
-     CpuFeatures_CloseFile(fd);
-   }
-+#elif defined(__sun__)
-+#warning No support for SunOS
- #else
- #error "Unsupported fallback detection of SSE OS support."
- #endif
diff -r 42151167fa58 -r 34e9d51ce66c devel/cpu_features/patches/patch-src_impl__aarch64__linux__or__android.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/cpu_features/patches/patch-src_impl__aarch64__linux__or__android.c  Fri May 13 10:39:35 2022 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_impl__aarch64__linux__or__android.c,v 1.1 2022/05/13 10:39:35 tnn Exp $
+
+Use /proc/cpuinfo on NetBSD/evbarm-aarch64 for now.
+
+--- src/impl_aarch64_linux_or_android.c.orig   2022-03-08 10:31:24.000000000 +0000
++++ src/impl_aarch64_linux_or_android.c
+@@ -15,7 +15,7 @@
+ #include "cpu_features_macros.h"
+ 
+ #ifdef CPU_FEATURES_ARCH_AARCH64
+-#if defined(CPU_FEATURES_OS_LINUX) || defined(CPU_FEATURES_OS_ANDROID)
++#if defined(CPU_FEATURES_OS_LINUX) || defined(CPU_FEATURES_OS_ANDROID) || defined(CPU_FEATURES_OS_NETBSD)
+ 
+ #include "cpuinfo_aarch64.h"
+ 
diff -r 42151167fa58 -r 34e9d51ce66c devel/cpu_features/patches/patch-src_impl__x86__linux__or__android.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/cpu_features/patches/patch-src_impl__x86__linux__or__android.c      Fri May 13 10:39:35 2022 +0000
@@ -0,0 +1,23 @@
+$NetBSD: patch-src_impl__x86__linux__or__android.c,v 1.1 2022/05/13 10:39:35 tnn Exp $
+
+Use /proc/cpuinfo on NetBSD/x86 for now.
+Add placeholder SunOS implementation to fix the build.
+
+--- src/impl_x86_linux_or_android.c.orig       2022-03-08 10:31:24.000000000 +0000
++++ src/impl_x86_linux_or_android.c
+@@ -15,7 +15,14 @@
+ #include "cpu_features_macros.h"
+ 
+ #ifdef CPU_FEATURES_ARCH_X86
+-#if defined(CPU_FEATURES_OS_LINUX) || defined(CPU_FEATURES_OS_ANDROID)
++#if defined(__sun)
++#include "impl_x86__base_implementation.inl"
++static void OverrideOsPreserves(OsPreserves* os_preserves) {
++}
++static void DetectFeaturesFromOs(X86Info* info, X86Features* features) {
++}
++#endif
++#if defined(CPU_FEATURES_OS_LINUX) || defined(CPU_FEATURES_OS_ANDROID) || defined(CPU_FEATURES_OS_NETBSD)
+ 
+ #include "impl_x86__base_implementation.inl"
+ 



Home | Main Index | Thread Index | Old Index