Skip to contentSkip to conversation

configure: do not limit Hypervisor.framework test to Darwin

PATCH In review Paolo Bonzini 3 participants 5 messages Sep 16, 2020 – Sep 18, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: do not limit Hypervisor.framework test to Darwin

Because the target/i386/hvf/meson.build rule culls hvf support on non-Darwin systems, a --enable-hvf build is succeeding. To fix this, just try the compilation test every time someone passes --enable-hvf.

---
 configure | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
configure +5 -3
index b4c0e0d07c..14b06a2510 100755
@@ -863,7 +863,7 @@ Darwin)
   bsd="yes"
   darwin="yes"
   hax="yes"
-  hvf="yes"
+  hvf=""
   if [ "$cpu" = "x86_64" ] ; then
     QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS"
     QEMU_LDFLAGS="-arch x86_64 $QEMU_LDFLAGS"
@@ -5867,16 +5867,18 @@ fi
 
 #################################################
 # Check to see if we have the Hypervisor framework
-if [ "$darwin" = "yes" ] ; then
+if [ "$hvf" != "no" ] ; then
   cat > $TMPC << EOF
 #include <Hypervisor/hv.h>
 int main() { return 0;}
 EOF
   if ! compile_object ""; then
+    if test "$hvf" = "yes"; then
+	error_exit "Hypervisor.framework not available"
+    fi
     hvf='no'
   else
     hvf='yes'
-    QEMU_LDFLAGS="-framework Hypervisor $QEMU_LDFLAGS"
   fi
 fi
 
Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Paolo Bonzini

Because the target/i386/hvf/meson.build rule culls hvf support on non-Darwin systems, a --enable-hvf build is succeeding. To fix this, just try the compilation test every time someone passes --enable-hvf.

---
 configure | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

r~

Reviewed-by Tested-by on v1 1/1
#2 lore raw
In reply to Paolo Bonzini
Quoted 48 lines · Paolo Bonzini

Because the target/i386/hvf/meson.build rule culls hvf support on non-Darwin systems, a --enable-hvf build is succeeding. To fix this, just try the compilation test every time someone passes --enable-hvf.

---
 configure | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
configure +5 -3
index b4c0e0d07c..14b06a2510 100755
@@ -863,7 +863,7 @@ Darwin)
   bsd="yes"
   darwin="yes"
   hax="yes"
-  hvf="yes"
+  hvf=""
   if [ "$cpu" = "x86_64" ] ; then
     QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS"
     QEMU_LDFLAGS="-arch x86_64 $QEMU_LDFLAGS"
@@ -5867,16 +5867,18 @@ fi
 
 #################################################
 # Check to see if we have the Hypervisor framework
-if [ "$darwin" = "yes" ] ; then
+if [ "$hvf" != "no" ] ; then
   cat > $TMPC << EOF
 #include <Hypervisor/hv.h>
 int main() { return 0;}
 EOF
   if ! compile_object ""; then
+    if test "$hvf" = "yes"; then
+	error_exit "Hypervisor.framework not available"
+    fi
     hvf='no'
   else
     hvf='yes'
-    QEMU_LDFLAGS="-framework Hypervisor $QEMU_LDFLAGS"
   fi
 fi
 
Signature · 1 line
2.26.2

Thanks,
Roman

#3 lore raw
In reply to Paolo Bonzini
Quoted 48 lines · Paolo Bonzini

Because the target/i386/hvf/meson.build rule culls hvf support on non-Darwin systems, a --enable-hvf build is succeeding. To fix this, just try the compilation test every time someone passes --enable-hvf.

---
 configure | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
configure +5 -3
index b4c0e0d07c..14b06a2510 100755
@@ -863,7 +863,7 @@ Darwin)
   bsd="yes"
   darwin="yes"
   hax="yes"
-  hvf="yes"
+  hvf=""
   if [ "$cpu" = "x86_64" ] ; then
     QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS"
     QEMU_LDFLAGS="-arch x86_64 $QEMU_LDFLAGS"
@@ -5867,16 +5867,18 @@ fi
 
 #################################################
 # Check to see if we have the Hypervisor framework
-if [ "$darwin" = "yes" ] ; then
+if [ "$hvf" != "no" ] ; then
   cat > $TMPC << EOF
 #include <Hypervisor/hv.h>
 int main() { return 0;}
 EOF
   if ! compile_object ""; then
+    if test "$hvf" = "yes"; then
+	error_exit "Hypervisor.framework not available"
+    fi
     hvf='no'
   else
     hvf='yes'
-    QEMU_LDFLAGS="-framework Hypervisor $QEMU_LDFLAGS"
   fi
 fi
 
Signature · 1 line
2.26.2

After reading "configure: move cocoa option to Meson", I think the patch should follow meson-driven configuration like the cocoa patch. That'd be a step closer to make configure a thin shim to "meson configure".

Roman

#4 lore raw
Quoted 46 lines · Roman Bolshakov
Quoted 45 lines · Paolo Bonzini

Because the target/i386/hvf/meson.build rule culls hvf support on non-Darwin systems, a --enable-hvf build is succeeding. To fix this, just try the compilation test every time someone passes --enable-hvf.

---
 configure | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
configure +5 -3
index b4c0e0d07c..14b06a2510 100755
@@ -863,7 +863,7 @@ Darwin)
   bsd="yes"
   darwin="yes"
   hax="yes"
-  hvf="yes"
+  hvf=""
   if [ "$cpu" = "x86_64" ] ; then
     QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS"
     QEMU_LDFLAGS="-arch x86_64 $QEMU_LDFLAGS"
@@ -5867,16 +5867,18 @@ fi
 
 #################################################
 # Check to see if we have the Hypervisor framework
-if [ "$darwin" = "yes" ] ; then
+if [ "$hvf" != "no" ] ; then
   cat > $TMPC << EOF
 #include <Hypervisor/hv.h>
 int main() { return 0;}
 EOF
   if ! compile_object ""; then
+    if test "$hvf" = "yes"; then
+	error_exit "Hypervisor.framework not available"
+    fi
     hvf='no'
   else
     hvf='yes'
-    QEMU_LDFLAGS="-framework Hypervisor $QEMU_LDFLAGS"
   fi
 fi
 
Quoted 7 lines
Quoted 3 lines
Signature · 1 line
2.26.2

After reading "configure: move cocoa option to Meson", I think the patch should follow meson-driven configuration like the cocoa patch. That'd be a step closer to make configure a thin shim to "meson configure".

That's unfortunately not yet possible because supported_hvf_target() uses $hvf. The idea is to move accelerator detection to meson so that config-target.mak becomes essentially constant and could for example be moved to default-configs/.

Paolo

Paolo