--- tools/openmp/runtime/src/z_Linux_util.cpp.orig 2016-12-15 10:01:24.000000000 +1100 +++ tools/openmp/runtime/src/z_Linux_util.cpp 2020-05-13 18:55:55.529910000 +1000 @@ -24,7 +24,7 @@ #include "kmp_wait_release.h" #include "kmp_affinity.h" -#if !KMP_OS_FREEBSD && !KMP_OS_NETBSD +#if !KMP_OS_FREEBSD && !KMP_OS_NETBSD && !KMP_OS_BSDSUNIX # include #endif #include @@ -52,7 +52,7 @@ #elif KMP_OS_DARWIN # include # include -#elif KMP_OS_FREEBSD +#elif KMP_OS_FREEBSD || KMP_OS_BSDSUNIX # include #endif @@ -539,7 +539,7 @@ __kmp_set_stack_info( int gtid, kmp_info_t *th ) { int stack_data; -#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD +#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_BSDSUNIX /* Linux* OS only -- no pthread_getattr_np support on OS X* */ pthread_attr_t attr; int status; @@ -554,7 +554,7 @@ /* Fetch the real thread attributes */ status = pthread_attr_init( &attr ); KMP_CHECK_SYSFAIL( "pthread_attr_init", status ); -#if KMP_OS_FREEBSD || KMP_OS_NETBSD +#if KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_BSDSUNIX status = pthread_attr_get_np( pthread_self(), &attr ); KMP_CHECK_SYSFAIL( "pthread_attr_get_np", status ); #else @@ -578,7 +578,7 @@ TCW_4(th->th.th_info.ds.ds_stackgrow, FALSE); return TRUE; } -#endif /* KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD */ +#endif /* KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_BSDSUNIX */ /* Use incremental refinement starting from initial conservative estimate */ TCW_PTR(th->th.th_info.ds.ds_stacksize, 0); TCW_PTR(th -> th.th_info.ds.ds_stackbase, &stack_data); @@ -594,7 +594,7 @@ sigset_t new_set, old_set; #endif /* KMP_BLOCK_SIGNALS */ void *exit_val; -#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD +#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_BSDSUNIX void * volatile padding = 0; #endif int gtid; @@ -645,7 +645,7 @@ KMP_CHECK_SYSFAIL( "pthread_sigmask", status ); #endif /* KMP_BLOCK_SIGNALS */ -#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD +#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_BSDSUNIX if ( __kmp_stkoffset > 0 && gtid > 0 ) { padding = KMP_ALLOCA( gtid * __kmp_stkoffset ); } @@ -1957,7 +1957,7 @@ int r = 0; - #if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD + #if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_BSDSUNIX r = sysconf( _SC_NPROCESSORS_ONLN ); @@ -2177,7 +2177,7 @@ int found = 0; int rc; - #if KMP_OS_LINUX || KMP_OS_FREEBSD + #if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_BSDSUNIX /* On Linux* OS, read the /proc//maps pseudo-file to get all the address ranges mapped @@ -2240,7 +2240,7 @@ found = 1; }; // if - #elif KMP_OS_FREEBSD || KMP_OS_NETBSD + #elif KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_BSDSUNIX // FIXME(FreeBSD, NetBSD): Implement this found = 1; --- tools/openmp/runtime/src/kmp_wrapper_malloc.h.orig 2015-09-22 06:02:45.000000000 +1000 +++ tools/openmp/runtime/src/kmp_wrapper_malloc.h 2020-05-13 18:56:20.473876000 +1000 @@ -103,7 +103,7 @@ #if KMP_OS_WINDOWS #include // Windows* OS: _alloca() declared in "malloc.h". #define alloca _alloca // Allow to use alloca() with no underscore. -#elif KMP_OS_FREEBSD || KMP_OS_NETBSD +#elif KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_BSDSUNIX // Declared in "stdlib.h". #elif KMP_OS_UNIX #include // Linux* OS and OS X*: alloc() declared in "alloca". --- tools/openmp/runtime/src/kmp_runtime.cpp.orig 2017-01-21 10:31:21.000000000 +1100 +++ tools/openmp/runtime/src/kmp_runtime.cpp 2020-05-13 18:57:12.855593000 +1000 @@ -7571,7 +7571,7 @@ #if KMP_ARCH_X86_64 || KMP_ARCH_PPC64 || KMP_ARCH_AARCH64 || KMP_ARCH_MIPS64 - #if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_WINDOWS || KMP_OS_DARWIN + #if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_WINDOWS || KMP_OS_DARWIN || KMP_OS_BSDSUNIX int teamsize_cutoff = 4; @@ -7593,7 +7593,7 @@ } #else #error "Unknown or unsupported OS" - #endif // KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_WINDOWS || KMP_OS_DARWIN + #endif // KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_WINDOWS || KMP_OS_DARWIN || KMP_OS_BSDSUNIX #elif KMP_ARCH_X86 || KMP_ARCH_ARM || KMP_ARCH_AARCH || KMP_ARCH_MIPS --- tools/openmp/runtime/src/kmp_ftn_entry.h.orig 2016-11-15 08:08:35.000000000 +1100 +++ tools/openmp/runtime/src/kmp_ftn_entry.h 2020-05-13 18:57:58.661819000 +1000 @@ -406,7 +406,7 @@ #else int gtid; - #if KMP_OS_DARWIN || KMP_OS_FREEBSD || KMP_OS_NETBSD + #if KMP_OS_DARWIN || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_BSDSUNIX gtid = __kmp_entry_gtid(); #elif KMP_OS_WINDOWS if (!__kmp_init_parallel || --- tools/openmp/runtime/src/kmp.h.orig 2016-12-15 10:01:24.000000000 +1100 +++ tools/openmp/runtime/src/kmp.h 2020-05-13 18:58:33.356707000 +1000 @@ -970,6 +970,10 @@ /* TODO: tune for KMP_OS_FREEBSD */ # define KMP_INIT_WAIT 1024U /* initial number of spin-tests */ # define KMP_NEXT_WAIT 512U /* susequent number of spin-tests */ +#elif KMP_OS_BSDSUNIX +/* TODO: tune for KMP_OS_BSDSUNIX */ +# define KMP_INIT_WAIT 1024U /* initial number of spin-tests */ +# define KMP_NEXT_WAIT 512U /* susequent number of spin-tests */ #elif KMP_OS_NETBSD /* TODO: tune for KMP_OS_NETBSD */ # define KMP_INIT_WAIT 1024U /* initial number of spin-tests */