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: fix build on SunOS



details:   https://anonhg.NetBSD.org/pkgsrc/rev/fe88218bd2f8
branches:  trunk
changeset: 371365:fe88218bd2f8
user:      tnn <tnn%pkgsrc.org@localhost>
date:      Sun Jan 09 22:03:17 2022 +0000

description:
cpu_features: fix build on SunOS

diffstat:

 devel/cpu_features/distinfo                         |   4 +-
 devel/cpu_features/patches/patch-src_cpuinfo__x86.c |  23 +++++++++++++++++++-
 2 files changed, 23 insertions(+), 4 deletions(-)

diffs (57 lines):

diff -r f6f870c04cf3 -r fe88218bd2f8 devel/cpu_features/distinfo
--- a/devel/cpu_features/distinfo       Sun Jan 09 20:10:29 2022 +0000
+++ b/devel/cpu_features/distinfo       Sun Jan 09 22:03:17 2022 +0000
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.4 2021/10/26 10:14:27 nia Exp $
+$NetBSD: distinfo,v 1.5 2022/01/09 22:03:17 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) = 948cba79e96fdabfe5ec48780d5f6d5077018b4e
+SHA1 (patch-src_cpuinfo__x86.c) = 91d43472c195f1db377231136725be676419bd0c
diff -r f6f870c04cf3 -r fe88218bd2f8 devel/cpu_features/patches/patch-src_cpuinfo__x86.c
--- a/devel/cpu_features/patches/patch-src_cpuinfo__x86.c       Sun Jan 09 20:10:29 2022 +0000
+++ b/devel/cpu_features/patches/patch-src_cpuinfo__x86.c       Sun Jan 09 22:03:17 2022 +0000
@@ -1,6 +1,7 @@
-$NetBSD: patch-src_cpuinfo__x86.c,v 1.1 2020/12/14 15:07:49 tnn Exp $
+$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
@@ -18,7 +19,16 @@
  #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
-@@ -1239,7 +1240,7 @@ static void DetectSseViaOs(X86Features* 
+@@ -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");
@@ -27,3 +37,12 @@
    // 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



Home | Main Index | Thread Index | Old Index