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

Unified Diff: build/build_nexe.py

Issue 137803016: build_nexe.py can now apply tls_edit (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Added proper executable suffix in gypi rules for tls_edit Created 6 years, 10 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 | build/untrusted.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/build_nexe.py
diff --git a/build/build_nexe.py b/build/build_nexe.py
index 5d817e41a0db40dd7528145afda3071330e208c0..fc4ec084102d492116bb97d975f731e603b4c6db 100644
--- a/build/build_nexe.py
+++ b/build/build_nexe.py
@@ -268,6 +268,7 @@ class Builder(object):
self.empty = options.empty
self.strip_all = options.strip_all
self.strip_debug = options.strip_debug
+ self.tls_edit = options.tls_edit
self.finalize_pexe = options.finalize_pexe and arch == 'pnacl'
goma_config = GetGomaConfig(options.gomadir, self.osname, arch, toolname,
self.is_pnacl_toolchain)
@@ -574,17 +575,29 @@ class Builder(object):
out = self.LinkOutputName()
self.Log('\nLink %s' % out)
bin_name = self.GetCXXCompiler()
- MakeDir(os.path.dirname(out))
- self.CleanOutput(out)
- cmd_line = [bin_name, '-o', out, '-Wl,--as-needed']
+ link_out = out
+ if self.tls_edit is not None:
+ link_out = out + '.raw'
+
+ MakeDir(os.path.dirname(link_out))
+ self.CleanOutput(link_out)
+
+ cmd_line = [bin_name, '-o', link_out, '-Wl,--as-needed']
if not self.empty:
cmd_line += srcs
cmd_line += self.link_options
- err = self.Run(cmd_line, out)
+ err = self.Run(cmd_line, link_out)
if err:
raise Error('FAILED with %d: %s' % (err, ' '.join(cmd_line)))
+
+ if self.tls_edit is not None:
+ tls_edit_cmd = [self.tls_edit, link_out, out]
+ tls_edit_err = self.Run(tls_edit_cmd, out)
+ if tls_edit_err:
+ raise Error('FAILED with %d: %s' % (err, ' '.join(tls_edit_cmd)))
+
return out
# For now, only support translating a pexe, and not .o file(s)
@@ -716,6 +729,8 @@ def Main(argv):
action='store_false')
parser.add_option('--source-list', dest='source_list',
help='Filename to load a source list from')
+ parser.add_option('--tls-edit', dest='tls_edit', default=None,
+ help='tls_edit location if TLS should be modified for IRT')
parser.add_option('-a', '--arch', dest='arch',
help='Set target architecture')
parser.add_option('-c', '--compile', dest='compile_only', default=False,
« no previous file with comments | « no previous file | build/untrusted.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698