pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/bootstrap bootstrap: Add support for --machine-arch ov...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5399a047b4f1
branches:  trunk
changeset: 455756:5399a047b4f1
user:      jperkin <jperkin%pkgsrc.org@localhost>
date:      Sat Jul 10 15:49:21 2021 +0000

description:
bootstrap: Add support for --machine-arch override.

This should not be used under normal circumstances, however on arm64 macOS it
is currently impossible to execute native arm64 binaries inside a chroot, and
so the chroot must run in x86_64 mode via Rosetta.  This causes uname/arch/etc
to all report that the system is x86, and so the only way to force MACHINE_ARCH
to be set correctly to "aarch64" is using this argument.

diffstat:

 bootstrap/bootstrap |  12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diffs (49 lines):

diff -r f3577873a7c6 -r 5399a047b4f1 bootstrap/bootstrap
--- a/bootstrap/bootstrap       Sat Jul 10 15:40:52 2021 +0000
+++ b/bootstrap/bootstrap       Sat Jul 10 15:49:21 2021 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: bootstrap,v 1.300 2021/05/30 23:41:05 khorben Exp $
+# $NetBSD: bootstrap,v 1.301 2021/07/10 15:49:21 jperkin Exp $
 #
 # Copyright (c) 2001-2011 Alistair Crooks <agc%NetBSD.org@localhost>
 # All rights reserved.
@@ -64,6 +64,7 @@
     [ --full ]
     [ --gzip-binary-kit <tarball> ]
     [ --help ]
+    [ --machine-arch <arch> ]
     [ --make-jobs <num> ]
     [ --mk-fragment <mk.conf> ]
     [ --pkgdbdir <pkgdbdir> ]
@@ -421,6 +422,7 @@
 compiler=""
 cwrappers=auto
 full=no
+march=
 make_jobs=1
 mk_fragment=
 quiet=no
@@ -476,6 +478,9 @@
                        binary_gzip_kit=`get_optarg "$1"` ;;
        --gzip-binary-kit)
                        binary_gzip_kit="$2"; shift ;;
+       --machine-arch=*)
+                       march=`get_optarg "$1"` ;;
+       --machine-arch) march="$2"; shift ;;
        --make-jobs=*)  make_jobs=`get_optarg "$1"` ;;
        --make-jobs)    make_jobs="$2"; shift ;;
        --full)         full=yes ;;
@@ -841,6 +846,11 @@
        ;;
 esac
 
+# Override if the user explicitly requests it.
+if [ -n "${march}" ]; then
+       machine_arch="${march}"
+fi
+
 # Fixup MACHINE_ARCH to use canonical pkgsrc variants, and support multiarch
 # systems via --abi, setting a default $abi based on MACHINE_ARCH if not set.
 #



Home | Main Index | Thread Index | Old Index