From bd75e1d0bd25543308f5a3092e88ea24476ab1a9 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 30 Jun 2017 17:27:55 -0700 Subject: [PATCH] Add $ORIGIN to rpath for host tests Allow loading test libraries installed into the test directory. Test: builds Change-Id: I15a462ebd41b99e9eb76b5be889ed3bd013732e0 --- cc/test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cc/test.go b/cc/test.go index fa75f4839..9df346758 100644 --- a/cc/test.go +++ b/cc/test.go @@ -175,11 +175,16 @@ func (test *testDecorator) linkerDeps(ctx BaseModuleContext, deps Deps) Deps { } func (test *testDecorator) linkerInit(ctx BaseModuleContext, linker *baseLinker) { + // add ../../lib[64] to rpath so that out/host/linux-x86/nativetest// can + // find out/host/linux-x86/lib[64]/library.so runpath := "../../lib" if ctx.toolchain().Is64Bit() { runpath += "64" } linker.dynamicProperties.RunPaths = append(linker.dynamicProperties.RunPaths, runpath) + + // add "" to rpath so that test binaries can find libraries in their own test directory + linker.dynamicProperties.RunPaths = append(linker.dynamicProperties.RunPaths, "") } func (test *testDecorator) linkerProps() []interface{} {