Added BOX86_NOVULKAN to disable loading of vulkan libs

This commit is contained in:
ptitSeb 2021-01-10 11:24:55 +01:00
parent 07c403243d
commit 258f7f9b50
5 changed files with 30 additions and 3 deletions

View File

@ -148,6 +148,11 @@ Disable the load of wrapped GTK libraries
* 0 : default, load wrapped gtk libs if present
* 1 : disable the load of wrapped gtk libs (can be used with Steam, along with STEAM_RUNTIME=1 to use i386 versio of gtk)
#### BOX86_NOVULKAN
Disable the load of vulkan libraries
* 0 : default, load vulkan libraries if present
* 1 : disable the load of vulkan libraries both native and x86 version (can be usefull on Pi4)
#### BOX86_FIX_64BIT_INODES
* 0 : Don't fix 64bit inodes (default)
* 1 : Fix 64bit inodes. Helps when running on filesystems with 64bit inodes, the program uses API functions which doesn't support it and the program doesn't use inodes information.

View File

@ -26,8 +26,9 @@ extern int trace_xmm; // include XMM reg in trace?
extern int trace_emm; // include EMM reg in trace?
extern int allow_missing_libs;
extern int box86_steam;
extern int box86_nopulse; // diabling the use of wrapped pulseaudio
extern int box86_nopulse; // disabling the use of wrapped pulseaudio
extern int box86_nogtk; // disabling the use of wrapped gtk
extern int box86_novulkan; // disabling the use of wrapped vulkan
extern uintptr_t trace_start, trace_end;
extern char* trace_func;
extern uintptr_t fmod_smc_start, fmod_smc_end; // to handle libfmod (from Unreal) SMC (self modifying code)

View File

@ -250,6 +250,12 @@ library_t *NewLibrary(const char* path, box86context_t* context)
return NULL;
}
}
if(box86_novulkan) {
if(strstr(lib->name, "libvulkan.so")==lib->name) {
Free1Library(&lib);
return NULL;
}
}
int notwrapped = FindInCollection(lib->name, &context->box86_emulated_libs);
// And now, actually loading a library
// look for native(wrapped) libs first

View File

@ -85,6 +85,7 @@ int fix_64bit_inodes = 0;
int box86_steam = 0;
int box86_nopulse = 0;
int box86_nogtk = 0;
int box86_novulkan = 0;
char* libGL = NULL;
uintptr_t trace_start = 0, trace_end = 0;
char* trace_func = NULL;
@ -400,7 +401,16 @@ void LoadLogEnv()
box86_nogtk = p[0]-'0';
}
if(box86_nogtk)
printf_log(LOG_INFO, "Disable the use of wraped gtk libs\n");
printf_log(LOG_INFO, "Disable the use of wrapped gtk libs\n");
}
p = getenv("BOX86_NOVULKAN");
if(p) {
if(strlen(p)==1) {
if(p[0]>='0' && p[1]<='0'+1)
box86_novulkan = p[0]-'0';
}
if(box86_novulkan)
printf_log(LOG_INFO, "Disable the use of wrapped vulkan libs\n");
}
p = getenv("BOX86_FIX_64BIT_INODES");
if(p) {
@ -553,6 +563,7 @@ void PrintHelp() {
printf(" BOX86_ALLOWMISSINGLIBS with 1 to allow to continue even if a lib is missing (unadvised, will probably crash later)\n");
printf(" BOX86_NOPULSE=1 to disable the loading of pulseaudio libs\n");
printf(" BOX86_NOGTK=1 to disable the loading of wrapped gtk libs\n");
printf(" BOX86_NOVULKAN=1 to disable the loading of wrapped vulkan libs\n");
printf(" BOX86_JITGDB with 1 to launch \"gdb\" when a segfault is trapped, attached to the offending process\n");
}
@ -646,7 +657,7 @@ void setupTraceInit(box86context_t* context)
if(sscanf(p, "0x%X-0x%X", &trace_start, &trace_end)!=2)
sscanf(p, "%x-%x", &trace_start, &trace_end);
}
if(trace_start)
if(trace_start || trace_end)
SetTraceEmu(trace_start, trace_end);
} else {
if (GetSymbolStartEnd(GetMapSymbol(my_context->maplib), p, &trace_start, &trace_end)) {

View File

@ -360,6 +360,10 @@ static void* find_InternalFreeNotification_Fct(void* fct)
//#define PRE_INIT if(libGL) {lib->priv.w.lib = dlopen(libGL, RTLD_LAZY | RTLD_GLOBAL); lib->path = strdup(libGL);} else
#define PRE_INIT \
if(box86_novulkan) \
return -1;
#define CUSTOM_INIT \
my_lib = lib; \
lib->priv.w.p2 = getVulkanMy(lib); \