Set default visibility of functions in BoringSSL to be hidden

Right now any build of the Dart VM (debug/release/product) compiles
against the same BoringSSL target.  The VM build uses build-global
flags like `-fvisibility=hidden` which are set depending on the
global mode (e.g. product).

Though we want to be able to build a product AOT runtime in e.g.
--mode=release mode. The compiler-global flags will therefore be
from release build. This causes us to not set `-fvisibility=hidden`
and blows up the code size of the resulting binary.

This CL will cause only explicitly exported symbols to be visible,
which makes any VM that includes BoringSSL smaller. Which is very nice.

An alternative would be to parametrize the BoringSSL build rules and
export two targets, with/without -fvisibility=hidden.
=> Though it seems better to always have smaller binaries.


Change-Id: I6412257e6a847d6e8d8dec215db363d64b1ef775
Reviewed-by: Zach Anderson <>
Commit-Queue: Martin Kustermann <>
1 file changed