From eec9b286b05a13613a22f479196113a0aaf1795e Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 18 Jul 2019 16:20:52 -0700 Subject: [PATCH] Disable cc_fuzz darwin host modules The fuzzer runtime is not present for darwin host modules, disable cc_fuzz modules when targeting darwin. Test: m on darwin Change-Id: I9da319e00e36c3e0a5912329de7890a6409f1a55 --- cc/fuzz.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cc/fuzz.go b/cc/fuzz.go index d13e04a5c..3b0c5c83a 100644 --- a/cc/fuzz.go +++ b/cc/fuzz.go @@ -102,5 +102,19 @@ func NewFuzz(hod android.HostOrDeviceSupported) *Module { module.compiler = fuzz module.linker = fuzz module.installer = fuzz + + // The fuzzer runtime is not present for darwin host modules, disable cc_fuzz modules when targeting darwin. + android.AddLoadHook(module, func(ctx android.LoadHookContext) { + disableDarwin := struct { + Target struct { + Darwin struct { + Enabled *bool + } + } + }{} + disableDarwin.Target.Darwin.Enabled = BoolPtr(false) + ctx.AppendProperties(&disableDarwin) + }) + return module }