aboutsummaryrefslogtreecommitdiff
path: root/cc/fuzz.go
diff options
context:
space:
mode:
authorMitch Phillips <mitchp@google.com>2019-11-14 14:50:47 -0800
committerMitch Phillips <mitchp@google.com>2019-11-14 15:08:59 -0800
commit1f7f54f44100ea6916e6fefbe3a9139dbc4e1a37 (patch)
tree64c19bd5353ea145ec1e6f65888eded8b2c49760 /cc/fuzz.go
parentf50bddb790424d31c7f475b072b81b98fb802bda (diff)
downloadsoong-1f7f54f44100ea6916e6fefbe3a9139dbc4e1a37.tar.gz
Add $$ORIGIN/lib to rpath for fuzz targets.
RPATH needs to be set to traverse the local directory's lib folder for fuzz target packages. Bug: N/A Test: m fuzz Change-Id: Idea4f04ce4c55315df7e808de5b2b4f06a88d82a
Diffstat (limited to 'cc/fuzz.go')
-rw-r--r--cc/fuzz.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/cc/fuzz.go b/cc/fuzz.go
index 15eafc864..476d805ec 100644
--- a/cc/fuzz.go
+++ b/cc/fuzz.go
@@ -103,8 +103,11 @@ func (fuzz *fuzzBinary) linkerDeps(ctx DepsContext, deps Deps) Deps {
func (fuzz *fuzzBinary) linkerFlags(ctx ModuleContext, flags Flags) Flags {
flags = fuzz.binaryDecorator.linkerFlags(ctx, flags)
- // RunPaths on devices isn't instantiated by the base linker.
+ // RunPaths on devices isn't instantiated by the base linker. `../lib` for
+ // installed fuzz targets (both host and device), and `./lib` for fuzz
+ // target packages.
flags.Local.LdFlags = append(flags.Local.LdFlags, `-Wl,-rpath,\$$ORIGIN/../lib`)
+ flags.Local.LdFlags = append(flags.Local.LdFlags, `-Wl,-rpath,\$$ORIGIN/lib`)
return flags
}