From: Nadav Har'El <n...@scylladb.com>
Committer: Nadav Har'El <n...@scylladb.com>
Branch: master

hyperv: comment out two unused variables that crash gcc 12.1.1

In hyperv.cc we have two static (i.e., file-local) variables which are
only ever set, never read, in this file, so they are unneeded. It turns
out that gcc 12.1.1 crashes because of these variables (segmentation
fault).

I opened a gcc bug on this:
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106087

But since these variables aren't needed anyway (they are never read by
any code after being set), let's fix the build by just removing (#if 0)
them.

Signed-off-by: Nadav Har'El <n...@scylladb.com>

---
diff --git a/bsd/sys/dev/hyperv/vmbus/hyperv.cc 
b/bsd/sys/dev/hyperv/vmbus/hyperv.cc
--- a/bsd/sys/dev/hyperv/vmbus/hyperv.cc
+++ b/bsd/sys/dev/hyperv/vmbus/hyperv.cc
@@ -62,8 +62,10 @@ static void                     hypercall_memfree();
 u_int                           hyperv_features;
 u_int                           hyperv_recommends;
 
+#if 0
 static u_int                    hyperv_pm_features;
 static u_int                    hyperv_features3;
+#endif
 
 hyperv_tc64_t                   hyperv_tc64;
 
@@ -135,8 +137,10 @@ hyperv_identify()
         return (false);
     }
     hyperv_features = regs.a;
+#if 0
     hyperv_pm_features = regs.c;
     hyperv_features3 = regs.d;
+#endif
 
     regs = processor::cpuid(CPUID_LEAF_HV_RECOMMENDS);
     hyperv_recommends = regs.a;

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/000000000000a2608c05e255761b%40google.com.

Reply via email to