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

Unified Diff: site_scons/site_tools/naclsdk.py

Issue 539683002: MinSFI: Add loader (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Fixed nits Created 6 years, 3 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 | « buildbot/buildbot_pnacl.sh ('k') | src/include/minsfi.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: site_scons/site_tools/naclsdk.py
diff --git a/site_scons/site_tools/naclsdk.py b/site_scons/site_tools/naclsdk.py
index 2208d6db98061740086ce926188cfd7ff3830cc0..b5f7f5848713abac479b171bd15b619fd098f82f 100755
--- a/site_scons/site_tools/naclsdk.py
+++ b/site_scons/site_tools/naclsdk.py
@@ -176,6 +176,19 @@ def _SetEnvForPnacl(env, root):
else:
ld_arch_flag = arch_flag
+ llc_mtriple_flag = ''
+ if env.Bit('minsfi'):
+ llc_cpu = ''
+ if env.Bit('build_x86_32'):
+ llc_cpu = 'i686'
+ elif env.Bit('build_x86_64'):
+ llc_cpu = 'x86_64'
+
+ if env.Bit('host_linux'):
+ llc_mtriple_flag = ' -mtriple=%s-linux-gnu' % llc_cpu
+ elif env.Bit('host_mac'):
+ llc_mtriple_flag = ' -mtriple=%s-apple-darwin' % llc_cpu
+
translator_root = os.path.join(os.path.dirname(root), 'pnacl_translator')
binprefix = os.path.join(root, 'bin', 'pnacl-')
@@ -202,6 +215,7 @@ def _SetEnvForPnacl(env, root):
pnacl_finalize = binprefix + 'finalize' + binext
pnacl_opt = binprefix + 'opt' + binext
pnacl_strip = binprefix + 'strip' + binext
+ pnacl_llc = binprefix + 'llc' + binext
# NOTE: XXX_flags start with space for easy concatenation
# The flags generated here get baked into the commands (CC, CXX, LINK)
@@ -211,6 +225,7 @@ def _SetEnvForPnacl(env, root):
pnacl_cc_flags = ' -std=gnu99'
pnacl_ld_flags = ' ' + ' '.join(env['PNACL_BCLDFLAGS'])
pnacl_translate_flags = ''
+ pnacl_llc_flags = ''
if env.Bit('nacl_pic'):
pnacl_cc_flags += ' -fPIC'
@@ -220,6 +235,10 @@ def _SetEnvForPnacl(env, root):
pnacl_ld_flags += ' -fPIC'
pnacl_translate_flags += ' -fPIC'
+ if env.Bit('minsfi'):
+ pnacl_llc_flags += ' -relocation-model=pic -filetype=obj'
+ pnacl_ld_flags += ' -nostdlib -Wl,-r'
+
if env.Bit('use_sandboxed_translator'):
sb_flags = ' --pnacl-sb'
pnacl_ld_flags += sb_flags
@@ -261,6 +280,7 @@ def _SetEnvForPnacl(env, root):
TRANSLATE=pnacl_translate + arch_flag + pnacl_translate_flags,
PNACLFINALIZE=pnacl_finalize,
PNACLOPT=pnacl_opt,
+ LLC=pnacl_llc + llc_mtriple_flag + pnacl_llc_flags,
)
if env.Bit('built_elsewhere'):
« no previous file with comments | « buildbot/buildbot_pnacl.sh ('k') | src/include/minsfi.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698