Switch -rdynamic to -Wl,--export-dynamic
Closed / Accepted573395ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2002-06-24 23:50:47
As the summary indicates, the patch replaces the "-rdynamic" variable in LDFLAGS with "-Wl,--export-dynamic". The "-rdynamic" flag isn't documented in GCC or the GNU Binutils, and after hunting around for what it does, I eventually stumbled across it buried deep in the specs file for GCC. It passes the "--export-dynamic" flag to the linker. So, it seems worthwhile to simply do this directly. There won't be any mystery as to what the flag does, and the "--export-dynamic" flag is documented in the linker info/man pages, so someone trying to figure out why tcl/tk are built like they are should have a simpler time deciphering the build log or peeking around the Makefile. I've built both tcl8.4b1 and tk8.4b1 with this change to the tcl.m4 files. The patch is trivial, so I'll cut and paste it below. My thanks to everyone working on Tcl/Tk!. Art Haas [email protected] Index: tcl.m4 =================================================================== RCS file: /cvsroot/tcl/tcl/unix/tcl.m4,v retrieving revision 1.67 diff -u -r1.67 tcl.m4 --- tcl.m4 6 Jun 2002 17:37:57 -0000 1.67 +++ tcl.m4 24 Jun 2002 23:39:49 -0000 @@ -905,7 +929,7 @@ SHLIB_LD="${CC} -shared" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - LDFLAGS="-rdynamic" + LDFLAGS="-Wl,--export-dynamic" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' else @@ -940,7 +964,7 @@ SHLIB_LD="${CC} -shared" DL_OBJS="" DL_LIBS="-ldl" - LDFLAGS="-rdynamic" + LDFLAGS="-Wl,--export-dynamic" LD_SEARCH_FLAGS="" else AC_CHECK_HEADER(dld.h, [ AC_CHECK_HEADER(dld.h, [
mdejongplain2002-06-25 06:57:47
Logged In: YES user_id=90858 I don't see a problem with this patch, but the tree is frozen right now. Since this is not a bug fix, it will have to wait until after the 8.4 release.
mdejongplain2002-07-23 04:13:27
Logged In: YES user_id=90858 I looked at the docs a bit more and I have to admit I am not sure what exactly this -rdynamic flag is being used for. The tclsh executable is being linked to libtcl8.4.so, and a non-stub extension should also include the library in the link line, so what exactly is this flag doing? It appears that it is only used under Linux and GNU Hurd. The only description of the change that added this flag was: 1999-06-16 <[email protected]> * unix/tcl.m4: Numerous build changes to make Tcl conform to the proposed TEA spec I have compiled without the flag and loaded libs and things seem to work just fine under RH 6.2.
mdejongplain2003-03-28 07:28:18
Logged In: YES user_id=90858 Added to CVS on 2003-03-27.
Log in (anonymous is fine) to add a comment.