[PATCH app-xdm 13/19] config: use libtool -export-dynamic option for reverse dependencies

Gaetan Nadon memsize at videotron.ca
Thu Sep 9 06:05:15 PDT 2010


This replaces -rdynamic which is a GNU/Linux only solution.

"If symbols from your executable are needed to satisfy unresolved
references in a library you want to dlopen you will have to use
the flag -export-dynamic. You should use -export-dynamic while
linking the executable that calls dlopen."

It is used by the xserver, in Xdmx for example.

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 Makefile.am  |    5 ++++-
 configure.ac |    9 ---------
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index fa1b0c4..15abb8c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -45,7 +45,10 @@ AM_CFLAGS = $(CWARNFLAGS)
 #
 
 xdm_CFLAGS = $(XDM_CFLAGS)
-xdm_LDADD = $(XDM_LIBS) $(XDM_LDFLAGS)
+# The xdm binary needs to export symbols so that they can be used from
+# libXdmGreet.so loaded through a dlopen call from session.c
+xdm_LDFLAGS =  -export-dynamic
+xdm_LDADD = $(XDM_LIBS)
 
 xdm_SOURCES =	\
         auth.c \
diff --git a/configure.ac b/configure.ac
index 129e2fb..880af25 100644
--- a/configure.ac
+++ b/configure.ac
@@ -382,14 +382,6 @@ PKG_CHECK_MODULES(AUTH, xau)
 # Greeter
 #
 
-# The xdm binary needs to export symbols so that they can be used from
-# libXdmGreet.so.  Some platforms require extra flags to do this.
-# gcc should set these flags when -rdynamic is passed to it, other
-# compilers/linkers may need to be added
-if test "x$GCC" = "xyes"; then
-	XDM_LDFLAGS="$XDM_LDFLAGS -rdynamic"
-fi
-
 PKG_CHECK_MODULES(XDMGREET, xt x11 xext)
 
 GREETERLIB="${XDMLIBDIR}/libXdmGreet.so"
@@ -421,7 +413,6 @@ AC_SEARCH_LIBS(crypt, crypt)
 
 AC_SUBST(XDM_CFLAGS)
 AC_SUBST(XDM_LIBS)
-AC_SUBST(XDM_LDFLAGS)
 
 #
 # xdmshell
-- 
1.6.0.4



More information about the xorg-devel mailing list