Boost logo

Boost-Build :

Subject: Re: [Boost-build] gcc visibility support
From: Jürgen Hunold (juergen.hunold_at_[hidden])
Date: 2010-08-23 14:35:54

Hi Robert,

On Monday, 23. August 2010 20:52:48 you wrote:
> I'm interested in adding support for -fvisibility=hidden to the gcc library
> compilations.
> I can include the following in the Jamfile.v2 of the build directory.
> <toolset>gcc:<cxxflags>"-fvisibility=hidden"
> which bjam seems to accept without complaint. Indeed the gcc command line
> includes -fvisibility=hidden.
> So, so good.

The best solution is direct Boost.Build support as described in issue #2114.

> any help appreciated.

Please find a patch with "works-for-me" status attached.

Invoking "bjam visibility=hidden" should then do the right thing.

> a) visibility is supported in version 4+ compilers. What syntax does one
> use to specify that that the above should only apply to these compilers.

I copied the "real-version" query from darwin.jam and used the version
reported by gcc.

> b) If one is building a static library, presuably the above shouldn't be
> included (though it probably does no harm). How does this modify the above
> syntax?


> c) The cygwin system I use to test has gcc-4.3.4 installed. BUT, the usage
> of -fvisibility=hidden evokes a compile time warning for file. The warning
> says that visibility is not supported on this build - which presumably is
> cygwin. So the above would also have to be conditioned upon the fact that
> cygwin is not being used.

Good question. The idea was to add this logic to "configure-version-specific" by
adding the current properties. I hope this would work somehow.

Hope this little helps.



* Dipl.-Math. Jürgen Hunold       ! Ingenieurgesellschaft für 
* voice: ++49 511 262926 57       ! Verkehrs- und Eisenbahnwesen mbH  
* fax  : ++49 511 262926 99       ! Lister Straße 15
* juergen.hunold_at_[hidden]        !
* Geschäftsführer:                ! Sitz des Unternehmens: Hannover
* Prof. Dr.-Ing. Thomas Siefer    ! Amtsgericht Hannover, HRB 56965
* PD Dr.-Ing. Alfons Radtke       !

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at