Skip to content

Commit

Permalink
dlfaker: Interpose "libEGL.so", not "*/libEGL.so"
Browse files Browse the repository at this point in the history
Referring to 211f719, it turns out that
Firefox is an example of a 3D application that calls
dlopen("libEGL.so", ...).  (This is why we can't have nice things.)
However, when ANGLE opens its EGL interposer, it always does so using a
full pathname.  Thus, it is (hopefully!) safe to assume that VirtualGL's
dlopen() interposer should interpose calls to dlopen("libEGL.so", ...)
but not calls to dlopen("*/libEGL.so", ...).
  • Loading branch information
dcommander committed Feb 26, 2024
1 parent 83875f8 commit 2c98496
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions server/dlfaker.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ void *dlopen(const char *filename, int flag)
|| (!strncmp(filename, "libOpenCL.", 10) && fakeOpenCL)
|| (strstr(filename, "/libOpenCL.") && fakeOpenCL)
#endif
|| !strncmp(filename, "libEGL.so.", 10)
|| strstr(filename, "/libEGL.so.")
|| !strncmp(filename, "libEGL.", 7) || strstr(filename, "/libEGL.so.")
|| !strncmp(filename, "libX11.", 7) || strstr(filename, "/libX11.")
|| (flag & RTLD_LAZY
&& (!strncmp(filename, "libopengl.", 10)
Expand Down
5 changes: 4 additions & 1 deletion server/dlfakerut.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Copyright (C)2006 Sun Microsystems, Inc.
* Copyright (C)2009, 2014-2015, 2017, 2019-2021 D. R. Commander
* Copyright (C)2009, 2014-2015, 2017, 2019-2021, 2024 D. R. Commander
*
* This library is free software and may be redistributed and/or modified under
* the terms of the wxWindows Library License, Version 3.1 or (at your option)
Expand Down Expand Up @@ -374,7 +374,10 @@ int main(int argc, char **argv)
for(i = 1; i < argc; i++)
{
if(!strcasecmp(argv[i], "--prefix") && i < argc - 1)
{
prefix = argv[++i];
libEGL = "libEGL.so.1";
}
else if(!strcasecmp(argv[i], "--glvnd"))
{
libGLX = "libGLX.so";
Expand Down

0 comments on commit 2c98496

Please sign in to comment.