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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | client/site_tests/hardware_SAT/hardware_SAT.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 __author__ = 'nsanders@chromium.org (Nick Sanders)' 6 __author__ = 'nsanders@chromium.org (Nick Sanders)'
7 7
8 import common, os, re 8 import common, os, re
9 from autotest_lib.client.bin import utils 9 from autotest_lib.client.bin import utils
10 10
11 version = 1 11 version = 1
12 12
13 def target_is_x86(): 13 def target_is_x86_pie():
14 result = utils.system_output('${CC} -dumpmachine', retain_output=True, 14 result = utils.system_output('${CC} -dumpmachine', retain_output=True,
15 ignore_status=True) 15 ignore_status=True)
16 x86_pattern = re.compile(r"^i.86.*") 16 x86_pattern = re.compile(r"^i.86.*")
17 return x86_pattern.match(result) 17 if not x86_pattern.match(result):
18 return False
19 result = utils.system_output('${CC} -dumpspecs', retain_output=True,
20 ignore_status=True)
21 if result.find('!nopie:') == -1:
22 return False
23 return True
18 24
19 25
20 def setup(tarball, topdir): 26 def setup(tarball, topdir):
21 srcdir = os.path.join(topdir, 'src') 27 srcdir = os.path.join(topdir, 'src')
22 utils.extract_tarball_to_dir(tarball, srcdir) 28 utils.extract_tarball_to_dir(tarball, srcdir)
23 # 'Add' arm support. 29 # 'Add' arm support.
24 os.chdir(srcdir) 30 os.chdir(srcdir)
25 utils.system('patch -p0 < ../iotools.arm.patch') 31 utils.system('patch -p0 < ../iotools.arm.patch')
26 # TODO(fes): Remove this if there is a better way to detect that we are 32 if target_is_x86_pie():
27 # in a hardened build (or if this later properly picks up the
28 # -nopie flag from portage)
29 if os.path.exists('/etc/hardened') and target_is_x86():
30 utils.system('patch -p0 < ../iotools.nopie.patch') 33 utils.system('patch -p0 < ../iotools.nopie.patch')
31 34
32 utils.system('CROSS_COMPILE=${CTARGET_default}- make') 35 utils.system('CROSS_COMPILE=${CTARGET_default}- make')
33 utils.system('cp iotools %s' % topdir) 36 utils.system('cp iotools %s' % topdir)
34 os.chdir(topdir) 37 os.chdir(topdir)
35 38
36 39
37 # The source is grabbed from 40 # The source is grabbed from
38 # http://iotools.googlecode.com/files/iotools-1.2.tar.gz 41 # http://iotools.googlecode.com/files/iotools-1.2.tar.gz
39 pwd = os.getcwd() 42 pwd = os.getcwd()
40 tarball = os.path.join(pwd, 'iotools-1.2.tar.gz') 43 tarball = os.path.join(pwd, 'iotools-1.2.tar.gz')
41 utils.update_version(pwd+'/src', False, version, setup, tarball, pwd) 44 utils.update_version(pwd+'/src', False, version, setup, tarball, pwd)
OLDNEW
« 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