Darwin/Mac OS host rust compilation fixes
- Don't pass `--as-needed` to the linker on Mac OS which is unsupported
there
- Use `--force_load` rather than `--Wl,--whole-archive` on Mac OS
- Scan `rustc`'s linker arguments for `-dylib` and `-dynamiclib`, which
it can use instead of `-shared` on Mac OS:
7bd81ee190/compiler/rustc_codegen_ssa/src/back/linker.rs (L319)
Test: m libhalf serde_derive
Bug: 291164566
Change-Id: Iecd6c2532fa31c9476834f49b109de98cbd2dccf
This commit is contained in:
@@ -102,7 +102,6 @@ func init() {
|
||||
|
||||
pctx.ImportAs("cc_config", "android/soong/cc/config")
|
||||
pctx.StaticVariable("RustLinker", "${cc_config.ClangBin}/clang++")
|
||||
pctx.StaticVariable("RustLinkerArgs", "-Wl,--as-needed")
|
||||
|
||||
pctx.StaticVariable("DeviceGlobalLinkFlags", strings.Join(deviceGlobalLinkFlags, " "))
|
||||
|
||||
|
Reference in New Issue
Block a user