Skip to content

Commit

Permalink
Switch to libc++ on Linux
Browse files Browse the repository at this point in the history
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 <[email protected]>
Commit-Queue: Petr Hosek <[email protected]>
  • Loading branch information
petrhosek authored and Commit Bot committed Aug 13, 2018
1 parent c218b83 commit dd6a383
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions build/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit dd6a383

Please sign in to comment.