Skip to content

Opcache JIT, code simplification for Haiku. #6082

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions ext/opcache/jit/zend_elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#if defined(__FreeBSD__)
#include <sys/sysctl.h>
#elif defined(__HAIKU__)
#include <kernel/image.h>
#include <FindDirectory.h>
#endif
#include <fcntl.h>
#include <unistd.h>
Expand Down Expand Up @@ -67,20 +67,13 @@ void zend_elf_load_symbols(void)
const char *path = getexecname();
int fd = open(path, O_RDONLY);
#elif defined(__HAIKU__)
image_info ii;
int32_t ic = 0;

while (get_next_image_info(0, &ic, &ii) == B_OK) {
if (ii.type == B_APP_IMAGE) {
break;
}
}

if (ii.type != B_APP_IMAGE) {
char path[PATH_MAX];
if (find_path(B_APP_IMAGE_SYMBOL, B_FIND_PATH_IMAGE_PATH,
NULL, path, sizeof(path)) != B_OK) {
return;
}

int fd = open(ii.name, O_RDONLY);
int fd = open(path, O_RDONLY);
#else
// To complete eventually for other ELF platforms.
// Otherwise APPLE is Mach-O
Expand Down
17 changes: 5 additions & 12 deletions ext/opcache/jit/zend_jit_perf_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
// avoiding thread.h inclusion as it conflicts with vtunes types.
extern unsigned int thr_self(void);
#elif defined(__HAIKU__)
#include <kernel/image.h>
#include <FindDirectory.h>
#endif

#include "zend_elf.h"
Expand Down Expand Up @@ -136,20 +136,13 @@ static void zend_jit_perf_jitdump_open(void)
const char *path = getexecname();
fd = open(path, O_RDONLY);
#elif defined(__HAIKU__)
image_info ii;
int32_t ic = 0;

while (get_next_image_info(0, &ic, &ii) == B_OK) {
if (ii.type == B_APP_IMAGE) {
break;
}
}

if (ii.type != B_APP_IMAGE) {
char path[PATH_MAX];
if (find_path(B_APP_IMAGE_SYMBOL, B_FIND_PATH_IMAGE_PATH,
NULL, path, sizeof(path)) != B_OK) {
return;
}

fd = open(ii.name, O_RDONLY);
fd = open(path, O_RDONLY);
#else
fd = -1;
#endif
Expand Down