From: David Carlier Date: Wed, 14 Oct 2020 18:49:30 +0000 (+0100) Subject: DragonFlyBSD build update for opcache JIT part. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3841ea338ef2508d467efef9ec45d03162ba695d;p=php DragonFlyBSD build update for opcache JIT part. Closes GH-6339. --- diff --git a/ext/opcache/jit/zend_elf.c b/ext/opcache/jit/zend_elf.c index 58d6fdd72c..ce44b5208b 100644 --- a/ext/opcache/jit/zend_elf.c +++ b/ext/opcache/jit/zend_elf.c @@ -19,7 +19,7 @@ #include #include -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined(__DragonFly__) #include #elif defined(__HAIKU__) #include @@ -55,7 +55,7 @@ void zend_elf_load_symbols(void) int fd = open("/proc/self/exe", O_RDONLY); #elif defined(__NetBSD__) int fd = open("/proc/curproc/exe", O_RDONLY); -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__DragonFly__) char path[PATH_MAX]; size_t pathlen = sizeof(path); int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1}; diff --git a/ext/opcache/jit/zend_jit_perf_dump.c b/ext/opcache/jit/zend_jit_perf_dump.c index 613280c217..8555be2b80 100644 --- a/ext/opcache/jit/zend_jit_perf_dump.c +++ b/ext/opcache/jit/zend_jit_perf_dump.c @@ -32,6 +32,9 @@ # include #elif defined(__NetBSD__) # include +#elif defined(__DragonFly__) +# include +# include #elif defined(__sun) // avoiding thread.h inclusion as it conflicts with vtunes types. extern unsigned int thr_self(void); @@ -124,7 +127,7 @@ static void zend_jit_perf_jitdump_open(void) fd = open("/proc/self/exe", O_RDONLY); #elif defined(__NetBSD__) fd = open("/proc/curproc/exe", O_RDONLY); -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__DragonFly__) char path[PATH_MAX]; size_t pathlen = sizeof(path); int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1}; @@ -226,6 +229,8 @@ static void zend_jit_perf_jitdump_register(const char *name, void *start, size_t thread_id = getthrid(); #elif defined(__NetBSD__) thread_id = _lwp_self(); +#elif defined(__DragonFly__) + thread_id = lwp_gettid(); #elif defined(__sun) thread_id = thr_self(); #endif