Merge "rust_fuzzer: add toolchain libraries if non-empty" am: d4a58377fd

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1673772

Change-Id: I5486effbf33dfac72cdd0932b87c01537a987317
This commit is contained in:
Jingwen Chen 2021-04-13 03:01:55 +00:00 committed by Automerger Merge Worker
commit 91f877b495

View file

@ -70,10 +70,12 @@ func (fuzzer *fuzzDecorator) compilerFlags(ctx ModuleContext, flags Flags) Flags
}
func (fuzzer *fuzzDecorator) compilerDeps(ctx DepsContext, deps Deps) Deps {
deps.StaticLibs = append(deps.StaticLibs,
config.LibFuzzerRuntimeLibrary(ctx.toolchain()))
deps.SharedLibs = append(deps.SharedLibs,
config.LibclangRuntimeLibrary(ctx.toolchain(), "asan"))
if libFuzzerRuntimeLibrary := config.LibFuzzerRuntimeLibrary(ctx.toolchain()); libFuzzerRuntimeLibrary != "" {
deps.StaticLibs = append(deps.StaticLibs, libFuzzerRuntimeLibrary)
}
if libclangRuntimeLibrary := config.LibclangRuntimeLibrary(ctx.toolchain(), "asan"); libclangRuntimeLibrary != "" {
deps.SharedLibs = append(deps.SharedLibs, libclangRuntimeLibrary)
}
deps.SharedLibs = append(deps.SharedLibs, "libc++")
deps.Rlibs = append(deps.Rlibs, "liblibfuzzer_sys")