[PATCH v7 11/11] darwin: remove 64-bit build detection on 32-bit OS

Joelle van Dyne posted 11 patches 5 years ago
Maintainers: Jason Wang <jasowang@redhat.com>, Eric Blake <eblake@redhat.com>, Max Reitz <mreitz@redhat.com>, Samuel Thibault <samuel.thibault@ens-lyon.org>, Markus Armbruster <armbru@redhat.com>, Kevin Wolf <kwolf@redhat.com>
There is a newer version of this series
[PATCH v7 11/11] darwin: remove 64-bit build detection on 32-bit OS
Posted by Joelle van Dyne 5 years ago
A workaround added in early days of 64-bit OSX forced x86_64 if the
host machine had 64-bit support. This creates issues when cross-
compiling for ARM64. Additionally, the user can always use --cpu=* to
manually set the host CPU and therefore this workaround should be
removed.

Signed-off-by: Joelle van Dyne <j@getutm.app>
---
 configure | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/configure b/configure
index fb671258e6..c7fbda22b9 100755
--- a/configure
+++ b/configure
@@ -626,13 +626,6 @@ fi
 # the correct CPU with the --cpu option.
 case $targetos in
 Darwin)
-  # on Leopard most of the system is 32-bit, so we have to ask the kernel if we can
-  # run 64-bit userspace code.
-  # If the user didn't specify a CPU explicitly and the kernel says this is
-  # 64 bit hw, then assume x86_64. Otherwise fall through to the usual detection code.
-  if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
-    cpu="x86_64"
-  fi
   HOST_DSOSUF=".dylib"
   ;;
 SunOS)
@@ -776,10 +769,6 @@ OpenBSD)
 Darwin)
   bsd="yes"
   darwin="yes"
-  if [ "$cpu" = "x86_64" ] ; then
-    QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS"
-    QEMU_LDFLAGS="-arch x86_64 $QEMU_LDFLAGS"
-  fi
   audio_drv_list="try-coreaudio try-sdl"
   audio_possible_drivers="coreaudio sdl"
   # Disable attempts to use ObjectiveC features in os/object.h since they
-- 
2.28.0


Re: [PATCH v7 11/11] darwin: remove 64-bit build detection on 32-bit OS
Posted by Peter Maydell 5 years ago
On Fri, 22 Jan 2021 at 20:16, Joelle van Dyne <j@getutm.app> wrote:
>
> A workaround added in early days of 64-bit OSX forced x86_64 if the
> host machine had 64-bit support. This creates issues when cross-
> compiling for ARM64. Additionally, the user can always use --cpu=* to
> manually set the host CPU and therefore this workaround should be
> removed.
>
> Signed-off-by: Joelle van Dyne <j@getutm.app>
> ---
>  configure | 11 -----------
>  1 file changed, 11 deletions(-)
>
> diff --git a/configure b/configure
> index fb671258e6..c7fbda22b9 100755
> --- a/configure
> +++ b/configure
> @@ -626,13 +626,6 @@ fi
>  # the correct CPU with the --cpu option.
>  case $targetos in
>  Darwin)
> -  # on Leopard most of the system is 32-bit, so we have to ask the kernel if we can
> -  # run 64-bit userspace code.
> -  # If the user didn't specify a CPU explicitly and the kernel says this is
> -  # 64 bit hw, then assume x86_64. Otherwise fall through to the usual detection code.
> -  if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
> -    cpu="x86_64"
> -  fi
>    HOST_DSOSUF=".dylib"
>    ;;
>  SunOS)

I was just thinking the other day that we could remove this hack...

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM