summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-20 23:00:11 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-20 23:00:11 +0000
commitf7b2a6ae1c1ecaeef835b0c1880c7d46a32cdc86 (patch)
tree06cd8e695a8a932b7a57c3e144b12cc73f655231 /build
parent905b49ec83d9ba6a9957a83b0aa94d6c14cfe99a (diff)
downloadchromium_src-f7b2a6ae1c1ecaeef835b0c1880c7d46a32cdc86.zip
chromium_src-f7b2a6ae1c1ecaeef835b0c1880c7d46a32cdc86.tar.gz
chromium_src-f7b2a6ae1c1ecaeef835b0c1880c7d46a32cdc86.tar.bz2
Make Linux GN build's cflags match GYP's
This is for the base shared library target on desktop Linux. The remaining difference on Linux is that GYP's base build specifies -Wno-write-strings on Linux. This dates back to the first GYP file. I don't know why we would specify this for only base, and it seems not to trigger any warning without this flag, so I didn't add it. This changes the pkg-config invocation from --libs to --libs-only-L and --libs-only-l. The output seems slightly different (--libs was producing an extra --export-dynamic for gmodule-2.0 that aren't present when invoking the other way, which is what the GYP build does). R=thakis@chromium.org Review URL: https://codereview.chromium.org/165873004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252409 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r--build/config/compiler/BUILD.gn39
-rw-r--r--build/config/linux/pkg-config.py3
2 files changed, 34 insertions, 8 deletions
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 7db12df..595ee0d 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -164,8 +164,10 @@ config("compiler") {
# https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
# Only apply this to the target linker, since the host
# linker might not be gold, but isn't used much anyway.
- "-Wl,--threads",
- "-Wl,--thread-count=4",
+ # TODO(raymes): Disable threading because gold is frequently
+ # crashing on the bots: crbug.com/161942.
+ #"-Wl,--threads",
+ #"-Wl,--thread-count=4",
]
}
@@ -397,29 +399,53 @@ config("chromium_code") {
}
}
config("no_chromium_code") {
+ cflags = []
+ cflags_cc = []
+ defines = []
+
if (is_win) {
- cflags = [
+ cflags += [
"/W3", # Warning level 3.
"/wd4800", # Disable warning when forcing value to bool.
]
- defines = [
+ defines += [
"_CRT_NONSTDC_NO_WARNINGS",
"_CRT_NONSTDC_NO_DEPRECATE",
]
}
+ if (is_linux) {
+ # Don't warn about ignoring the return value from e.g. close(). This is
+ # off by default in some gccs but on by default in others. BSD systems do
+ # not support this option, since they are usually using gcc 4.2.1, which
+ # does not have this flag yet.
+ cflags += [ "-Wno-unused-result" ]
+ }
+
+ if (is_linux || is_android) {
+ cflags += [
+ # Don't warn about printf format problems. This is off by default in gcc
+ # but on in Ubuntu's gcc(!).
+ "-Wno-format",
+ ]
+ cflags_cc += [
+ # Don't warn about hash_map in third-party code.
+ "-Wno-deprecated",
+ ]
+ }
+
if (is_android_webview_build) {
# There is a class of warning which:
# 1) Android always enables and also treats as errors
# 2) Chromium ignores in third party code
# So we re-enable those warnings when building Android.
- cflags = [
+ cflags += [
"-Wno-address",
"-Wno-format-security",
"-Wno-return-type",
"-Wno-sequence-point",
]
- cflags_cc = [ "-Wno-non-virtual-dtor" ]
+ cflags_cc += [ "-Wno-non-virtual-dtor" ]
}
}
@@ -488,7 +514,6 @@ config("default_warnings") {
# Disables.
"-Wno-missing-field-initializers", # "struct foo f = {0};"
"-Wno-unused-parameter", # Unused function parameters.
- "-Wno-write-strings",
]
if (is_mac) {
diff --git a/build/config/linux/pkg-config.py b/build/config/linux/pkg-config.py
index d89fc7b..b107e74 100644
--- a/build/config/linux/pkg-config.py
+++ b/build/config/linux/pkg-config.py
@@ -119,7 +119,8 @@ else:
prefix = ''
try:
- flag_string = subprocess.check_output(["pkg-config", "--cflags", "--libs"] +
+ flag_string = subprocess.check_output(
+ [ "pkg-config", "--cflags", "--libs-only-l", "--libs-only-L" ] +
args, env=os.environ)
# For now just split on spaces to get the args out. This will break if
# pkgconfig returns quoted things with spaces in them, but that doesn't seem