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

Side by Side Diff: src/trusted/validator_ragel/obtain_binutils.py

Issue 10826182: Validator_ragel: move checkdecoder test from Makefile to scons (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: rebase Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 #!/usr/bin/python
2 #
3 # Copyright (c) 2012 The Native Client Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 """Obtain objdump and gas binaries.
8
9 Usage:
10 obtain_binutils.py <objdump> <gas>
11
12 Check out appropriate version of binutils, compile it and
13 copy objdump and gas binaries to specified places.
14 """
15
16 import os
17 import shutil
18 import sys
19
20 CHECKOUT_DIR = '/dev/shm/binutils'
21
22 BINUTILS_REPO = 'http://git.chromium.org/native_client/nacl-binutils.git'
23 BINUTILS_REVISION = '6993545d5650fa77e75e9ae4b52c5703a53c53cc'
24
25 # We need specific revision of binutils, and it have to include the
26 # following patches:
27 # Add prefetch_modified - non-canonical encoding of prefetch
28 #
29 # Properly handle data16+rex.w instructions, such as
30 # 66 48 68 01 02 03 04 data32 pushq $0x4030201
31 #
32 # We are not using head revision because decoder test depends
33 # on precise format of objdump output.
34
35
36 def Command(cmd):
37 print
38 print 'Running:', cmd
39 print
40 result = os.system(cmd)
41 if result != 0:
42 print 'Command returned', result
43 exit(result)
44
45
46 def main():
47 if len(sys.argv) != 3:
48 print __doc__
49 sys.exit(1)
50
51 if os.path.exists(CHECKOUT_DIR):
52 shutil.rmtree(CHECKOUT_DIR)
53
54 Command('git clone %s %s' % (BINUTILS_REPO, CHECKOUT_DIR))
55
56 try:
57 old_dir = os.getcwd()
58 os.chdir(CHECKOUT_DIR)
59 Command('git checkout %s' % BINUTILS_REVISION)
60
61 # They both are required to make binutils,
62 # and when they are missing binutils's make
63 # error messages are cryptic.
64 Command('flex --version')
65 Command('bison --version')
66
67 Command('./configure')
68 Command('make')
69
70 os.chdir(old_dir)
71 objdump, gas = sys.argv[1:]
72 shutil.copy(os.path.join(CHECKOUT_DIR, 'binutils', 'objdump'), objdump)
73 shutil.copy(os.path.join(CHECKOUT_DIR, 'gas', 'as-new'), gas)
74 finally:
75 shutil.rmtree(CHECKOUT_DIR)
76
77 print 'ok'
78
79
80 if __name__ == '__main__':
81 main()
OLDNEW
« no previous file with comments | « src/trusted/validator_ragel/build.scons ('k') | src/trusted/validator_ragel/unreviewed/decoder_test_one_file.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698