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

Unified Diff: src/untrusted/irt_stub/nacl.scons

Issue 7265001: Build and use libraries locally in the nacl build, not requiring "partial SDK" (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: final fix for pnacl Created 9 years, 6 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 | « src/untrusted/ehsupport/nacl.scons ('k') | src/untrusted/pthread/nacl.scons » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/untrusted/irt_stub/nacl.scons
diff --git a/src/untrusted/irt_stub/nacl.scons b/src/untrusted/irt_stub/nacl.scons
index 4c51fe8f5eb75116f0c9494a9275bd971251d96d..596678c09e0b44139b21f6c71106f2e70cef6521 100644
--- a/src/untrusted/irt_stub/nacl.scons
+++ b/src/untrusted/irt_stub/nacl.scons
@@ -11,11 +11,7 @@ env.ComponentLibrary('libppapi_stub', [
'plugin_main_irt.c',
'thread_creator.c'
])
-env.AddLibraryToSdk(['libppapi_stub'])
-env.AddObjectToSdk(['libppapi.a'])
-
-if not env.Bit('nacl_disable_shared'):
- env.AddObjectToSdk(['libppapi.so'])
+lib = env.AddLibraryToSdk(['libppapi_stub'])
gap_env = env.Clone()
gap_env.Append(CPPDEFINES=[
@@ -31,4 +27,22 @@ link_segment_gap = gap_env.ComponentObject(
'link_segment_gap',
'${SCONSTRUCT_DIR}/src/untrusted/irt/link_segment_gap.S'
)
-gap_env.AddObjectToSdk(link_segment_gap, is_platform=True)
+gap_obj = gap_env.AddObjectToSdk(link_segment_gap, is_platform=True)
+
+static_script = env.AddObjectToSdk(['libppapi.a'])
+
+# Anything that links with -lppapi (i.e. ${PPAPI_LIBS}) needs not just the
+# libppapi.a or libppapi.so linker script file, but also the object and
+# library it refers to. By telling scons that libppapi.a depends on these
+# objects, we ensure that it builds them before something using ${PPAPI_LIBS}.
+script_deps = [gap_obj, lib]
+env.Depends(static_script, script_deps)
+
+# The static libppapi.a refers to libpthread.a, and in the non-glibc
+# build, we are the one providing that too.
+if not env.Bit('nacl_glibc'):
+ env.Depends(static_script, env.File('${LIB_DIR}/libpthread.a'))
+
+if not env.Bit('nacl_disable_shared'):
+ dyn_script = env.AddObjectToSdk(['libppapi.so'])
+ env.Depends(dyn_script, script_deps)
« no previous file with comments | « src/untrusted/ehsupport/nacl.scons ('k') | src/untrusted/pthread/nacl.scons » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698