diff options
Diffstat (limited to 'lang/pocl/files')
-rw-r--r-- | lang/pocl/files/patch-CMakeLists.txt | 12 | ||||
-rw-r--r-- | lang/pocl/files/patch-config.h.in.cmake | 8 | ||||
-rw-r--r-- | lang/pocl/files/patch-lib_CL_devices_cpuinfo.c | 16 | ||||
-rw-r--r-- | lang/pocl/files/patch-lib_CL_pocl__timing.c | 4 | ||||
-rw-r--r-- | lang/pocl/files/patch-pocld_common.cc | 13 | ||||
-rw-r--r-- | lang/pocl/files/patch-pocld_daemon.cc | 12 | ||||
-rw-r--r-- | lang/pocl/files/patch-pocld_pocld.cc | 11 | ||||
-rw-r--r-- | lang/pocl/files/pocld.in | 28 |
8 files changed, 84 insertions, 20 deletions
diff --git a/lang/pocl/files/patch-CMakeLists.txt b/lang/pocl/files/patch-CMakeLists.txt index ac4253d87ac6..1b1987ab6288 100644 --- a/lang/pocl/files/patch-CMakeLists.txt +++ b/lang/pocl/files/patch-CMakeLists.txt @@ -1,12 +1,12 @@ ---- CMakeLists.txt.orig 2022-06-10 10:09:05 UTC +--- CMakeLists.txt.orig 2025-05-21 11:53:16 UTC +++ CMakeLists.txt -@@ -394,6 +394,9 @@ find_package(Hwloc) - set(ENABLE_HWLOC ON CACHE BOOL "Hwloc" FORCE) +@@ -466,6 +466,9 @@ endfunction() endif() + endfunction() +include(CheckIncludeFiles) -+check_include_files("sys/types.h;sys/sysctl.h" HAVE_SYSCTL_H) ++check_include_files("sys/sysctl.h" HAVE_SYSCTL_H) + - include(sanitizers) - + function(rename_if_different SRC DST EXEC) + if(EXISTS "${DST}") diff --git a/lang/pocl/files/patch-config.h.in.cmake b/lang/pocl/files/patch-config.h.in.cmake index 6f507f989de8..d6b0d26ce2a7 100644 --- a/lang/pocl/files/patch-config.h.in.cmake +++ b/lang/pocl/files/patch-config.h.in.cmake @@ -1,11 +1,11 @@ ---- config.h.in.cmake.orig 2022-06-10 10:09:05 UTC +--- config.h.in.cmake.orig 2025-05-21 11:53:16 UTC +++ config.h.in.cmake -@@ -57,6 +57,8 @@ +@@ -88,6 +88,8 @@ - #cmakedefine HAVE_VFORK + #cmakedefine HAVE_LINUX_VSOCK_H +#cmakedefine HAVE_SYSCTL_H + #cmakedefine HAVE_CLOCK_GETTIME - #cmakedefine HAVE_FDATASYNC + #cmakedefine HOST_COMPILER_SUPPORTS_FLOAT16 diff --git a/lang/pocl/files/patch-lib_CL_devices_cpuinfo.c b/lang/pocl/files/patch-lib_CL_devices_cpuinfo.c index ce0187187300..7702df8abd81 100644 --- a/lang/pocl/files/patch-lib_CL_devices_cpuinfo.c +++ b/lang/pocl/files/patch-lib_CL_devices_cpuinfo.c @@ -1,10 +1,10 @@ ---- lib/CL/devices/cpuinfo.c.orig 2022-06-10 10:09:05 UTC +--- lib/CL/devices/cpuinfo.c.orig 2025-05-21 11:53:16 UTC +++ lib/CL/devices/cpuinfo.c @@ -34,6 +34,12 @@ #include "config.h" #include "cpuinfo.h" -+#ifdef HAVE_SYSCTL_H ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) +# include <sys/types.h> +# include <sys/sysctl.h> +#endif @@ -76,8 +76,8 @@ * Detects the number of parallel hardware threads supported by * the CPU by parsing the cpuinfo. @@ -235,6 +281,19 @@ pocl_cpuinfo_detect_compute_unit_count() - } - return -1; + } + return -1; } +#else +/** @@ -103,9 +103,9 @@ /* default vendor and vendor_id, in case it cannot be found by other means */ device->vendor = cpuvendor_default; if (device->vendor_id == 0) -@@ -404,7 +464,26 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_device_id devi - char *new_name = (char*)malloc (len); - snprintf (new_name, len, "%s-%s", device->short_name, start); +@@ -408,7 +468,26 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_device_id devi + snprintf (new_name, len, "%s-%s-%s", device->short_name, + (device->llvm_cpu ? device->llvm_cpu : ""), start); device->long_name = new_name; +#elif defined(HAVE_SYSCTL_H) + int mib[2]; @@ -130,7 +130,7 @@ /* If the vendor_id field is still empty, we should get the PCI ID associated * with the CPU vendor (if there is one), to be ready for the (currently * provisional) OpenCL 3.0 specification that has finally clarified the -@@ -415,13 +494,23 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_device_id devi +@@ -419,13 +498,23 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_device_id devi */ if (!device->vendor_id) { diff --git a/lang/pocl/files/patch-lib_CL_pocl__timing.c b/lang/pocl/files/patch-lib_CL_pocl__timing.c index 5450f1b75652..2c307fffca44 100644 --- a/lang/pocl/files/patch-lib_CL_pocl__timing.c +++ b/lang/pocl/files/patch-lib_CL_pocl__timing.c @@ -1,6 +1,6 @@ ---- lib/CL/pocl_timing.c.orig 2022-06-10 10:09:05 UTC +--- lib/CL/pocl_timing.c.orig 2025-05-21 11:53:16 UTC +++ lib/CL/pocl_timing.c -@@ -69,8 +69,8 @@ uint64_t pocl_gettimemono_ns() { +@@ -74,8 +74,8 @@ uint64_t pocl_gettimemono_ns() { struct timespec timespec; # ifdef CLOCK_MONOTONIC_RAW /* Linux */ clock_gettime(CLOCK_MONOTONIC_RAW, ×pec); diff --git a/lang/pocl/files/patch-pocld_common.cc b/lang/pocl/files/patch-pocld_common.cc new file mode 100644 index 000000000000..2a6c2b17aee0 --- /dev/null +++ b/lang/pocl/files/patch-pocld_common.cc @@ -0,0 +1,13 @@ +--- pocld/common.cc.orig 2025-06-02 18:01:19 UTC ++++ pocld/common.cc +@@ -35,6 +35,10 @@ + #include <sys/uio.h> + #include <unistd.h> + ++#ifdef __FreeBSD__ ++#include <netinet/in.h> ++#endif ++ + void replyID(Reply *rep, ReplyMessageType t, uint32_t id) { + rep->rep.message_type = t; + rep->rep.failed = 0; diff --git a/lang/pocl/files/patch-pocld_daemon.cc b/lang/pocl/files/patch-pocld_daemon.cc new file mode 100644 index 000000000000..a7699b30d32d --- /dev/null +++ b/lang/pocl/files/patch-pocld_daemon.cc @@ -0,0 +1,12 @@ +--- pocld/daemon.cc.orig 2025-06-02 18:16:16 UTC ++++ pocld/daemon.cc +@@ -28,6 +28,9 @@ + #include <net/if.h> + #include <netdb.h> + #include <netinet/tcp.h> ++#ifdef __FreeBSD__ ++#include <netinet/in.h> ++#endif + #include <numeric> + #include <random> + #include <set> diff --git a/lang/pocl/files/patch-pocld_pocld.cc b/lang/pocl/files/patch-pocld_pocld.cc new file mode 100644 index 000000000000..6e1a3c78dcdf --- /dev/null +++ b/lang/pocl/files/patch-pocld_pocld.cc @@ -0,0 +1,11 @@ +--- pocld/pocld.cc.orig 2025-05-21 11:53:16 UTC ++++ pocld/pocld.cc +@@ -27,7 +27,7 @@ + #include <unistd.h> + #include <CL/opencl.hpp> + +-#ifdef __linux__ ++#if defined(__linux__) || defined(__FreeBSD__) + #include <sys/resource.h> + #endif + diff --git a/lang/pocl/files/pocld.in b/lang/pocl/files/pocld.in new file mode 100644 index 000000000000..20f97cf3a892 --- /dev/null +++ b/lang/pocl/files/pocld.in @@ -0,0 +1,28 @@ +#!/bin/sh +# +# + +# PROVIDE: pocld +# REQUIRE: NETWORKING sysctl +# KEYWORD: shutdown +# +# To enable this service, place +# pocld_enable="YES" +# in /etc/rc.conf[.local] + +. /etc/rc.subr + +name="pocld" +rcvar=pocld_enable + +# read settings, set defaults +load_rc_config ${name} + +: ${pocld_enable:="NO"} +#: ${pocld_args:="-a localhost -p 6060"} + +command="/usr/local/bin/${name}" +pidfile="/var/run/${name}.pid" +extra_commands="reload" + +run_rc_command "$1" |