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

obsolete: 8.6b1.1
closed-fixed
5
2011-04-11
2011-04-09
No

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

Discussion

  • Jan Nijtmans

    Jan Nijtmans - 2011-04-09

    I'll have a look at this

     
  • Jan Nijtmans

    Jan Nijtmans - 2011-04-09
    • assigned_to: stwo --> nijtmans
     
  • Jan Nijtmans

    Jan Nijtmans - 2011-04-11

    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.

     
  • Wojciech Kocjan

    Wojciech Kocjan - 2011-04-11

    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.

     
  • Jan Nijtmans

    Jan Nijtmans - 2011-04-11
    • status: open --> closed-fixed
     
  • Jan Nijtmans

    Jan Nijtmans - 2011-04-11

    >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

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks