| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # Used by libc++ and libc++abi. |
| 5 config("config") { | 6 config("config") { |
| 7 defines = [ "LIBCXX_BUILDING_LIBCXXABI" ] |
| 6 cflags = [ | 8 cflags = [ |
| 9 "-fPIC", |
| 10 "-fstrict-aliasing", |
| 11 "-pthread", |
| 12 ] |
| 13 cflags_cc = [ |
| 14 "-nostdinc++", |
| 7 "-isystem" + rebase_path("trunk/include", root_build_dir), | 15 "-isystem" + rebase_path("trunk/include", root_build_dir), |
| 8 "-isystem" + rebase_path("../libc++abi/trunk/include", root_build_dir), | 16 "-isystem" + rebase_path("../libc++abi/trunk/include", root_build_dir), |
| 9 "-fPIC", | |
| 10 "-fstrict-aliasing", | |
| 11 "-nostdinc++", | |
| 12 "-pthread", | |
| 13 "-std=c++11", | 17 "-std=c++11", |
| 14 "-DLIBCXX_BUILDING_LIBCXXABI", | |
| 15 ] | 18 ] |
| 16 } | 19 } |
| 17 | 20 |
| 18 shared_library("libc++") { | 21 shared_library("libc++") { |
| 19 sources = [ | 22 sources = [ |
| 20 "trunk/src/algorithm.cpp", | 23 "trunk/src/algorithm.cpp", |
| 21 "trunk/src/any.cpp", | 24 "trunk/src/any.cpp", |
| 22 "trunk/src/bind.cpp", | 25 "trunk/src/bind.cpp", |
| 23 "trunk/src/chrono.cpp", | 26 "trunk/src/chrono.cpp", |
| 24 "trunk/src/condition_variable.cpp", | 27 "trunk/src/condition_variable.cpp", |
| (...skipping 26 matching lines...) Expand all Loading... |
| 51 "//build/config/gcc:no_exceptions", | 54 "//build/config/gcc:no_exceptions", |
| 52 "//build/config/gcc:symbol_visibility_hidden", | 55 "//build/config/gcc:symbol_visibility_hidden", |
| 53 ] | 56 ] |
| 54 configs += [ | 57 configs += [ |
| 55 ":config", | 58 ":config", |
| 56 "//build/config/compiler:no_chromium_code", | 59 "//build/config/compiler:no_chromium_code", |
| 57 "//build/config/compiler:rtti", | 60 "//build/config/compiler:rtti", |
| 58 "//build/config/sanitizers:sanitizer_options_link_helper", | 61 "//build/config/sanitizers:sanitizer_options_link_helper", |
| 59 ] | 62 ] |
| 60 | 63 |
| 61 defines = [ "LIBCXX_BUILDING_LIBCXXABI" ] | |
| 62 ldflags = [ "-nodefaultlibs" ] | 64 ldflags = [ "-nodefaultlibs" ] |
| 63 | 65 |
| 64 # TODO(GYP): Remove "-pthread" from ldflags. | 66 # TODO(GYP): Remove "-pthread" from ldflags. |
| 65 # -nodefaultlibs turns -pthread into a no-op, causing an unused argument | 67 # -nodefaultlibs turns -pthread into a no-op, causing an unused argument |
| 66 # warning. Explicitly link with -lpthread instead. | 68 # warning. Explicitly link with -lpthread instead. |
| 67 | 69 |
| 68 libs = [ | 70 libs = [ |
| 69 "c", | 71 "c", |
| 70 "gcc_s", | 72 "gcc_s", |
| 71 "m", | 73 "m", |
| 72 "pthread", | 74 "pthread", |
| 73 "rt", | 75 "rt", |
| 74 ] | 76 ] |
| 75 | 77 |
| 76 # libc++abi is linked statically into libc++.so. This allows us to get both | 78 # libc++abi is linked statically into libc++.so. This allows us to get both |
| 77 # libc++ and libc++abi by passing '-stdlib=libc++'. If libc++abi was a | 79 # libc++ and libc++abi by passing '-stdlib=libc++'. If libc++abi was a |
| 78 # separate DSO, we'd have to link against it explicitly. | 80 # separate DSO, we'd have to link against it explicitly. |
| 79 deps = [ | 81 deps = [ |
| 80 "//buildtools/third_party/libc++abi", | 82 "//buildtools/third_party/libc++abi", |
| 81 ] | 83 ] |
| 82 } | 84 } |
| 83 | 85 |
| 84 group("libcxx_proxy") { | 86 group("libcxx_proxy") { |
| 85 deps = [ | 87 deps = [ |
| 86 ":libc++", | 88 ":libc++", |
| 87 ] | 89 ] |
| 88 public_configs = [ ":link_helper" ] | 90 public_configs = [ ":link_helper" ] |
| 89 } | 91 } |
| 90 | 92 |
| 93 # This config is only used by binaries and shared library targets. |
| 94 # //build/config/sanitizers:default_sanitizer_flags sets the include paths for |
| 95 # everything else. |
| 91 config("link_helper") { | 96 config("link_helper") { |
| 92 ldflags = [ | 97 ldflags = [ |
| 93 "-stdlib=libc++", | 98 "-stdlib=libc++", |
| 94 | 99 |
| 95 # Normally the generator takes care of RPATH. Our case is special because | 100 # Normally the generator takes care of RPATH. Our case is special because |
| 96 # the generator is unaware of the libc++.so dependency. Note that setting | 101 # the generator is unaware of the libc++.so dependency. Note that setting |
| 97 # RPATH here is a potential security issue. See the following for another | 102 # RPATH here is a potential security issue. See the following for another |
| 98 # example of this issue: https://code.google.com/p/gyp/issues/detail?id=315 | 103 # example of this issue: https://code.google.com/p/gyp/issues/detail?id=315 |
| 99 "-Wl,-R,\$ORIGIN/", | 104 "-Wl,-R,\$ORIGIN/", |
| 100 ] | 105 ] |
| 101 lib_dirs = [ root_build_dir ] | 106 lib_dirs = [ root_build_dir ] |
| 102 } | 107 } |
| OLD | NEW |