Chromium Code Reviews| Index: pnacl/driver/pnacl-ld.py |
| diff --git a/pnacl/driver/pnacl-ld.py b/pnacl/driver/pnacl-ld.py |
| index 08abb18e6e5929f036afc41d02886b4e0839a4f1..9f642710c6734e01848d67efa5badadde59ad129 100755 |
| --- a/pnacl/driver/pnacl-ld.py |
| +++ b/pnacl/driver/pnacl-ld.py |
| @@ -345,6 +345,10 @@ def main(argv): |
| # pnacl_generate_pexe=0 with glibc, |
| # for user libraries. |
| ldtools.LibraryTypes.ANY) |
| + (plls, inputs) = FilterPlls(inputs) |
|
Mark Seaborn
2016/03/30 23:24:57
Nit: You don't need ()s around "plls, inputs" here
Sean Klein
2016/04/01 23:12:24
Done.
|
| + |
| + if not env.getbool('SHARED'): |
| + assert(plls == []) |
| # Make sure the inputs have matching arch. |
| CheckInputsArch(inputs) |
| @@ -404,6 +408,11 @@ def main(argv): |
| '-rewrite-llvm-intrinsic-calls', |
| '-convert-to-pso', |
| ] |
| + |
| + # ConvertToPso takes a list of comma-separated PLL dependencies as an |
| + # argument. |
| + if plls != []: |
| + pre_simplify_shared += ['-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 +520,21 @@ def FixPrivateLibs(user_libs): |
| result_libs.append(user_lib) |
| return result_libs |
| +def FilterPlls(inputs): |
| + """ Split the input list into PLLs and other objects (.pll, other) |
| + """ |
| + pll = [] |
| + other = [] |
| + |
| + for f in inputs: |
| + if ldtools.IsFlag(f): |
| + other.append(f) |
| + elif filetype.IsPll(f): |
| + pll.append(f) |
| + else: |
| + other.append(f) |
| + return (pll, other) |
| + |
| def SplitLinkLine(inputs): |
| """ Split the input list into bitcode and native objects (.o, .a) |
| """ |