Tcl Source Code

View Ticket
Login
Ticket UUID: 3135271
Title: Link error due to hidden symbols (CentOS 4.2)
Type: Bug Version: obsolete: 8.6b1.1
Submitter: andygoth Created on: 2010-12-11 21:58:24
Subsystem: 53. Configuration and Build Tools Assigned To: nijtmans
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2010-12-14 05:38:47
Resolution: Fixed Closed By: nijtmans
    Closed on: 2010-12-13 22:38:47
Description:
On CentOS 4.2 (admittedly quite old), the Tcl/Tk build process can't link tclsh nor wish due to Tcl_Init and Tk_MainEx being hidden symbols in their respective lib*8.6.so files.  This is with today's CVS.  I fooled around with -DUSE_TCL_STUBS and similar but was unable to get it to work.

CentOS 4.2 has gcc 3.4.4 and glibc 2.3.4.
User Comments: nijtmans added on 2010-12-14 05:38:47:
Committed to HEAD

andygoth added on 2010-12-14 04:48:55:
That patch fixes it.  Thanks!

Yes, all symbols were hidden.

nijtmans added on 2010-12-13 17:13:48:
>there's quite a thicket of complexity here...

Yes, I know, I wrote it.....   And when a compiler backports features, it becomes more compilcated, unfortunately.

Feedback appreciated (first I would like to know if I am right about my suspicion, before changing anthing!!)

dkf added on 2010-12-13 17:07:06:
The current tcl.m4 SC_CONFIG_CFLAGS checks to see if the -fvisibility=hidden flag works (gcc only), otherwise if can use the __visibility__ attribute on the function (which MODULE_SCOPE is a concealing macro for). However, it also allows overriding of this; there's quite a thicket of complexity here...

nijtmans added on 2010-12-13 04:49:04:
Question: Are Tcl_Init and Tk_MainEx the only hidden symbols, or are simply ALL symbols hidden?

I suspect that the gcc 3.4.4 compiler with CentOS, is modified to support --fvisitiliby=hidden, which
normally is only included with gcc 4.x.  Tcl's configure script picks this up, but tcl.h does not take
that into account, and simply assumes that gcc < 4.0 does not have visibility support. This could
explain why all symbols in the DSO's are hidden.

The solution could be the same as used in zlib: Use the define NO_VIZ when the compiler
has no visibility support, in stead of relying on the gcc version. Here is a patch doing that.

Please try if this patch works as expected.

nijtmans added on 2010-12-13 04:42:35:

File Added - 395948: 3135271.patch

nijtmans added on 2010-12-12 15:31:57:
This must be related to FRQ #2959069, I'll have al look

Attachments: