Index: pnacl/driver/pnacl-ld.py |
diff --git a/pnacl/driver/pnacl-ld.py b/pnacl/driver/pnacl-ld.py |
index a70a16a520549a55fc25845551f2e7a6b8c05ce6..bc999309df05609c66104d5285f2c22361fd5c01 100755 |
--- a/pnacl/driver/pnacl-ld.py |
+++ b/pnacl/driver/pnacl-ld.py |
@@ -337,8 +337,9 @@ def main(argv): |
tng = TempNameGen([], output) |
+ has_bitcode = HasBitcodeInputs(inputs) |
# Do the bitcode link. |
- if HasBitcodeInputs(inputs): |
+ if has_bitcode: |
chain = DriverChain(inputs, output, tng) |
chain.add(LinkBC, 'pre_opt.' + bitcode_type) |
@@ -377,13 +378,11 @@ def main(argv): |
# reintroduce ConstantExprs. However, '-expand-getelementptr' |
# must follow '-expand-constant-expr' to expand the |
# getelementptr instructions it creates. |
- passes = ['-expand-constant-expr', |
+ # We place '-strip-metadata' after optimization passes are run |
+ # since optimizations depend on the metadata. |
+ passes = ['-strip-metadata', |
+ '-expand-constant-expr', |
'-expand-getelementptr'] |
- if (not env.getbool('DISABLE_ABI_CHECK') and |
- not env.getbool('ALLOW_CXX_EXCEPTIONS') and |
- len(native_objects) == 0): |
- passes += ['-verify-pnaclabi-module', |
- '-verify-pnaclabi-functions'] |
chain.add(DoLLVMPasses(passes), |
'expand_features_after_opt.' + bitcode_type) |
else: |
@@ -396,6 +395,13 @@ def main(argv): |
chain.run() |
+ if (has_bitcode and |
+ env.getbool('STATIC') and |
+ not env.getbool('DISABLE_ABI_CHECK') and |
+ not env.getbool('ALLOW_CXX_EXCEPTIONS') and |
+ len(native_objects) == 0): |
+ RunDriver('abicheck', [output, '-allow-debug-metadata']) |
Mark Seaborn
2013/04/25 18:03:35
Why a separate invocation? This will be slower.
jvoung (off chromium)
2013/04/26 21:24:49
Merged the check back into the other run of opt.
|
+ |
if bitcode_type == 'pexe' and not arch_flag_given: |
# Mark .pexe files as executable. |
# Some versions of 'configure' expect this. |