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

Unified Diff: client/deps/iotools/iotools.py

Issue 2803016: Cutover to hardened toolchain by default (3 of 3). BUG=3981 TEST=unit,autotest (Closed) Base URL: ssh://git@chromiumos-git/autotest.git
Patch Set: Created 10 years, 6 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 | « no previous file | client/site_tests/hardware_SAT/hardware_SAT.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/deps/iotools/iotools.py
diff --git a/client/deps/iotools/iotools.py b/client/deps/iotools/iotools.py
index ad5542d4f28e87e2115e1ffd5cc9c57d197dc61e..b68a23d0c75937c514e76cadd380cfc1af5e7bb5 100755
--- a/client/deps/iotools/iotools.py
+++ b/client/deps/iotools/iotools.py
@@ -10,11 +10,17 @@ from autotest_lib.client.bin import utils
version = 1
-def target_is_x86():
- result = utils.system_output('${CC} -dumpmachine', retain_output=True,
- ignore_status=True)
- x86_pattern = re.compile(r"^i.86.*")
- return x86_pattern.match(result)
+def target_is_x86_pie():
+ result = utils.system_output('${CC} -dumpmachine', retain_output=True,
+ ignore_status=True)
+ x86_pattern = re.compile(r"^i.86.*")
+ if not x86_pattern.match(result):
+ return False
+ result = utils.system_output('${CC} -dumpspecs', retain_output=True,
+ ignore_status=True)
+ if result.find('!nopie:') == -1:
+ return False
+ return True
def setup(tarball, topdir):
@@ -23,10 +29,7 @@ def setup(tarball, topdir):
# 'Add' arm support.
os.chdir(srcdir)
utils.system('patch -p0 < ../iotools.arm.patch')
- # TODO(fes): Remove this if there is a better way to detect that we are
- # in a hardened build (or if this later properly picks up the
- # -nopie flag from portage)
- if os.path.exists('/etc/hardened') and target_is_x86():
+ if target_is_x86_pie():
utils.system('patch -p0 < ../iotools.nopie.patch')
utils.system('CROSS_COMPILE=${CTARGET_default}- make')
« no previous file with comments | « no previous file | client/site_tests/hardware_SAT/hardware_SAT.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698