diff options
author | 2023-08-14 21:09:47 -0700 | |
---|---|---|
committer | 2023-08-14 21:27:41 -0700 | |
commit | c183e3a473e41ca38ddfc869d0979bb3bf314047 (patch) | |
tree | 33422def07d02732e08d40835417e04c71a1235c /rust/rust.go | |
parent | 9db358d43de252dae98932c9bc737a1109703ca8 (diff) |
Rust library linking fixes
- Hide universal binary dependency for rust
Without a darwin_arm64 libstd prebuilt, many rust binaries are not
possible to build as a universal binary anyway. This fixes an
intermediate error with compiling rust FFI targets, where C++ shared
library dependencies for both architectures were combined into the same
linker command.
There is still an outstanding problem with C++ executable targets that
include rust FFI library targets, as the rust FFI library targets
fail to find a proper libstd to build the arm64 side of the universal
executable.
- Use dynamic_lib instead of soname
This matches similar logic in cc/library.go : linkerFlags for including
shared libraries.
Bug: 291830024
Test: m libkmr_cf_ffi (when enabled for darwin)
Change-Id: I1d6b6a7855c6649b93ab6592ea43b17c6e37b3a3
Diffstat (limited to 'rust/rust.go')
-rw-r--r-- | rust/rust.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/rust/rust.go b/rust/rust.go index dab35323a..e2154f0cc 100644 --- a/rust/rust.go +++ b/rust/rust.go @@ -1224,6 +1224,11 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps { if _, exists := skipModuleList[depName]; exists { return } + + if depTag == android.DarwinUniversalVariantTag { + return + } + if rustDep, ok := dep.(*Module); ok && !rustDep.CcLibraryInterface() { //Handle Rust Modules makeLibName := rustMakeLibName(ctx, mod, rustDep, depName+rustDep.Properties.RustSubName) |