diff options
author | 2020-08-25 12:48:19 -0400 | |
---|---|---|
committer | 2020-08-26 17:07:29 -0400 | |
commit | 2093af23c06429f5dd22dbae5d47ef800a9fb379 (patch) | |
tree | f1f1588b408f22ac7b44c38e11eaa139b7ef606d /rust/library.go | |
parent | f5a2b8a64113630ce0d8d5922f96e951fb2c9f12 (diff) |
[rust] Pass cc dependencies as linker flags.
In order to support cc dependencies which do not start with the 'lib'
prefix, we can't pass them through the -l flag. Instead, we can pass
them directly to linker flags.
Bug: 166151658
Test: cd external/rust/; mma
Test: cd external/crosvm/; mma
Test: Test linking to a cc dep that does not begin with 'lib'
Change-Id: I5acbf3d3405e66446f3eae600b35683c4eb3d8a5
Diffstat (limited to 'rust/library.go')
-rw-r--r-- | rust/library.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/rust/library.go b/rust/library.go index 6766d618b..1339670f3 100644 --- a/rust/library.go +++ b/rust/library.go @@ -381,6 +381,7 @@ func (library *libraryDecorator) compile(ctx ModuleContext, flags Flags, deps Pa } flags.RustFlags = append(flags.RustFlags, deps.depFlags...) + flags.LinkFlags = append(flags.LinkFlags, deps.linkObjects...) if library.dylib() { // We need prefer-dynamic for now to avoid linking in the static stdlib. See: @@ -427,6 +428,7 @@ func (library *libraryDecorator) compile(ctx ModuleContext, flags Flags, deps Pa if library.rlib() || library.dylib() { library.exportLinkDirs(deps.linkDirs...) library.exportDepFlags(deps.depFlags...) + library.exportLinkObjects(deps.linkObjects...) } library.unstrippedOutputFile = outputFile |