Skip to content

Commit

Permalink
[vm/linux] Don't expose symbols from statically-linked libc++.
Browse files Browse the repository at this point in the history
Issue dart-lang/sdk#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>
  • Loading branch information
sjindel-google authored and commit-bot@chromium.org committed Sep 5, 2019
1 parent ec6c654 commit be66176
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 0 additions & 2 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand Down
12 changes: 11 additions & 1 deletion build/config/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit be66176

Please sign in to comment.