From dd6a3831b2b1dd55400dfde7712c64285ce241de Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Mon, 13 Aug 2018 12:07:33 -0700 Subject: [PATCH] Switch to libc++ on Linux The updated Clang toolchain now supports statically linking libc++ without having to manually modify library paths. Change-Id: I030b59f14bfbbcf1777a98ba914ccbb79626f212 Reviewed-on: https://gn-review.googlesource.com/2662 Reviewed-by: Dirk Pranke Commit-Queue: Petr Hosek --- build/gen.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/build/gen.py b/build/gen.py index 7d437c9f..e3336525 100755 --- a/build/gen.py +++ b/build/gen.py @@ -305,19 +305,16 @@ def WriteGNNinja(path, options, linux_sysroot): if is_linux: if linux_sysroot: - # Use the sid sysroot that UpdateLinuxSysroot() downloads. We need to - # force the used of libstdc++ for now because libc++ is not in that - # sysroot and we don't currently have a local build of that. We should - # probably resolve this and (re-)add a way to build against libc++. + # Use the sid sysroot that UpdateLinuxSysroot() downloads. cflags.append('--sysroot=' + linux_sysroot) ldflags.append('--sysroot=' + linux_sysroot) - cflags.append('-stdlib=libstdc++') - ldflags.extend(['-static-libstdc++', - '-stdlib=libstdc++', - '-Wl,--as-needed', - ]) + ldflags.extend([ + '-static-libstdc++', + '-Wl,--as-needed', + ]) libs.extend([ - '-lgcc_s', + # These are needed by libc++. + '-ldl', '-lpthread', ]) elif is_mac: