Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2011-04-11
15:31 • Closed ticket [3281728fff]: Tcl sources from 2011-04-06 do not build on GCC9 (RH... artifact: d027e61664 user: nijtmans
15:05 • Ticket [3281728fff]: 4 changes artifact: cb77ad4100 user: zoro2
14:31 • Ticket [3281728fff]: 4 changes artifact: 831593c559 user: nijtmans
2011-04-09
14:58 • Ticket [3281728fff]: 1 change artifact: 7d3c506aaa user: nijtmans
14:58 • Ticket [3281728fff]: 4 changes artifact: 49c5bcd7b6 user: nijtmans
06:23 • New ticket [3281728fff]. artifact: 23d132498d user: zoro2

Tcl sources from 2011-04-06 do not build on GCC9 (RH9)

Closed / Fixed3281728fffffffffffffffffffffffffffffffffCreated 16 years agoUpdated 16 years ago
Descriptionplain2011-04-09 06:23:11
Hi,

The issue is configure is detecting that gcc3 supports visibility_hidden, however, visibility default is not detected. This gives an error:

[07:53:28] 2  >> /shared/dev/cookit/sources/tcl-8.6b1.2/generic/tcl.h:2377: visibility arg must be one of "hidden", "protected" or "internal"

This is due to:

#   if defined(__GNUC__) && !defined(NO_VIZ) && !defined(STATIC_BUILD)
#       define DLLEXPORT __attribute__ ((visibility("default")))
#   else
#       define DLLEXPORT
#   endif

Probably configure should also check if "default" is supported as well and ignore it if it's not.

Another approach (from 3137454) is:
#   if defined(__GNUC__) && !defined(NO_VIZ) && !defined(STATIC_BUILD)
#       if __GNUC__ >= 4
#           define DLLEXPORT __attribute__ ((visibility("default")))
#       else
#            define DLLEXPORT
#       endif
#   else
#       define DLLEXPORT
#   endif
nijtmansplain2011-04-09 14:58:31
I'll have a look at this
nijtmans Ticket [3281728fff]: 1 change [History diff]2011-04-09 14:58:32
nijtmansplain2011-04-11 14:31:41
Strange, as : zoro2 reported in Bug #3137454 that it everything worked there. ;-(

Another strange thing: How is it possible that a compiler support -fvisibility=hidden
(the configure script checks for this), but there is no way to set visibility back
to default???? I don't have such an environment, so cannot (and I don't
reallly want) to experiment in such environments to get -fvisibility=hidden
working there.

I only see one way out: revert tcl.h to how it was before in Tcl 8.5, and
simply only allow -fivisilibility=hidden for gcc > 3. This means that
-fivisibility=hidden cannot be used on other compilers which take
over the feature from gcc, but that's how it is: other compilers will
have to use MODULE_SCOPE like it was before ;-(

Anyway, fixed now.
zoro2plain2011-04-11 15:05:30
Thank you for responding to this so quickly. Both static and dynamic versions build fine now. Feel free to close the ticket if you think the fix is final.

I have tested it and it works fine now. I guess GCC3 only allowed "hiding" certain functions instead of having everything hidden vs exported functions visible. So, with the age of GCC3 it makes sense (I will actually try to upgrade my environment to use GCC4 in a few months). 

Just for clarification - #3137454 was about *AppInit.c (which I compile outside of Tcl) failing. Now compiling Tcl failed as well.
nijtmansplain2011-04-11 15:31:59
allow_comments - 1

>Just for clarification - #3137454 was about *AppInit.c (which I compile
>outside of Tcl) failing. Now compiling Tcl failed as well.

That explains what happened: The combination of using MODULE_SCOPE
here and undefining STATIC_BUILD is what broke gcc-3: it was wrong
all the way, but this change revealed it.

Thanks for testing! (I didn't note that #3137454 was filed by you as well....)

Regards,
           Jan Nijtmans
Log in (anonymous is fine) to add a comment.