diff options
-rw-r--r-- | ext/opcache/jit/zend_elf.c | 3 | ||||
-rw-r--r-- | ext/opcache/jit/zend_jit_perf_dump.c | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/ext/opcache/jit/zend_elf.c b/ext/opcache/jit/zend_elf.c index 7db7957bef..f8a1325db2 100644 --- a/ext/opcache/jit/zend_elf.c +++ b/ext/opcache/jit/zend_elf.c @@ -61,6 +61,9 @@ void zend_elf_load_symbols(void) return; } int fd = open(path, O_RDONLY); +#elif defined(__sun) + const char *path = getexecname(); + int fd = open(path, O_RDONLY); #else // To complete eventually for other ELF platforms. // Otherwise APPLE is Mach-O diff --git a/ext/opcache/jit/zend_jit_perf_dump.c b/ext/opcache/jit/zend_jit_perf_dump.c index 5ee7f36ef9..663f9ae1e0 100644 --- a/ext/opcache/jit/zend_jit_perf_dump.c +++ b/ext/opcache/jit/zend_jit_perf_dump.c @@ -31,6 +31,9 @@ # include <sys/sysctl.h> #elif defined(__NetBSD__) # include <lwp.h> +#elif defined(__sun) +// avoiding thread.h inclusion as it conflicts with vtunes types. +extern unsigned int thr_self(void); #endif #include "zend_elf.h" @@ -126,6 +129,9 @@ static void zend_jit_perf_jitdump_open(void) return; } fd = open(path, O_RDONLY); +#elif defined(__sun) + const char *path = getexecname(); + fd = open(path, O_RDONLY); #else fd = -1; #endif @@ -209,6 +215,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(__sun) + thread_id = thr_self(); #endif memset(&rec, 0, sizeof(rec)); |