From aeb030bead432a2de8fe8075afca2d070bb5540d Mon Sep 17 00:00:00 2001 From: Mike Harsch Date: Sun, 6 Jan 2013 22:29:38 -0700 Subject: [PATCH] build: fail w/err msg when missing binutils Building --with-dtrace requires objdump from GNU binutils. This change inserts a helpful error message if there is a problem executing objdump. --- tools/genv8constants.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tools/genv8constants.py b/tools/genv8constants.py index fb8b5ffa8c6..a79ba06fdc1 100755 --- a/tools/genv8constants.py +++ b/tools/genv8constants.py @@ -10,14 +10,28 @@ import re import subprocess import sys +import errno if len(sys.argv) != 3: print "usage: objsym.py outfile libv8_base.a" sys.exit(2); outfile = file(sys.argv[1], 'w'); -pipe = subprocess.Popen([ 'objdump', '-z', '-D', sys.argv[2] ], - bufsize=-1, stdout=subprocess.PIPE).stdout; +try: + pipe = subprocess.Popen([ 'objdump', '-z', '-D', sys.argv[2] ], + bufsize=-1, stdout=subprocess.PIPE).stdout; +except OSError, e: + if e.errno == errno.ENOENT: + print ''' + Node.js compile error: could not find objdump + + Check that GNU binutils are installed and included in PATH + ''' + else: + print 'problem running objdump: ', e.strerror + + sys.exit() + pattern = re.compile('(00000000|0000000000000000) <(.*)>:'); v8dbg = re.compile('^v8dbg.*$') numpattern = re.compile('^[0-9a-fA-F]{2} $');