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.

Issue https://github.com/dart-lang/sdk/issues/42230

Change-Id: I6412257e6a847d6e8d8dec215db363d64b1ef775
Reviewed-on: https://dart-review.googlesource.com/c/boringssl_gen/+/150482
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
1 file changed