From 9fec1a3cb40c0e41caa4c562a7b1f6d9faca6967 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 30 Jan 2018 15:28:32 +0900 Subject: [PATCH] Link with libcc's libc++ on Linux --- common.gypi | 21 ++++++++++++++++++++- toolchain.gypi | 18 +++++++++++++----- vendor/libchromiumcontent | 2 +- 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/common.gypi b/common.gypi index 2209914148e8..76eb017387a9 100644 --- a/common.gypi +++ b/common.gypi @@ -182,7 +182,10 @@ '-Wl,--no-whole-archive', ], }, { - 'libraries': [ '<@(libchromiumcontent_v8_libraries)' ], + 'libraries': [ + '<@(libchromiumcontent_v8_libraries)', + '<(libchromiumcontent_dir)/libc++.so', + ], }], ], }], @@ -243,6 +246,22 @@ }], # OS=="win" ], }], + ['OS=="linux" and _target_name in ["dump_syms"]', { + 'conditions': [ + ['libchromiumcontent_component==0', { + 'libraries': [ + '<(libchromiumcontent_dir)/libc++.a', + ], + }, { + 'libraries': [ + '<(libchromiumcontent_dir)/libc++.so', + ], + 'ldflags': [ + '-Wl,-rpath=\$$ORIGIN', + ], + }], + ], + }] ], 'msvs_cygwin_shell': 0, # Strangely setting it to 1 would make building under cygwin fail. 'msvs_disabled_warnings': [ diff --git a/toolchain.gypi b/toolchain.gypi index aa9ce81ee7c3..5e291127a2f5 100644 --- a/toolchain.gypi +++ b/toolchain.gypi @@ -110,9 +110,6 @@ ['CXX.host', '$(CXX)'], ], 'target_defaults': { - 'cflags_cc': [ - '-std=c++14', - ], 'xcode_settings': { 'CC': '<(make_clang_dir)/bin/clang', 'LDPLUSPLUS': '<(make_clang_dir)/bin/clang++', @@ -125,13 +122,24 @@ 'CLANG_CXX_LANGUAGE_STANDARD': 'c++14', # -std=c++14 }, 'target_conditions': [ - ['_type in ["executable", "shared_library"]', { + ['OS=="mac" and _type in ["executable", "shared_library"]', { 'xcode_settings': { # On some machines setting CLANG_CXX_LIBRARY doesn't work for # linker. 'OTHER_LDFLAGS': [ '-stdlib=libc++' ], }, }], + ['OS=="linux"', { + 'cflags_cc': [ + '-std=gnu++14', + '-nostdinc++', + '-isystem<(libchromiumcontent_src_dir)/buildtools/third_party/libc++/trunk/include', + '-isystem<(libchromiumcontent_src_dir)/buildtools/third_party/libc++abi/trunk/include', + ], + 'ldflags': [ + '-nostdlib++', + ], + }], ], }, }], # clang==1 @@ -145,7 +153,7 @@ ], 'target_defaults': { 'cflags_cc': [ - '-std=c++11', + '-std=gnu++14', ], }, }], diff --git a/vendor/libchromiumcontent b/vendor/libchromiumcontent index f8ff573e503d..5964d8fe1ef8 160000 --- a/vendor/libchromiumcontent +++ b/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit f8ff573e503dea08f8ef05a2773bf3b0aa8dfdb1 +Subproject commit 5964d8fe1ef813028d53c6496857ca84d9d91fd3