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..6e17354f457b4535f2a3c01703a69ae5ff784c14 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 == []) |
| # Make sure the inputs have matching arch. |
| CheckInputsArch(inputs) |
| @@ -404,6 +410,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 += ['-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,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 = [] |
|
Mark Seaborn
2016/03/30 23:24:57
Nit: "plls" plural?
Sean Klein
2016/04/01 23:12:24
Done.
|
| + other = [] |
| + |
| + for f in inputs: |
| + if ldtools.IsFlag(f): |
|
Mark Seaborn
2016/03/30 23:24:57
How about simplifying to "if ldtools.IsFlag(f) and
Sean Klein
2016/04/01 23:12:24
I'm pretty sure you mean "or", not "and". Updating
|
| + 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) |
| """ |