]> granicus.if.org Git - php/commitdiff
Fix JIT build on solaris/illumos
authorDavid Carlier <devnexen@gmail.com>
Sat, 13 Jun 2020 22:18:54 +0000 (23:18 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 16 Jun 2020 09:18:50 +0000 (11:18 +0200)
thr_self to detect the proper thread identifier but all
related typedef'd types conflict with the vtune part.

ext/opcache/jit/zend_elf.c
ext/opcache/jit/zend_jit_perf_dump.c

index 7db7957befdeee3000bede12fd604c57814aca57..f8a1325db213f3f402b7a1b36c8e191e3a9c2c1b 100644 (file)
@@ -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
index 5ee7f36ef914d1a779bb69da63a1f8cfbf5ea88a..663f9ae1e05cca277f43e244f20c08a0eead8a9d 100644 (file)
@@ -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));