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

Commit 150afc0f authored by Matthew Maurer's avatar Matthew Maurer
Browse files

rust: Set `-C metadata` on proc-macros

Without this set, trying to load two proc-macros with the same crate
name but different hashes may fail quietly at the interner step.

Bug: 383526333
Test: m crosvm using both zerocopy-0.8 and zerocopy-0.7
Change-Id: I32b70fd8eb278c3edb649f268f762761082a46b7
parent 43a0a236
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ func (procMacro *procMacroDecorator) compilerProps() []interface{} {
func (procMacro *procMacroDecorator) compilerFlags(ctx ModuleContext, flags Flags) Flags {
	flags = procMacro.baseCompiler.compilerFlags(ctx, flags)
	flags.RustFlags = append(flags.RustFlags, "--extern proc_macro")
	flags.RustFlags = append(flags.RustFlags, "-C metadata="+ctx.ModuleName())
	return flags
}