Index: pnacl/driver/pnacl-ld.py |
diff --git a/pnacl/driver/pnacl-ld.py b/pnacl/driver/pnacl-ld.py |
index 08abb18e6e5929f036afc41d02886b4e0839a4f1..84bccf502c89166769a65d9b2be542efff6ff638 100755 |
--- a/pnacl/driver/pnacl-ld.py |
+++ b/pnacl/driver/pnacl-ld.py |
@@ -10,6 +10,7 @@ from driver_env import env |
from driver_log import Log |
import filetype |
import ldtools |
+import os |
import pathtools |
EXTRA_ENV = { |
@@ -345,6 +346,11 @@ def main(argv): |
# pnacl_generate_pexe=0 with glibc, |
# for user libraries. |
ldtools.LibraryTypes.ANY) |
+ plls, inputs = FilterPlls(inputs) |
+ plls = [os.path.basename(pll) for pll in plls] |
+ |
+ if not env.getbool('SHARED'): |
+ assert(plls == []) |
Mark Seaborn
2016/04/01 23:42:19
Style nit: don't need ()s here
However, the asser
Sean Klein
2016/04/02 00:50:33
Well, the linker driver requires that the extensio
|
# Make sure the inputs have matching arch. |
CheckInputsArch(inputs) |
@@ -404,6 +410,11 @@ def main(argv): |
'-rewrite-llvm-intrinsic-calls', |
'-convert-to-pso', |
] |
+ |
Mark Seaborn
2016/04/01 23:42:19
Nit: remove empty line to keep this block together
Sean Klein
2016/04/02 00:50:33
Done.
|
+ # ConvertToPso takes a list of comma-separated PLL dependencies as an |
+ # argument. |
+ if plls != []: |
+ pre_simplify_shared += ['-convert-to-pso-deps=' + ','.join(plls)] |
opt_args.append(pre_simplify_shared) |
# Post-opt is required, since '-convert-to-pso' adds metadata which must |
# be simplified before finalization. Additionally, all functions must be |
@@ -511,6 +522,19 @@ def FixPrivateLibs(user_libs): |
result_libs.append(user_lib) |
return result_libs |
+def FilterPlls(inputs): |
+ """ Split the input list into PLLs and other objects. |
+ """ |
+ plls = [] |
+ other = [] |
+ |
+ for f in inputs: |
+ if ldtools.IsFlag(f) or not filetype.IsPll(f): |
+ other.append(f) |
+ else: |
+ plls.append(f) |
+ return (plls, other) |
+ |
def SplitLinkLine(inputs): |
""" Split the input list into bitcode and native objects (.o, .a) |
""" |