Merge "Add $ORIGIN to rpath for cc_test modules" into main am: 783fa37807
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3083002 Change-Id: I0b3ae062fda3c154864318cd641428982ad1bf87 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -359,6 +359,12 @@ func (test *testBinary) linkerDeps(ctx DepsContext, deps Deps) Deps {
|
||||
func (test *testBinary) linkerFlags(ctx ModuleContext, flags Flags) Flags {
|
||||
flags = test.binaryDecorator.linkerFlags(ctx, flags)
|
||||
flags = test.testDecorator.linkerFlags(ctx, flags)
|
||||
|
||||
// Add a default rpath to allow tests to dlopen libraries specified in data_libs.
|
||||
// Host modules already get an rpath specified in linker.go.
|
||||
if !ctx.Host() {
|
||||
flags.Global.LdFlags = append(flags.Global.LdFlags, `-Wl,-rpath,\$$ORIGIN`)
|
||||
}
|
||||
return flags
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user