diff options
author | jperkin <jperkin@pkgsrc.org> | 2021-07-10 15:49:21 +0000 |
---|---|---|
committer | jperkin <jperkin@pkgsrc.org> | 2021-07-10 15:49:21 +0000 |
commit | 23cb81edaca9dd18cff65cdd46681ee89ceda521 (patch) | |
tree | adb4b22dc308806d79c07032b336646946ff9035 | |
parent | 67a7fd802eee8babff6d1141d8fa550fedd53736 (diff) | |
download | pkgsrc-23cb81edaca9dd18cff65cdd46681ee89ceda521.tar.gz |
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.
-rwxr-xr-x | bootstrap/bootstrap | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/bootstrap/bootstrap b/bootstrap/bootstrap index 5f761ce2ae5..453ecd4eaee 100755 --- a/bootstrap/bootstrap +++ b/bootstrap/bootstrap @@ -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> # All rights reserved. @@ -64,6 +64,7 @@ usage="Usage: $0 "' [ --full ] [ --gzip-binary-kit <tarball> ] [ --help ] + [ --machine-arch <arch> ] [ --make-jobs <num> ] [ --mk-fragment <mk.conf> ] [ --pkgdbdir <pkgdbdir> ] @@ -421,6 +422,7 @@ varbase= compiler="" cwrappers=auto full=no +march= make_jobs=1 mk_fragment= quiet=no @@ -476,6 +478,9 @@ while [ $# -gt 0 ]; do 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 @@ UnixWare) ;; 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. # |