diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2022-03-04 14:41:17 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2022-03-04 14:41:17 +0100 |
| commit | 9d65062d35381320c4b0b82b012936ecf97f8ba3 (patch) | |
| tree | a5666b024e6f8b67305c305fb8a7146b6ecd6cec /src/elfs | |
| parent | 2bd78e25fd992f0e1f4f98d1ab0c2027d60def7f (diff) | |
| download | box64-9d65062d35381320c4b0b82b012936ecf97f8ba3.tar.gz box64-9d65062d35381320c4b0b82b012936ecf97f8ba3.zip | |
Various changes and improvement centered around steam (but still not good enough)
Diffstat (limited to 'src/elfs')
| -rwxr-xr-x | src/elfs/elfloader.c | 14 | ||||
| -rwxr-xr-x | src/elfs/elfloader_private.h | 1 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/elfs/elfloader.c b/src/elfs/elfloader.c index afd9002d..c5f59375 100755 --- a/src/elfs/elfloader.c +++ b/src/elfs/elfloader.c @@ -1081,6 +1081,20 @@ int LoadNeededLibs(elfheader_t* h, lib_t *maplib, needed_libs_t* neededlibs, lib rpath = tmp; free(origin); } + while(strstr(rpath, "${PLATFORM}")) { + char* platform = strdup("x86_64"); + char* p = strrchr(platform, '/'); + if(p) *p = '\0'; // remove file name to have only full path, without last '/' + char* tmp = (char*)calloc(1, strlen(rpath)-strlen("${PLATFORM}")+strlen(platform)+1); + p = strstr(rpath, "${PLATFORM}"); + memcpy(tmp, rpath, p-rpath); + strcat(tmp, platform); + strcat(tmp, p+strlen("${PLATFORM}")); + if(rpath!=rpathref) + free(rpath); + rpath = tmp; + free(platform); + } if(strchr(rpath, '$')) { printf_log(LOG_INFO, "BOX64: Warning, RPATH with $ variable not supported yet (%s)\n", rpath); } else { diff --git a/src/elfs/elfloader_private.h b/src/elfs/elfloader_private.h index 97319305..c1c34d0c 100755 --- a/src/elfs/elfloader_private.h +++ b/src/elfs/elfloader_private.h @@ -8,7 +8,6 @@ typedef struct dynablocklist_s dynablocklist_t; typedef struct library_s library_t; typedef struct needed_libs_s needed_libs_t; -#include <pthread.h> #include <elf.h> #include "elfloader.h" |