diff options
Diffstat (limited to 'debian/patches/kfreebsd/kfreebsd-openmp.diff')
-rw-r--r-- | debian/patches/kfreebsd/kfreebsd-openmp.diff | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/debian/patches/kfreebsd/kfreebsd-openmp.diff b/debian/patches/kfreebsd/kfreebsd-openmp.diff new file mode 100644 index 0000000..fc6dbf1 --- /dev/null +++ b/debian/patches/kfreebsd/kfreebsd-openmp.diff @@ -0,0 +1,129 @@ +Index: llvm-toolchain-8-8~+rc1/openmp/runtime/src/kmp.h +=================================================================== +--- llvm-toolchain-8-8~+rc1.orig/openmp/runtime/src/kmp.h ++++ llvm-toolchain-8-8~+rc1/openmp/runtime/src/kmp.h +@@ -1077,6 +1077,10 @@ extern kmp_uint64 __kmp_now_nsec(); + /* TODO: tune for KMP_OS_OPENBSD */ + #define KMP_INIT_WAIT 1024U /* initial number of spin-tests */ + #define KMP_NEXT_WAIT 512U /* susequent number of spin-tests */ ++#elif KMP_OS_KFREEBSD ++/* TODO: tune for KMP_OS_KFREEBSD */ ++#define KMP_INIT_WAIT 1024U /* initial number of spin-tests */ ++#define KMP_NEXT_WAIT 512U /* susequent number of spin-tests */ + #endif + + #if KMP_ARCH_X86 || KMP_ARCH_X86_64 +Index: llvm-toolchain-8-8~+rc1/openmp/runtime/src/kmp_ftn_entry.h +=================================================================== +--- llvm-toolchain-8-8~+rc1.orig/openmp/runtime/src/kmp_ftn_entry.h ++++ llvm-toolchain-8-8~+rc1/openmp/runtime/src/kmp_ftn_entry.h +@@ -535,7 +535,7 @@ int FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_ + int gtid; + + #if KMP_OS_DARWIN || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || \ +- KMP_OS_HURD ++ KMP_OS_HURD || KMP_OS_KFREEBSD + gtid = __kmp_entry_gtid(); + #elif KMP_OS_WINDOWS + if (!__kmp_init_parallel || +Index: llvm-toolchain-8-8~+rc1/openmp/runtime/src/kmp_platform.h +=================================================================== +--- llvm-toolchain-8-8~+rc1.orig/openmp/runtime/src/kmp_platform.h ++++ llvm-toolchain-8-8~+rc1/openmp/runtime/src/kmp_platform.h +@@ -19,6 +19,7 @@ + #define KMP_OS_LINUX 0 + #define KMP_OS_DRAGONFLY 0 + #define KMP_OS_FREEBSD 0 ++#define KMP_OS_KFREEBSD 0 + #define KMP_OS_NETBSD 0 + #define KMP_OS_OPENBSD 0 + #define KMP_OS_DARWIN 0 +@@ -57,6 +58,11 @@ + #define KMP_OS_FREEBSD 1 + #endif + ++#if (defined __FreeBSD_kernel__) ++#undef KMP_OS_KFREEBSD ++#define KMP_OS_KFREEBSD 1 ++#endif ++ + #if (defined __NetBSD__) + #undef KMP_OS_NETBSD + #define KMP_OS_NETBSD 1 +@@ -79,12 +85,12 @@ + + #if (1 != \ + KMP_OS_LINUX + KMP_OS_DRAGONFLY + KMP_OS_FREEBSD + KMP_OS_NETBSD + \ +- KMP_OS_OPENBSD + KMP_OS_DARWIN + KMP_OS_WINDOWS + KMP_OS_HURD) ++ KMP_OS_OPENBSD + KMP_OS_DARWIN + KMP_OS_WINDOWS + KMP_OS_HURD + KMP_OS_KFREEBSD) + #error Unknown OS + #endif + + #if KMP_OS_LINUX || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || \ +- KMP_OS_OPENBSD || KMP_OS_DARWIN || KMP_OS_HURD ++ KMP_OS_OPENBSD || KMP_OS_DARWIN || KMP_OS_HURD || KMP_OS_KFREEBSD + #undef KMP_OS_UNIX + #define KMP_OS_UNIX 1 + #endif +Index: llvm-toolchain-8-8~+rc1/openmp/runtime/src/kmp_runtime.cpp +=================================================================== +--- llvm-toolchain-8-8~+rc1.orig/openmp/runtime/src/kmp_runtime.cpp ++++ llvm-toolchain-8-8~+rc1/openmp/runtime/src/kmp_runtime.cpp +@@ -8076,7 +8076,7 @@ __kmp_determine_reduction_method( + #if KMP_ARCH_X86_64 || KMP_ARCH_PPC64 || KMP_ARCH_AARCH64 || KMP_ARCH_MIPS64 + + #if KMP_OS_LINUX || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || \ +- KMP_OS_OPENBSD || KMP_OS_WINDOWS || KMP_OS_DARWIN || KMP_OS_HURD ++ KMP_OS_OPENBSD || KMP_OS_WINDOWS || KMP_OS_DARWIN || KMP_OS_HURD || KMP_OS_KFREEBSD + + int teamsize_cutoff = 4; + +@@ -8104,7 +8104,7 @@ __kmp_determine_reduction_method( + + #elif KMP_ARCH_X86 || KMP_ARCH_ARM || KMP_ARCH_AARCH || KMP_ARCH_MIPS + +-#if KMP_OS_LINUX || KMP_OS_WINDOWS || KMP_OS_HURD ++#if KMP_OS_LINUX || KMP_OS_WINDOWS || KMP_OS_HURD || KMP_OS_KFREEBSD + + // basic tuning + +Index: llvm-toolchain-8-8~+rc1/openmp/runtime/src/z_Linux_util.cpp +=================================================================== +--- llvm-toolchain-8-8~+rc1.orig/openmp/runtime/src/z_Linux_util.cpp ++++ llvm-toolchain-8-8~+rc1/openmp/runtime/src/z_Linux_util.cpp +@@ -448,7 +448,7 @@ void __kmp_terminate_thread(int gtid) { + static kmp_int32 __kmp_set_stack_info(int gtid, kmp_info_t *th) { + int stack_data; + #if KMP_OS_LINUX || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || \ +- KMP_OS_HURD ++ KMP_OS_HURD || KMP_OS_KFREEBSD + pthread_attr_t attr; + int status; + size_t size = 0; +@@ -502,7 +502,7 @@ static void *__kmp_launch_worker(void *t + #endif /* KMP_BLOCK_SIGNALS */ + void *exit_val; + #if KMP_OS_LINUX || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || \ +- KMP_OS_OPENBSD || KMP_OS_HURD ++ KMP_OS_OPENBSD || KMP_OS_HURD || KMP_OS_KFREEBSD + void *volatile padding = 0; + #endif + int gtid; +@@ -1772,7 +1772,7 @@ static int __kmp_get_xproc(void) { + int r = 0; + + #if KMP_OS_LINUX || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || \ +- KMP_OS_OPENBSD || KMP_OS_HURD ++ KMP_OS_OPENBSD || KMP_OS_HURD || KMP_OS_KFREEBSD + + r = sysconf(_SC_NPROCESSORS_ONLN); + +@@ -1967,7 +1967,7 @@ int __kmp_is_address_mapped(void *addr) + int found = 0; + int rc; + +-#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_HURD ++#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_HURD || KMP_OS_KFREEBSD + + /* On GNUish OSes, read the /proc/<pid>/maps pseudo-file to get all the address + ranges mapped into the address space. */ |