Tcl Source Code

View Ticket
Login
Ticket UUID: 3257396
Title: Remove use of --export-dynamic
Type: RFE Created on: 2011-03-29 13:13:07
Submitter: jan.nijtmans Assigned to: jan.nijtmans
Subsystem: 52. Portability Support Severity:
Priority: 5 Medium Last modified: 2026-11-13 11:18:44
Status: Closed Closed by: serhiy.storchaka
Resolution: Rejected Closed on: 2026-11-13 11:18:43
Version: None
Description:
I couldn't explain it better than Joe English did:

2011/3/17 Joe English <[email protected]>:
> On a related note: Tcl has also flip-flopped between building
> tclsh with and without --export-dynamic / -rdynamic.
> (--export-dynamic means, roughly, "treat symbols in the
> main executable as if they were in an RTLD_GLOBAL shared
> library.")  It might be worth considering nailing this down
> as well; preferably, IMO, settling on linking tclsh and wish
> *without* --export-dynamic.
User Comments:
nijtmans added on 2011-03-29 20:25:26:

File Added - 405812: 3257396.patch

nijtmans added on 2011-03-29 20:26:08:
Attached patch for Tcl. For Tk and TEA it is similar.

dgp added on 2011-04-04 21:58:17:
Don't understand the issues involved, but
I tested the branch against the way we use
Tcl and Tk and had no troubles.

nijtmans added on 2011-04-04 22:08:08:
For more info regarding this, see also the thread:

https://sourceforge.net/mailarchive/forum.php?thread_name=BANLkTinW-pt91b-8w3MnzzNMu8yxnYYjhQ%40mail.gmail.com&forum_name=tcl-core

hobbs added on 2011-04-04 23:19:48:
[excerpted counter-point from tcl-core thread]

I do not believe this is correct.  Reading the website, it notes that

"""Normally, the dynamic symbol table contains only symbols which are used by a dynamic object. [-export-dynamic] option (when creating an ELF file) adds all symbols to the dynamic symbol table (see ld(1) for more information). You need to use this option when there are 'reverse dependencies', i.e., a DL library has unresolved symbols that by convention must be defined in the programs that intend to load these libraries."""

and then I dug up one of the old bugs that requested its addition, Tcl #218952 (Scriptics bug 2998), 8.3.0 change 2000-02-10, matching the use of -rdynamic for Linux at the time.

I believe this reverse dependency is actually important for other users.  The core tests are wholly insufficient to properly test this.  Testing this change would mean testing things like the plugin and other areas where Tcl is linked in and stubs are not necessarily used.

I recommend against this patch - it does not provide any clear value, and has certain use cases noted by former bug submitters and as indicated by the docs above.

serhiy.storchaka added on 2026-11-13 11:18:44:

Closing after hobbs' objection: the jn-frq-3257396 branch was never merged, and Linux builds still link with -Wl,--export-dynamic.


Attachments: