Don't include mono-dtrace.h when generating offsets (#49482)
authormonojenkins <jo.shields+jenkins@xamarin.com>
Fri, 12 Mar 2021 12:10:16 +0000 (07:10 -0500)
committerGitHub <noreply@github.com>
Fri, 12 Mar 2021 12:10:16 +0000 (13:10 +0100)
offsets-tool can run before mono-dtrace.h is generated which leads to a compiler error about the file missing.
This happened with the mac arm64 sdks build where we didn't disable dtrace like we do for iOS.

It was racy since it depends on whether we already built the target mono before we're building the cross compiler mono.

Co-authored-by: akoeplinger <akoeplinger@users.noreply.github.com>
src/mono/mono/utils/dtrace.h

index d6b92c2..883d1af 100644 (file)
@@ -10,7 +10,7 @@
 #ifndef __UTILS_DTRACE_H__
 #define __UTILS_DTRACE_H__
 
-#ifdef ENABLE_DTRACE
+#if defined(ENABLE_DTRACE) && !defined(MONO_GENERATING_OFFSETS)
 
 #include <mono/utils/mono-dtrace.h>