Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d4a58377 authored by Jingwen Chen's avatar Jingwen Chen Committed by Gerrit Code Review
Browse files

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

parents 4a39669a 9c210866
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -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")