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

Unified 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: following Mark's suggestion, obtain binutils from gerrit repo instead of deps/third-party 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 side-by-side diff with in-line comments
Download patch
Index: src/trusted/validator_ragel/obtain_binutils.py
diff --git a/src/trusted/validator_ragel/obtain_binutils.py b/src/trusted/validator_ragel/obtain_binutils.py
new file mode 100755
index 0000000000000000000000000000000000000000..7c4c3c410ea406e10a9ceeb015f4cdfd955fcf68
--- /dev/null
+++ b/src/trusted/validator_ragel/obtain_binutils.py
@@ -0,0 +1,80 @@
+#!/usr/bin/python
+
+"""
+Usage:
+ %s <objdump> <gas>
+
+Check out appropriate version of binutils, compile it and
+copy objdump and gas binaries to specified places.
+"""
+
+import sys
+import os
+import shutil
+
+CHECKOUT_DIR = '/dev/shm/binutils'
+
+BINUTILS_REPO = 'http://git.chromium.org/native_client/nacl-binutils.git'
+BINUTILS_REVISION = '6993545d5650fa77e75e9ae4b52c5703a53c53cc'
+
+# We need specific revision of binutils, and it have to include the
+# following patches:
+# Add prefetch_modified - non-canonical encoding of prefetch
+#
+# Add lfence/mfence/sfence - non-canonical encodings.
khim 2012/08/08 13:40:24 After lond discussion we decided that this is not
Vlad Shcherbina 2012/08/08 13:46:52 Done.
+#
+# Properly handle data16+rex.w instructions, such as
+# 66 48 68 01 02 03 04 data32 pushq $0x4030201
+#
+# We are not using head revision because decoder test depends
+# on precise format of objdump output.
+
+
+def Command(cmd):
+ result = os.system(cmd)
+ if result != 0:
+ print 'Command "%s" returned %s' % (cmd, result)
+ exit(result)
+
+
+def main():
+ if len(sys.argv) != 3:
+ print __doc__ % os.path.split(__file__)[1]
+ exit(1)
+
+ if os.path.exists(CHECKOUT_DIR):
+ shutil.rmtree(CHECKOUT_DIR)
+
+ Command('git clone %s %s' % (BINUTILS_REPO, CHECKOUT_DIR))
+
+ old_dir = os.getcwd()
+ try:
+ os.chdir(CHECKOUT_DIR)
+ Command('git checkout %s' % BINUTILS_REVISION)
+
+ # to please make, set the same modification time
+ # for all files
+ Command('find . -print0 | xargs -0 touch -r .')
+
+ # they both are required to make binutils,
+ # and when they are missing binutils's make
+ # error messages are cryptic
+ Command('flex --version')
+ Command('bison --version')
+
+ Command('./configure')
+ Command('make')
+ finally:
+ os.chdir(old_dir)
+
+ objdump, gas = sys.argv[1:]
+ shutil.copy(os.path.join(CHECKOUT_DIR, 'binutils', 'objdump'), objdump)
+ shutil.copy(os.path.join(CHECKOUT_DIR, 'gas', 'as-new'), gas)
+
+ shutil.rmtree(CHECKOUT_DIR)
+
+ print 'ok'
+
+
+if __name__ == '__main__':
+ main()
« 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