Skip to content

Commit

Permalink
Use gyp variables for NaCl untrusted build paths instead of hardcodin…
Browse files Browse the repository at this point in the history
…g them.

Add the build_irt variable to targets which are part of the NaCl IRT.

The aim of this CL is to enable the IRT to use untrusted library builds
which are separate from those linked into testing nexes and the NaCl
SDK, and ultimately to allow a different compiler to be used to build them.
These libraries get an extra build_irt variable which will cause them to
be built an extra time for the IRT. This is a prerequisite for NaCl CL
https://codereview.chromium.org/21362004
to be DEPSed into Chrome, after which the build_newlib variable for most
of them can go away (most libraries only need to go into the IRT or into
the SDK/test nexes, but not both).

R=bradnelson@google.com
TBR=dmichael@chromium.org,brettw@chromium.org,piman@chromium.org,fischman@chromium.org
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3577

Review URL: https://chromiumcodereview.appspot.com/21898006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215530 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
dschuff@chromium.org committed Aug 4, 2013
1 parent b8a46fb commit c5707ee
Show file tree
Hide file tree
Showing 14 changed files with 177 additions and 225 deletions.
1 change: 1 addition & 0 deletions base/base_untrusted.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'nlib_target': 'libbase_untrusted.a',
'build_glibc': 1,
'build_newlib': 1,
'build_irt': 1,
'sources': [
'base_switches.cc',
'base_switches.h',
Expand Down
1 change: 1 addition & 0 deletions components/tracing_untrusted.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
'nlib_target': 'libtracing_untrusted.a',
'build_glibc': 0,
'build_newlib': 1,
'build_irt': 1,
},
'sources': [
'tracing/child_trace_message_filter.cc',
Expand Down
1 change: 1 addition & 0 deletions gpu/command_buffer/command_buffer_untrusted.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'nlib_target': 'libgles2_utils_untrusted.a',
'build_glibc': 0,
'build_newlib': 1,
'build_irt': 1,
},
'dependencies': [
'../../native_client/tools.gyp:prep_toolchain',
Expand Down
5 changes: 5 additions & 0 deletions gpu/gpu_untrusted.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
'nlib_target': 'libgles2_implementation_untrusted.a',
'build_glibc': 0,
'build_newlib': 1,
'build_irt': 1,
},
'defines': [
'GLES2_IMPL_IMPLEMENTATION',
Expand All @@ -46,6 +47,7 @@
'nlib_target': 'libcommand_buffer_common_untrusted.a',
'build_glibc': 0,
'build_newlib': 1,
'build_irt': 1,
},
'includes': [
'command_buffer_common.gypi',
Expand All @@ -64,6 +66,7 @@
'nlib_target': 'libgles2_cmd_helper_untrusted.a',
'build_glibc': 0,
'build_newlib': 1,
'build_irt': 1,
},
'includes': [
'gles2_cmd_helper.gypi',
Expand All @@ -82,6 +85,7 @@
'nlib_target': 'libcommand_buffer_client_untrusted.a',
'build_glibc': 0,
'build_newlib': 1,
'build_irt': 1,
},
'includes': [
'command_buffer_client.gypi',
Expand All @@ -100,6 +104,7 @@
'nlib_target': 'libgpu_ipc_untrusted.a',
'build_glibc': 0,
'build_newlib': 1,
'build_irt': 1,
},
'includes': [
'gpu_ipc.gypi',
Expand Down
1 change: 1 addition & 0 deletions ipc/ipc_untrusted.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'nlib_target': 'libipc_untrusted.a',
'build_glibc': 0,
'build_newlib': 1,
'build_irt': 1,
},
'dependencies': [
'<(DEPTH)/native_client/tools.gyp:prep_toolchain',
Expand Down
1 change: 1 addition & 0 deletions media/media_untrusted.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
'nlib_target': 'libshared_memory_support_untrusted.a',
'build_glibc': 0,
'build_newlib': 1,
'build_irt': 1,
},
'dependencies': [
'../native_client/tools.gyp:prep_toolchain',
Expand Down
303 changes: 119 additions & 184 deletions ppapi/native_client/native_client.gyp

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
'type': 'none',
'variables': {
'nlib_target': 'libpnacl_irt_shim.a',
'out_newlib_arm': '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-arm/libpnacl_irt_shim.a',
'out_newlib32': '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-x86-32/libpnacl_irt_shim.a',
'out_newlib64': '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-x86-64/libpnacl_irt_shim.a',
'out_newlib_arm': '>(tc_lib_dir_pnacl_translate)/lib-arm/libpnacl_irt_shim.a',
'out_newlib32': '>(tc_lib_dir_pnacl_translate)/lib-x86-32/libpnacl_irt_shim.a',
'out_newlib64': '>(tc_lib_dir_pnacl_translate)/lib-x86-64/libpnacl_irt_shim.a',
'build_glibc': 0,
'build_newlib': 1,
'force_arm_pnacl': 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@
'<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_pnacl_llc_nexe',
],
'inputs': [
'<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-x86-32/libpnacl_irt_shim.a',
'<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-x86-64/libpnacl_irt_shim.a',
'>(tc_lib_dir_pnacl_translate)/lib-x86-32/libpnacl_irt_shim.a',
'>(tc_lib_dir_pnacl_translate)/lib-x86-64/libpnacl_irt_shim.a',
],
'variables': {
'lib_overrides': [
# Use the two freshly generated shims.
'--lib_override=ia32,<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-x86-32/libpnacl_irt_shim.a',
'--lib_override=x64,<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-x86-64/libpnacl_irt_shim.a',
'--lib_override=ia32,>(tc_lib_dir_pnacl_translate)/lib-x86-32/libpnacl_irt_shim.a',
'--lib_override=x64,>(tc_lib_dir_pnacl_translate)/lib-x86-64/libpnacl_irt_shim.a',
],
},
}],
Expand All @@ -81,12 +81,12 @@
'<(PRODUCT_DIR)/pnacl/pnacl_public_arm_pnacl_llc_nexe',
],
'inputs': [
'<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-arm/libpnacl_irt_shim.a',
'>(tc_lib_dir_pnacl_translate)/lib-arm/libpnacl_irt_shim.a',
],
'variables': {
'lib_overrides': [
# Use the freshly generated shim.
'--lib_override=arm,<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-arm/libpnacl_irt_shim.a',
'--lib_override=arm,>(tc_lib_dir_pnacl_translate)/lib-arm/libpnacl_irt_shim.a',
],
},
}],
Expand All @@ -103,12 +103,12 @@
'<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_pnacl_llc_nexe',
],
'inputs': [
'<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-x86-32/libpnacl_irt_shim.a',
'>(tc_lib_dir_pnacl_translate)/lib-x86-32/libpnacl_irt_shim.a',
],
'variables': {
'lib_overrides': [
# Use the freshly generated shim.
'--lib_override=ia32,<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-x86-32/libpnacl_irt_shim.a',
'--lib_override=ia32,>(tc_lib_dir_pnacl_translate)/lib-x86-32/libpnacl_irt_shim.a',
],
},
}],
Expand All @@ -125,12 +125,12 @@
'<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_pnacl_llc_nexe',
],
'inputs': [
'<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-x86-64/libpnacl_irt_shim.a',
'>(tc_lib_dir_pnacl_translate)/lib-x86-64/libpnacl_irt_shim.a',
],
'variables': {
'lib_overrides': [
# Use the freshly generated shim.
'--lib_override=x64,<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-x86-64/libpnacl_irt_shim.a',
'--lib_override=x64,>(tc_lib_dir_pnacl_translate)/lib-x86-64/libpnacl_irt_shim.a',
],
},
}],
Expand Down
1 change: 1 addition & 0 deletions ppapi/ppapi_ipc_untrusted.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
'nlib_target': 'libppapi_ipc_untrusted.a',
'build_glibc': 0,
'build_newlib': 1,
'build_irt': 1,
},
'include_dirs': [
'..',
Expand Down
4 changes: 2 additions & 2 deletions ppapi/ppapi_nacl_test_common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@
'inputs': ['>(out_glibc64)'],
'action': [
'--library-path=>(libdir_glibc64)',
'--library-path=<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64',
'--library-path=>(tc_lib_dir_glibc64)',
],
}],
['enable_x86_32==1', {
'inputs': ['>(out_glibc32)'],
'action': [
'--library-path=>(libdir_glibc32)',
'--library-path=<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32',
'--library-path=>(tc_lib_dir_glibc32)',
],
}],
# TODO(ncbray) handle arm case. We don't have ARM glibc yet.
Expand Down
1 change: 1 addition & 0 deletions ppapi/ppapi_proxy_untrusted.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'nlib_target': 'libppapi_proxy_untrusted.a',
'build_glibc': 0,
'build_newlib': 1,
'build_irt': 1,
},
'include_dirs': [
'..',
Expand Down
1 change: 1 addition & 0 deletions ppapi/ppapi_shared_untrusted.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
'nlib_target': 'libppapi_shared_untrusted.a',
'build_glibc': 0,
'build_newlib': 1,
'build_irt': 1,
},
'include_dirs': [
'..',
Expand Down
56 changes: 30 additions & 26 deletions ppapi/ppapi_untrusted.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -97,31 +97,35 @@
'translate_flags': [
'-O0',
],
# TODO(bradchen): get rid of extra_deps64 and extra_deps32
# once native_client/build/untrusted.gypi no longer needs them.
'extra_deps_newlib64': [
'<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/libppapi_cpp.a',
'<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/libppapi.a',
],
'extra_deps_newlib32': [
'<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32/libppapi_cpp.a',
'<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32/libppapi.a',
],
'extra_deps_glibc64': [
'<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64/libppapi_cpp.so',
'<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64/libppapi.so',
],
'extra_deps_glibc32': [
'<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32/libppapi_cpp.so',
'<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32/libppapi.so',
],
'extra_deps_arm': [
'<(SHARED_INTERMEDIATE_DIR)/tc_newlib/libarm/libppapi_cpp.a',
'<(SHARED_INTERMEDIATE_DIR)/tc_newlib/libarm/libppapi.a',
'conditions': [
['target_arch!="arm"', {
'extra_deps_newlib64': [
'>(tc_lib_dir_newlib64)/libppapi_cpp.a',
'>(tc_lib_dir_newlib64)/libppapi.a',
],
'extra_deps_newlib32': [
'>(tc_lib_dir_newlib32)/libppapi_cpp.a',
'>(tc_lib_dir_newlib32)/libppapi.a',
],
'extra_deps_glibc64': [
'>(tc_lib_dir_glibc64)/libppapi_cpp.so',
'>(tc_lib_dir_glibc64)/libppapi.so',
],
'extra_deps_glibc32': [
'>(tc_lib_dir_glibc32)/libppapi_cpp.so',
'>(tc_lib_dir_glibc32)/libppapi.so',
],
}],
['target_arch=="arm"', {
'extra_deps_arm': [
'>(tc_lib_dir_newlib_arm)/libppapi_cpp.a',
'>(tc_lib_dir_newlib_arm)/libppapi.a',
],
}],
],
'extra_deps_pnacl': [
'<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib/lib/libppapi_cpp.a',
'<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib/lib/libppapi.a',
'extra_deps_pnacl_newlib': [
'>(tc_lib_dir_pnacl_newlib)/libppapi_cpp.a',
'>(tc_lib_dir_pnacl_newlib)/libppapi.a',
],
'sources': [
'<@(test_common_source_files)',
Expand Down Expand Up @@ -157,8 +161,8 @@
'--objdump=>(nacl_objdump)',
'--library-path=>(libdir_glibc64)',
'--library-path=>(libdir_glibc32)',
'--library-path=<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32',
'--library-path=<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64',
'--library-path=>(tc_lib_dir_glibc32)',
'--library-path=>(tc_lib_dir_glibc64)',
'--output=>(nmf_glibc)',
'--stage-dependencies=<(PRODUCT_DIR)',
],
Expand Down

0 comments on commit c5707ee

Please sign in to comment.