Skip to content

Commit

Permalink
Remove -fstack-protector-strong from the ChromeOS GN build.
Browse files Browse the repository at this point in the history
This trybots said this was an unknown option, so the comment I was basing my
usage of "strong" on in common.gypi must be out-of-date. The GYP build does not
seem to specify "strong" in any cases except on Mac.

Hook up compiler finding to the Android build.

R=jam@chromium.org

Review URL: https://codereview.chromium.org/99333020

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242746 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
brettw@chromium.org committed Dec 31, 2013
1 parent dc7d29d commit 0b3c983
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
3 changes: 0 additions & 3 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,8 @@ config("compiler") {
]

# Stack protection.
# TODO(brettw) why do we have different values for all of these cases?
if (is_mac) {
cflags += "-fstack-protector-all"
} else if (is_chromeos) {
cflags += "-fstack-protector-strong"
} else if (is_linux) {
cflags += [ "-fstack-protector", "--param=ssp-buffer-size=4" ]
}
Expand Down
6 changes: 2 additions & 4 deletions build/toolchain/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ if (is_gyp) {

# This script will find the compilers for the given Android toolchain
# directory.
# TODO(brettw) write this script which locates the Android compilers.
#android_compilers = exec_script("find_android_compilers.py",
# [android_toolchain], "value")
android_compilers = ["gcc", "g++", "gcc", "g++"]
android_compilers = exec_script("find_android_compiler.py",
[android_toolchain], "value")
gyp_header =
"'make_global_settings': [" +
"['CC', '" + android_compilers[0] + "']," +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,18 @@
android_toolchain = sys.argv[1]
cc = glob.glob(android_toolchain + "/*-gcc")
cxx = glob.glob(android_toolchain + "/*-g++")

# We tolerate "no matches." In the Android AOSP WebView build, it runs this
# logic and the directory doesn't exist, giving no matches. But that build runs
# GYP to generate Android Makefiles which specify the compiler separately. So
# all we need to do in this case is ignore the error and continue with empty
# target compilers.
if len(cc) == 0:
cc = [""]
if len(cxx) == 0:
cxx = [""]
if len(cc) != 1 or len(cxx) != 1:
print "Either none or more than one matching compiler."
print "More than one matching compiler."
sys.exit(1)

# Get the host compilers from the current path.
Expand Down

0 comments on commit 0b3c983

Please sign in to comment.