Commit 6f76ea33 authored by Tom Anderson's avatar Tom Anderson Committed by Commit Bot

Build with _LIBCPP_ENABLE_NODISCARD

Also rolls buildtools [1] and includes some small cleanups.

[1] https://chromium.googlesource.com/chromium/buildtools/+log/2dff9c9c74e9d732e6fe57c84ef7fd044cc45d96..13a00f110ef910a25763346d6538b60f12845656

BUG=894427
R=thakis

Change-Id: I52fd273ab2e93f8c5e461fd3bf7a34b09135d384
Reviewed-on: https://chromium-review.googlesource.com/c/1277374
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599734}
parent 65be571f
......@@ -121,7 +121,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling build tools
# and whatever else without interference from each other.
'buildtools_revision': '2dff9c9c74e9d732e6fe57c84ef7fd044cc45d96',
'buildtools_revision': '13a00f110ef910a25763346d6538b60f12845656',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling SwiftShader
# and whatever else without interference from each other.
......
......@@ -42,12 +42,6 @@ config("runtime_library") {
defines += [ "_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS" ]
}
}
if (!is_clang) {
# Gcc has a built-in abs() definition with default visibility.
# If it was not disabled, it would conflict with libc++'s abs()
# with hidden visibility.
cflags += [ "-fno-builtin-abs" ]
}
cflags_cc += [
"-nostdinc++",
"-isystem" + rebase_path("$libcxx_prefix/include", root_build_dir),
......@@ -56,6 +50,7 @@ config("runtime_library") {
defines += [
"CR_LIBCXX_REVISION=$libcxx_svn_revision",
"CR_LIBCXXABI_REVISION=$libcxxabi_svn_revision",
"_LIBCPP_ENABLE_NODISCARD",
]
# Make sure we don't link against libc++ or libstdc++.
......@@ -67,6 +62,11 @@ config("runtime_library") {
ldflags += [ "-nostdlib++" ]
}
} else {
# Gcc has a built-in abs() definition with default visibility.
# If it was not disabled, it would conflict with libc++'s abs()
# with hidden visibility.
cflags += [ "-fno-builtin-abs" ]
ldflags += [ "-nodefaultlibs" ]
# Unfortunately, there's no way to disable linking against just libc++
......
......@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//buildtools/deps_revisions.gni")
import("//build/config/chrome_build.gni")
import("//build/config/c++/c++.gni")
import("//build/config/clang/clang.gni")
......@@ -256,6 +257,8 @@ config("runtime_library") {
defines += [ "_USING_V110_SDK71_" ]
}
# TODO(thomasanderson): Move this into a target in //build/config/c++ and
# deduplicate with //build/config/posix/BUILD.gn.
if (use_custom_libcxx) {
cflags_cc +=
[ "-I" + rebase_path("$libcxx_prefix/include", root_build_dir) ]
......@@ -263,11 +266,17 @@ config("runtime_library") {
defines += [ "_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS" ]
}
# Prevent libc++ from embedding linker flags to try to automatically link
# against its runtime library. This is unnecessary with our build system,
# and can also result in build failures if libc++'s name for a library does
# not match ours.
defines += [ "_LIBCPP_NO_AUTO_LINK" ]
defines += [
"CR_LIBCXX_REVISION=$libcxx_svn_revision",
"CR_LIBCXXABI_REVISION=$libcxxabi_svn_revision",
"_LIBCPP_ENABLE_NODISCARD",
# Prevent libc++ from embedding linker flags to try to automatically link
# against its runtime library. This is unnecessary with our build system,
# and can also result in build failures if libc++'s name for a library
# does not match ours.
"_LIBCPP_NO_AUTO_LINK",
]
}
if (current_os == "winuwp") {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment