The cast executables set RPATH. If shared_libraries set RUNPATH, this
can causes issues since the RUNPATH in the shard_lib suppresses the RPATH from
the parent executable, but libraries are placed such that the parent
binary RPATH will find them.
If RUNPATH/RPATH are not set on the shared_libraries, then the parent
RPATH gets used correctly.
BUG=internal b/37514052
TEST=build libcast_media_1.0.so
readelf -a libcast_media_1.0.so | grep PATH
RUNPATh and RPATH are not set
Change-Id: I3866ddd84ced393a3926b023160298054d9a4adb
Reviewed-on: https://chromium-review.googlesource.com/487827
Reviewed-by: Stephen Lanham <slan@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Mike Bjorge <mbjorge@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#467562}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b38b5bbfa9a59152bdb56a528c772715845b3e37
Previously this was guarded with use_clang on shared_library_config, but
some targets use static_config directly.
BUG=b/37232530
TEST=Build and run device. Check {C/LD}FLAGS
Review-Url: https://codereview.chromium.org/2808253003
Cr-Original-Commit-Position: refs/heads/master@{#463795}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 58a97b349697f6764d0d0304a8374da957ef2207
We recently hit a corner case on the component build from the following
dependency structure:
/chrome/crash_uploader ("//chromecast/crash:crash_uploader") ->
/chrome/lib/libcast_reboot_1.0.so ("//chromecast/system/reboot") ->
/chrome/libnet.so ("//net")
In libcast_reboot_1.0.so's RPATH, $ORIGIN resolves to /chrome/lib,
meaning that it never searches /chrome/ for libnet.so, causing it to
crash. Explicitly adding the location of component libs to the RPATH
solves this issue.
Note: The RPATH will not be changed in production builds, which do not
use the component build.
BUG=
Change-Id: I0646a063ad787d3fe846fd0755f7f84a4cb6033b
Review-Url: https://codereview.chromium.org/2686903002
Cr-Original-Commit-Position: refs/heads/master@{#449130}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 3301fc1e1974b51ccb59f24519de0dcde34b9333
Reason for revert:
The original fix is opt-in, which causes unit test binaries to miss symbols. I will
reimplement an opt-out for binaries that we do not want to whole-archive libs.
Original issue description:
>> All chromecast executable include all libstdc++/libgcc symbols by default
>> due to b/25566835. Added a config for --whole-archive for only ones that
>> depend on shared libs. ~700kb saving per executable.
BUG=internal b/31417380
This reverts commit 92947f235fcf22912990029925b4154e7ea08f74.
Review-Url: https://codereview.chromium.org/2334163004
Cr-Original-Commit-Position: refs/heads/master@{#418640}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 19adc908726781b299b441d3142f29143f234753
All chromecast executable include all libstdc++/libgcc symbols by default
due to b/25566835. Added a config for --whole-archive for only ones that
depend on shared libs. ~700kb saving per executable.
BUG=internal b/30398176
Review-Url: https://codereview.chromium.org/2288953002
Cr-Original-Commit-Position: refs/heads/master@{#416588}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 92947f235fcf22912990029925b4154e7ea08f74
Update default rpath for Chromecast builds to include:
* $ORIGIN
* $ORIGIN/lib
* /oem_cast_shlib
Verified by running executables on-device. Our scripts put shared libraries
in each of these three places.
BUG=516899
Bug: b/17615224
Review URL: https://codereview.chromium.org/1650233002
Cr-Original-Commit-Position: refs/heads/master@{#372464}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 3d909442b74ce4874f3032233b0e08846028c2cb
Chromecast executables depend on several shared libraries in $ORIGIN for
platform and OEM abstraction. The rpath for executables should be
updated so that these libraries can be found at runtime. This logic is
added here, instead of //build/config/gcc:executable_ldconfig, to keep
Chromecast-specific configs as concentrated as possible.
A note about security concerns: Chrome only enables this by default for
component and sanitizer builds, never shipped builds. This is to protect
users from arbitrary binaries being run in the shared lib directory.
Chromecast does not share these concerns, as it only runs trusted web
applications in practice.
BUG=516899
Review URL: https://codereview.chromium.org/1639343002
Cr-Original-Commit-Position: refs/heads/master@{#371886}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 875b6f2a243ffbfb5bc3cd86f8ae97c3659c010d
Use "--exclude-libs" flag to prevent libffmpeg.a from exporting
symbols implemented by assembly.
Assembly functions marked with ".global" directive are automatically
with global visibility and exported in executable and DSO. This is
unnecessary and causes incorrect symbol resolution at run-time as
Chromecast executable is built with "-Wl,--export-dynamic".
BUG= internal b/26390825
TEST= 1) Use "nm" and make sure ff_* are not exported.
2) Test TuneIn playback.
Review URL: https://codereview.chromium.org/1561833007
Cr-Original-Commit-Position: refs/heads/master@{#368737}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a39bee512a85a6a015769ced60015a2fe7d3d767
For GN this change required refactoring the way default configs are
applied to executables and shared libraries. The targets
//build/config:{executable_config, shared_library_config} were
created for this purpose.
BUG= internal b/25566835
Review URL: https://codereview.chromium.org/1476923004
Cr-Original-Commit-Position: refs/heads/master@{#364118}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: fbf4f9ac36e9e121620d65ca85dd998a67745049