39 lines
1.4 KiB
Diff
39 lines
1.4 KiB
Diff
From: Daniel Micay <danielmicay@gmail.com>
|
|
Date: Wed, 26 Dec 2018 10:20:24 -0500
|
|
Subject: Switch to -fstack-protector-strong
|
|
|
|
This compiler option is already used for ChromeOS, but not yet on other
|
|
platforms because there is push back against enabling an option resulting in
|
|
~1-2% lower performance and ~2-3% larger binaries.
|
|
|
|
The size increase on Android is something they care a lot about since some
|
|
devices have very little storage space. That also means ever so slightly
|
|
higher memory/cache usage but not by the full 2-3%.
|
|
---
|
|
build/config/compiler/BUILD.gn | 6 +-----
|
|
1 file changed, 1 insertion(+), 5 deletions(-)
|
|
|
|
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
|
|
--- a/build/config/compiler/BUILD.gn
|
|
+++ b/build/config/compiler/BUILD.gn
|
|
@@ -277,16 +277,12 @@ config("compiler") {
|
|
cflags += [ "-fstack-protector" ]
|
|
}
|
|
} else if ((is_posix && !is_chromeos && !is_nacl) || is_fuchsia) {
|
|
- # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc supports it.
|
|
- # See also https://crbug.com/533294
|
|
- cflags += [ "--param=ssp-buffer-size=4" ]
|
|
-
|
|
# The x86 toolchain currently has problems with stack-protector.
|
|
if (is_android && current_cpu == "x86") {
|
|
cflags += [ "-fno-stack-protector" ]
|
|
} else if (current_os != "aix") {
|
|
# Not available on aix.
|
|
- cflags += [ "-fstack-protector" ]
|
|
+ cflags += [ "-fstack-protector-strong" ]
|
|
}
|
|
}
|
|
|
|
--
|
|
2.17.1
|
|
|