mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 01:20:42 +00:00
As a slight hack, reference glXWaitGL to pull in libGL in the right order
* Basically we want libGL to be loaded second, after librenderdoc. This is in order to make sure dlsym(RTLD_NEXT) can work. * This can be done just by order in the ld command. Unfortunately since renderdoccmd links directly against librenderdoc (rather than LD_PRELOAD) any symbols exported by librenderdoc resolve, so unless we reference a function that isn't exported by librenderdoc, libGL won't be linked in at all. * I realise this is probably a horrible hack, but it works for now.
This commit is contained in:
@@ -5,9 +5,9 @@ MACROS=-DLINUX \
|
||||
-DRENDERDOC_EXPORTS \
|
||||
-DGIT_COMMIT_HASH='"'$$(git rev-parse HEAD)'"' \
|
||||
-DRENDERDOC_VERSION_STRING='"0.20"'
|
||||
CFLAGS=-c -Wall -Werror -fPIC $(MACROS) -I.
|
||||
CFLAGS=-c -Wall -Werror -fPIC $(MACROS) -I../renderdoc/
|
||||
CPPFLAGS=-std=c++11 -g -Wno-unused -Wno-unknown-pragmas -Wno-reorder
|
||||
LDFLAGS=-L../renderdoc -lrenderdoc
|
||||
LDFLAGS=-L../renderdoc -lrenderdoc -lGL
|
||||
OBJECTS=linux_specific.o
|
||||
|
||||
all: bin/renderdoccmd
|
||||
|
||||
@@ -23,9 +23,19 @@
|
||||
******************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <replay/renderdoc.h>
|
||||
|
||||
// symbol defined in libGL but not librenderdoc.
|
||||
// Forces link of libGL after renderdoc (otherwise all symbols would
|
||||
// be resolved and libGL wouldn't link, meaning dlsym(RTLD_NEXT) would fai
|
||||
extern "C" void glXWaitGL();
|
||||
|
||||
int main()
|
||||
{
|
||||
puts("foo");
|
||||
RENDERDOC_SpawnReplayHost(NULL);
|
||||
|
||||
volatile bool never_run = false;
|
||||
if(never_run) glXWaitGL();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user