Index: build/config/compiler/BUILD.gn |
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn |
index 320b7fce75bb11af6037a317aecf98aaeb47c8f4..7ba33fd299c93abfedc3a2f2b2e5abf7906d28b2 100644 |
--- a/build/config/compiler/BUILD.gn |
+++ b/build/config/compiler/BUILD.gn |
@@ -162,6 +162,8 @@ config("compiler") { |
configs += [ "//build/config/nacl:compiler" ] |
} else if (is_ios || is_mac) { |
configs += [ "//build/config/mac:compiler" ] |
+ } else if (current_os == "aix") { |
+ configs += [ "//build/config/aix:compiler" ] |
} |
# See the definitions below. |
@@ -175,13 +177,18 @@ config("compiler") { |
if (!is_win) { |
# Common GCC compiler flags setup. |
# -------------------------------- |
- cflags += [ "-fno-strict-aliasing" ] # See http://crbug.com/32204 |
- cflags_cc += [ |
- # Not exporting C++ inline functions can generally be applied anywhere |
- # so we do so here. Normal function visibility is controlled by |
- # //build/config/gcc:symbol_visibility_hidden. |
- "-fvisibility-inlines-hidden", |
- ] |
+ if (current_os != "aix" && |
Michael Achenbach
2017/04/25 14:08:30
Just double-checking: You don't need the aix check
rayb
2017/04/25 17:28:48
We only support AIX on ppc64 BE. So further checki
|
+ !(is_linux && (current_cpu == "s390x" || current_cpu == "s390" || |
+ current_cpu == "ppc64" || current_cpu == "ppc"))) { |
+ cflags_cc += [ |
Michael Achenbach
2017/04/18 13:46:04
This doesn't include -fno-strict-aliasing in cflag
rayb
2017/04/25 00:41:04
Acknowledged.
|
+ "fno-strict-aliasing", |
+ |
+ # Not exporting C++ inline functions can generally be applied anywhere |
+ # so we do so here. Normal function visibility is controlled by |
+ # //build/config/gcc:symbol_visibility_hidden. |
+ "-fvisibility-inlines-hidden", |
+ ] |
+ } |
# Stack protection. |
if (is_mac) { |
@@ -200,14 +207,16 @@ config("compiler") { |
# The x86 toolchain currently has problems with stack-protector. |
if (is_android && current_cpu == "x86") { |
cflags += [ "-fno-stack-protector" ] |
- } else { |
+ } else if (current_os != "aix") { |
+ # Not available on aix. |
cflags += [ "-fstack-protector" ] |
} |
} |
# Linker warnings. |
if (fatal_linker_warnings && !(is_chromeos && current_cpu == "arm") && |
- !(is_android && use_order_profiling) && !is_mac && !is_ios) { |
+ !(is_android && use_order_profiling) && !is_mac && !is_ios && |
+ current_os != "aix") { |
# TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580 |
# TODO(lizeb,pasko): Fix link errors when linking with order_profiling=1 |
# crbug.com/485542 |
@@ -436,7 +445,7 @@ config("compiler") { |
# C++11 compiler flags setup. |
# --------------------------- |
- if (is_linux || is_android || (is_nacl && is_clang)) { |
+ if (is_linux || is_android || (is_nacl && is_clang) || current_os == "aix") { |
# gnu++11 instead of c++11 is needed because some code uses typeof() (a |
# GNU extension). |
# TODO(thakis): Eventually switch this to c++11 instead, |
@@ -1137,7 +1146,9 @@ config("chromium_code") { |
] |
if (!is_debug && !using_sanitizer && |
- (!is_linux || !is_clang || is_official_build)) { |
+ (!is_linux || !is_clang || is_official_build) && |
+ (current_cpu != "s390x" && current_cpu != "s390" && |
+ current_cpu != "ppc64" && current_cpu != "ppc")) { |
Michael Achenbach
2017/04/18 13:46:04
nit: For readability, maybe we could add a helper
rayb
2017/04/25 00:41:04
Done.
|
# _FORTIFY_SOURCE isn't really supported by Clang now, see |
# http://llvm.org/bugs/show_bug.cgi?id=16821. |
# It seems to work fine with Ubuntu 12 headers though, so use it in |
@@ -1357,7 +1368,7 @@ if (is_win) { |
# Mac dead code stripping requires symbols. |
common_optimize_on_ldflags += [ "-Wl,-dead_strip" ] |
} |
- } else { |
+ } else if (current_os != "aix") { |
# Non-Mac Posix flags. |
common_optimize_on_cflags += [ |
@@ -1371,12 +1382,14 @@ if (is_win) { |
"-ffunction-sections", |
] |
- common_optimize_on_ldflags += [ |
- # Specifically tell the linker to perform optimizations. |
- # See http://lwn.net/Articles/192624/ . |
- "-Wl,-O1", |
- "-Wl,--gc-sections", |
- ] |
+ if (current_os != "aix") { |
Michael Achenbach
2017/04/18 13:46:03
This is already nested in a current_os != "aix" sc
rayb
2017/04/25 00:41:04
Done.
|
+ common_optimize_on_ldflags += [ |
+ # Specifically tell the linker to perform optimizations. |
+ # See http://lwn.net/Articles/192624/ . |
+ "-Wl,-O1", |
+ "-Wl,--gc-sections", |
+ ] |
+ } |
} |
} |