[vm/linux] Don't expose symbols from statically-linked libc++.

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

On Windows and OSX, we dynamically link against libc++, so there is no issue.
On Android we already hide symbols from libc++.

Change-Id: I17debc4d0efec3cebc203672333afb44390b0e0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115403
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
This commit is contained in:
Samir Jindel 2019-09-05 15:05:53 +00:00 committed by commit-bot@chromium.org
parent ec6c6542a2
commit be66176534
2 changed files with 11 additions and 3 deletions

View file

@ -247,8 +247,6 @@ config("compiler") {
# Linux-specific compiler flags setup.
# ------------------------------------
if (is_linux) {
cflags += [ "-pthread" ]
ldflags += [ "-pthread" ]
if (is_clang) {
if (current_cpu == "arm") {
cflags += [ "--target=armv7-linux-gnueabihf" ]

View file

@ -5,9 +5,19 @@
import("//build/config/sysroot.gni")
config("sdk") {
# Don't allow visible symbols from libc++ to be re-exported.
ldflags = [
"-nodefaultlibs",
"-lc++",
"-lc",
"-lm",
"-lclang_rt.builtins",
"-Wl,--exclude-libs=libc++.a",
]
if (sysroot != "") {
cflags = [ "--sysroot=" + sysroot ]
ldflags = [ "--sysroot=" + sysroot ]
ldflags += [ "--sysroot=" + sysroot ]
# Need to get some linker flags out of the sysroot.
ldflags += [ exec_script("sysroot_ld_path.py",