Opened 6 years ago

Last modified 6 years ago

#12722 new Bugs

asio visibility pragmas bloat .dynstr segment

Reported by: mzeren@… Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost 1.58.0 Severity: Problem
Keywords: Cc: mzeren@…

Description

We have a dynamic library that uses asio internally. It does not use asio in its public API. We compile this library with -fvisibility=hidden. When upgrading from boost 1.55 to 1.61 we noticed about 100K worth of asio symbols being added to the .dynstr segment of this library. This is an unacceptable increase for our system.

After some research we found that this is due to:

commit: 382804a4325b0e3b90d07f6563f5c6fd13a38052
Author: Christopher Kohlhoff chris@kohlhoff.com
Date:   Sat Mar 21 00:28:43 2015
-----
Use default visibility everywhere.
-----
M       include/boost/asio/detail/pop_options.hpp
M       include/boost/asio/detail/push_options.hpp
M       include/boost/asio/detail/service_registry.hpp

Which added #pragma GCC visibility push (default). Unfortunately the pragma overrides our -fvisibility command line argument. This patch first appears in Boost 1.58.

To use gcc visibility correctly asio should adopt the standard macro idiom described in https://gcc.gnu.org/wiki/Visibility.

Change History (1)

comment:1 by Kohei Takahashi, 6 years ago

Component: Noneasio
Owner: set to chris_kohlhoff
Note: See TracTickets for help on using tickets.