Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(535)

Unified Diff: build/config/compiler/BUILD.gn

Issue 1258923012: GN (Android): Make is_clang work for (at least for arm32) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nacl build errors Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/BUILDCONFIG.gn ('k') | build/toolchain/android/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/compiler/BUILD.gn
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index a4eae25aedf569b5ac2f44fa8dcc219241fb1e34..9beb814bb6e1af140812c04748737b0c795f20a8 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -167,11 +167,14 @@ config("compiler") {
# Stack protection.
if (is_mac) {
cflags += [ "-fstack-protector-all" ]
- } else if (is_linux) {
- cflags += [
- "-fstack-protector",
- "--param=ssp-buffer-size=4",
- ]
+ } else if (is_posix && !is_chromeos && !is_nacl) {
+ # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc supports it.
+ cflags += [ "--param=ssp-buffer-size=4" ]
+ if (is_android && (current_cpu == "arm64" || current_cpu == "x86")) {
+ cflags += [ "-fno-stack-protector" ]
+ } else {
+ cflags += [ "-fstack-protector" ]
+ }
}
# Linker warnings.
@@ -522,7 +525,15 @@ config("compiler") {
"-funwind-tables",
"-fno-short-enums",
]
- if (!is_clang) {
+ if (is_clang) {
+ rebased_android_toolchain_root =
+ rebase_path(android_toolchain_root, root_build_dir)
+ cflags += [
+ # TODO(hans) Enable integrated-as (crbug.com/124610).
+ "-no-integrated-as",
+ "-B${rebased_android_toolchain_root}/bin", # Else /usr/bin/as gets picked up.
+ ]
+ } else {
# Clang doesn't support these flags.
cflags += [ "-finline-limit=64" ]
}
@@ -545,8 +556,7 @@ config("compiler") {
ldflags += [ "-fuse-ld=gold" ]
if (is_clang) {
# Let clang find the ld.gold in the NDK.
- ldflags += [ "--gcc-toolchain=" +
- rebase_path(android_toolchain_root, root_build_dir) ]
+ ldflags += [ "--gcc-toolchain=$rebased_android_toolchain_root" ]
}
}
@@ -572,11 +582,23 @@ config("compiler") {
if (is_clang) {
if (current_cpu == "arm") {
- cflags += [ "-target arm-linux-androideabi" ]
- ldflags += [ "-target arm-linux-androideabi" ]
+ cflags += [
+ "-target",
+ "arm-linux-androideabi",
+ ]
+ ldflags += [
+ "-target",
+ "arm-linux-androideabi",
+ ]
} else if (current_cpu == "x86") {
- cflags += [ "-target i686-linux-androideabi" ]
- ldflags += [ "-target i686-linux-androideabi" ]
+ cflags += [
+ "-target",
+ "i686-linux-androideabi",
+ ]
+ ldflags += [
+ "-target",
+ "i686-linux-androideabi",
+ ]
}
}
}
@@ -847,10 +869,13 @@ if (is_win) {
default_warning_flags_cc += [
# See comment for -Wno-c++11-narrowing.
"-Wno-narrowing",
-
- # TODO(thakis): Remove, http://crbug.com/263960
- "-Wno-literal-suffix",
]
+ if (!is_clang) {
+ default_warning_flags_cc += [
+ # TODO(thakis): Remove, http://crbug.com/263960
+ "-Wno-literal-suffix",
+ ]
+ }
}
# Suppress warnings about ABI changes on ARM (Clang doesn't give this
« no previous file with comments | « build/config/BUILDCONFIG.gn ('k') | build/toolchain/android/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698