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 <dpranke@chromium.org>
Commit-Queue: Petr Hosek <phosek@google.com>
diff --git a/build/gen.py b/build/gen.py
index 7d437c9..e333652 100755
--- a/build/gen.py
+++ b/build/gen.py
@@ -305,19 +305,16 @@
 
     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: