Skip to content

Commit 0579f8b

Browse files
committed
[PANDORA] Fix build
1 parent 50a2603 commit 0579f8b

3 files changed

Lines changed: 20 additions & 3 deletions

File tree

src/elfs/elfloader.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,6 +2033,9 @@ kh_defaultversion_t* GetWeakDefaultVersion(elfheader_t* h)
20332033
return h?h->weakdefver:NULL;
20342034
}
20352035

2036+
#ifndef STT_GNU_IFUNC
2037+
#define STT_GNU_IFUNC 10
2038+
#endif
20362039

20372040
uintptr_t pltResolver = ~(uintptr_t)0;
20382041
EXPORT void PltResolver(x86emu_t* emu)

src/libtools/stat64_helper.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#define _TIME_BITS 64
22
#define _FILE_OFFSET_BITS 64
3-
3+
#ifdef PANDORA
4+
#define _ATFILE_SOURCE
5+
#endif
46
#include <string.h>
57
#include <sys/stat.h>
68

src/wrapped/wrappedlibc.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2572,7 +2572,6 @@ EXPORT int32_t my_execvp(x86emu_t* emu, const char* path, char* const argv[])
25722572
// fullpath is gone, so the search will only be on PATH, not on BOX86_PATH (is that an issue?)
25732573
return execvp(path, argv);
25742574
}
2575-
25762575
// execvpe should use PATH to search for the program first
25772576
EXPORT int32_t my_execvpe(x86emu_t* emu, const char* path, char* const argv[], char* const envv[])
25782577
{
@@ -2599,22 +2598,35 @@ EXPORT int32_t my_execvpe(x86emu_t* emu, const char* path, char* const argv[], c
25992598
if(self) newargv[1] = emu->context->fullpath;
26002599
if(script) newargv[2] = emu->context->bashpath;
26012600
printf_log(LOG_DEBUG, " => execvp(\"%s\", %p [\"%s\", \"%s\"...:%d])\n", newargv[0], newargv, newargv[1], i?newargv[2]:"", i);
2601+
#ifdef PANDORA
2602+
int ret = execve(newargv[0], newargv, envv);
2603+
#else
26022604
int ret = execvpe(newargv[0], newargv, envv);
2605+
#endif
26032606
box_free(fullpath);
26042607
return ret;
26052608
}
2609+
#ifndef PANDORA
26062610
box_free(fullpath);
2611+
#endif
26072612
if((!strcmp(path + strlen(path) - strlen("/uname"), "/uname") || !strcmp(path, "uname"))
26082613
&& argv[1] && (!strcmp(argv[1], "-m") || !strcmp(argv[1], "-p") || !strcmp(argv[1], "-i"))
26092614
&& !argv[2]) {
26102615
// uname -m is redirected to box86 -m
26112616
path = my_context->box86path;
26122617
char *argv2[3] = { my_context->box86path, argv[1], NULL };
2618+
#ifdef PANDORA
2619+
return execve(fullpath, argv2, envv);
2620+
#else
26132621
return execvpe(path, argv2, envv);
2622+
#endif
26142623
}
2615-
2624+
#ifdef PANDORA
2625+
return execve(fullpath, argv, envv);
2626+
#else
26162627
// fullpath is gone, so the search will only be on PATH, not on BOX86_PATH (is that an issue?)
26172628
return execvpe(path, argv, envv);
2629+
#endif
26182630
}
26192631

26202632
// execvp should use PATH to search for the program first

0 commit comments

Comments
 (0)