Index: build/config/compiler/BUILD.gn |
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn |
index ab0d6c5f06a9cc1d1d97975a26926d620b15c422..60954b3dcc064e606e2db5f8ed1ac909c60b413f 100644 |
--- a/build/config/compiler/BUILD.gn |
+++ b/build/config/compiler/BUILD.gn |
@@ -575,10 +575,6 @@ config("compiler_codegen") { |
# Else building libyuv gives clang's register allocator issues, |
# see llvm.org/PR15798 / crbug.com/233709 |
"-momit-leaf-frame-pointer", |
- |
- # Align the stack on 16-byte boundaries, http://crbug.com/418554. |
- "-mstack-alignment=16", |
- "-mstackrealign", |
] |
} |
} else if (current_cpu == "arm") { |
@@ -603,6 +599,20 @@ config("compiler_codegen") { |
asmflags = cflags |
} |
+# This is separate from :compiler_codegen (and not even a sub-config there) |
+# so that some targets can remove it from the list with: |
+# configs -= [ "//build/config/compiler:clang_stackrealign" ] |
+# See https://crbug.com/556393 for details of where it must be avoided. |
+config("clang_stackrealign") { |
+ if (is_clang && current_cpu == "x86" && !is_nacl) { |
+ cflags = [ |
+ # Align the stack on 16-byte boundaries, http://crbug.com/418554. |
+ "-mstack-alignment=16", |
+ "-mstackrealign", |
+ ] |
+ } |
+} |
+ |
config("compiler_arm_fpu") { |
if (current_cpu == "arm" && !is_ios && !is_nacl) { |
cflags = [ "-mfpu=$arm_fpu" ] |