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

Unified Diff: pnacl/driver/pnacl-ld.py

Issue 1825893002: PNaCl Dynamic Linking: Added portable dependencies to shared objects. (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Bumping Feature Version Created 4 years, 8 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 | « pnacl/driver/filetype.py ('k') | src/untrusted/pll_loader/pll_loader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pnacl/driver/pnacl-ld.py
diff --git a/pnacl/driver/pnacl-ld.py b/pnacl/driver/pnacl-ld.py
index 08abb18e6e5929f036afc41d02886b4e0839a4f1..9568ba893fd90b9799b3d2281bc6aa042f11f896 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') and plls != []:
+ Log.Fatal('Passing a PLL to the linker requires the "-shared" option.')
# Make sure the inputs have matching arch.
CheckInputsArch(inputs)
@@ -404,6 +410,10 @@ 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 +521,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)
"""
« no previous file with comments | « pnacl/driver/filetype.py ('k') | src/untrusted/pll_loader/pll_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698