diff options
author | Mihai Moldovan <ionic@ionic.de> | 2017-12-26 04:06:40 +0100 |
---|---|---|
committer | Mihai Moldovan <ionic@ionic.de> | 2017-12-30 03:36:11 +0100 |
commit | 26ab7b8a79e6c901518d9136d00b79e2905dab58 (patch) | |
tree | 5325ef20b6561773c9983a4866f4913eeb25b95d /nx-X11/config/cf | |
parent | e13e31f752c0b204f964ee1df272a6b31ce51189 (diff) | |
download | nx-libs-26ab7b8a79e6c901518d9136d00b79e2905dab58.tar.gz nx-libs-26ab7b8a79e6c901518d9136d00b79e2905dab58.tar.bz2 nx-libs-26ab7b8a79e6c901518d9136d00b79e2905dab58.zip |
nxagent: implement RPATH/RUNPATH override for libX11.
As discussed in ArcticaProject/nx-libs#610, we need a way to load
libNX_X11 as a fake version of libX11 into nxagent's address space.
For doing so, we have to link against libX11 at build-time and specify
a(n) RPATH/RUNPATH to our libX11 -> libNX_X11 compat symlinks.
This commit is essentially doing a cross between options 3 and 4
discussed in the provided GH issue.
We link libX11 early (before specifying -Lcompat_symlinks_dir), so that
the linker finds the "real" libX11 version with the libX11 SONAME. This
leads to our binary depending upon both libX11 and libNX_X11 SONAMEs. We
already always added RPATH/RUNPATH, but these values are not passed down
to dependent libraries.
What happens at run-time is that the loader searches for a libX11
SONAME, takes RPATH/RUNPATH into account and loads our libNX_X11 library
instead via the compat symlinks. This satisfies the libX11 SONAME and
dependent libraries will *not* load the system libX11 version again.
Debian's dpkg-shlibdeps isn't quite happy about this mismatching SONAME
situation, so instruct to look the other way while we're minding our
business.
Fixes: ArcticaProject/nx-libs#610
Diffstat (limited to 'nx-X11/config/cf')
-rw-r--r-- | nx-X11/config/cf/Imake.rules | 4 | ||||
-rw-r--r-- | nx-X11/config/cf/Imake.tmpl | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/nx-X11/config/cf/Imake.rules b/nx-X11/config/cf/Imake.rules index 06b78993b..f53a15bba 100644 --- a/nx-X11/config/cf/Imake.rules +++ b/nx-X11/config/cf/Imake.rules @@ -1103,11 +1103,11 @@ CplusplusProgramTargetHelper(program,SRCS10,OBJS10,DEPLIBS10,locallib,syslib) AllTarget(ProgramTargetName(server)) @@\ ProgramTargetName(server): subdirs objects libs @@\ MoveToBakFile($@) @@\ - LinkRule($@,$(LDOPTIONS),objects,libs $(LDLIBS) syslibs) @@\ + LinkRule($@,$(SERVERLDOPTIONS),objects,libs $(LDLIBS) syslibs) @@\ @@\ Concat(load,server): @@\ MoveToBakFile(ProgramTargetName(server)) @@\ - LinkRule(ProgramTargetName(server),$(LDOPTIONS),objects,libs $(LDLIBS) syslibs) @@\ + LinkRule(ProgramTargetName(server),$(SERVERLDOPTIONS),objects,libs $(LDLIBS) syslibs) @@\ @@\ loadX:: Concat(load,server) @@\ @@\ diff --git a/nx-X11/config/cf/Imake.tmpl b/nx-X11/config/cf/Imake.tmpl index 5d989d1e0..307d00d94 100644 --- a/nx-X11/config/cf/Imake.tmpl +++ b/nx-X11/config/cf/Imake.tmpl @@ -1995,6 +1995,7 @@ XEXT_EXTRA_DEFINES = LDPRELIB = LdPreLib $(INSTALLED_LIBS) LDPOSTLIB = LdPostLib LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(EXTRA_LDOPTIONS) $(THREADS_LDFLAGS) $(LOCAL_LDFLAGS) $(LDPRELIBS) + SERVERLDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(EXTRA_LDOPTIONS) $(THREADS_LDFLAGS) $(LOCAL_LDFLAGS) CXXLDOPTIONS = $(CXXDEBUGFLAGS) $(CXXOPTIONS) $(EXTRA_LDOPTIONS) $(THREADS_CXXLDFLAGS) $(LOCAL_LDFLAGS) $(LDPRELIBS) LDLIBS = $(LDPOSTLIBS) $(THREADS_LIBS) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES) |