[Ctk-developers] GCC visibility flags?

Sascha Zelzer s.zelzer at dkfz-heidelberg.de
Mon Jul 12 06:04:11 EDT 2010


Hi,

I do not fully understand the problem yet, but here are some points to 
discuss:

1.) Log4Qt is already getting compiled with visibility=hidden (see 
http://github.com/commontk/Log4Qt/blob/patched/CMakeLists.txt), so the 
error has to be something else

2.) Log4Qt seems to be a static library only. Is this an inherent 
"feature" of Log4Qt? I feel that this could potentially lead to quite 
some increase in object size, if the number of shared libraries 
(plugins) linking to Log4Qt increases a lot in the future.

3.) A google search revealed that quite a few people get the same 
warnings on a mac for different projects. However, there has been no 
clear solution, except for modifying compiler flags of external 
libraries (for std::min<...> this would obviously not work...). We could 
just add a compiler flag to suppress the warning, if we are sure that it 
has no side effects.

- Sascha

On 07/09/2010 04:47 PM, Jean-Christophe Fillion-Robin wrote:
> Hi Folks,
>
> Is there any dashboard where these error are reported ?
>
> Does that sound like a reasonable option:
>   - Add visibility flags to Log4Qt and DCMTK ?
>
> Thks
> Jc
>
> On Fri, Jul 9, 2010 at 10:15 AM, Luis Ibanez <luis.ibanez at kitware.com 
> <mailto:luis.ibanez at kitware.com>> wrote:
>
>
>     We have seen the same warnings on Mac
>     (and not when building on Ubuntu).
>
>     I looks like it is a Mac issue...,
>
>     but It is annoying enough
>     that it will be nice to fix it.       :-)
>
>
>         Luis
>
>
>     -----------------------------------------------------
>
>     On Thu, Jul 8, 2010 at 10:30 PM, Daniel Blezek
>     <daniel.blezek at gmail.com <mailto:daniel.blezek at gmail.com>> wrote:
>
>         Sascha,
>
>          I just built on linux and didn't have this problem with
>         linking.  Perhaps the flag isn't doing exactly what we expect?
>          Or is the Mac just more picky?  Can you easily tell?
>
>         Cheers,
>         -dan
>
>
>
>         On Jul 7, 2010, at 12:52 AM, Sascha Zelzer wrote:
>
>         > Hi Dan,
>         >
>         > this is the closed issue for the change:
>         >
>         > http://github.com/pieper/CTK/issues/closed#issue/10
>         >
>         > I have not seen any linker wanings on my Linux machine yet,
>         did you introduce new code (and what system are you running)?
>         >
>         > The flags cannot easily be applied to external libraries,
>         since symbols must be prefixed with the appropriate
>         import/export specifiers in the .h files.
>         >
>         > Best,
>         > Sascha
>         >
>         > On 07/07/2010 04:12 AM, Daniel Blezek wrote:
>         >> Hi all,
>         >>
>         >>   Can someone explain this code from the top level CTK
>         CMakeLists.txt file?
>         >>
>         >>
>         #-----------------------------------------------------------------------------
>         >> # Set symbol visibility Flags
>         >> #
>         >> IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
>         >>   SET(VISIBILITY_CXX_FLAGS "-fvisibility=hidden
>         -fvisibility-inlines-hidden")
>         >> ENDIF()
>         >>
>         >>
>         >> This causes all sorts of linker warnings because Log4Qt
>         doesn't include the flag and CTK does.
>         >>
>         >> Is this strictly necessary?  If so, can it be applied to
>         the Externals as well?
>         >>
>         >> Thanks,
>         >> -dan
>         >>
>         >> --
>         >> Daniel Blezek
>         >> daniel.blezek at gmail.com <mailto:daniel.blezek at gmail.com>
>         >>
>         >>
>         >>
>         >> _______________________________________________
>         >> Ctk-developers mailing list
>         >> Ctk-developers at commontk.org
>         <mailto:Ctk-developers at commontk.org>
>         >>
>         http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers
>         >>
>         >
>         > _______________________________________________
>         > Ctk-developers mailing list
>         > Ctk-developers at commontk.org <mailto:Ctk-developers at commontk.org>
>         >
>         http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers
>
>         --
>         Daniel Blezek
>         daniel.blezek at gmail.com <mailto:daniel.blezek at gmail.com>
>
>
>
>         _______________________________________________
>         Ctk-developers mailing list
>         Ctk-developers at commontk.org <mailto:Ctk-developers at commontk.org>
>         http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers
>
>
>
>     _______________________________________________
>     Ctk-developers mailing list
>     Ctk-developers at commontk.org <mailto:Ctk-developers at commontk.org>
>     http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers
>
>
>
>
> -- 
> Phone: 1-518-836-2174
> Ext: 304

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ctk-developers/attachments/20100712/b82e91ca/attachment.html>


More information about the Ctk-developers mailing list