From cbc16cec1a13ff9e8bd4067622c91b38009d4628 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Tue, 25 Oct 2022 13:24:58 -0500 Subject: [PATCH] FBSD: Handle amd64 in host triplet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In ostype.m4 and sysname.m4, we detect amd64 FreeBSD by matching $host against "x86_64-*-freebsd*". On FreeBSD, `uname -p` on these systems prints "amd64", but the config.guess from the GNU config project (that is, ) translates amd64 into x86_64 for FreeBSD, and has for a very long time. For whatever (historical) reasons, anything built from FreeBSD ports uses a version of the config.guess script that has FreeBSD-specific modifications (which lives in /usr/ports/Templates/config.guess). This version does not translate amd64 into x86_64, and so our $host looks like, for example: $ sh /usr/ports/Templates/config.guess amd64-unknown-freebsd12.3 If regen.sh is run on a FreeBSD host, we pull our config.guess from libtool, which normally is built from FreeBSD ports, and so results in a host triplet with "amd64" for amd64 hosts. And so the build breaks early on, because we don't recognize that we're on FreeBSD. To accommodate this, match our amd64 FreeBSD host triplets against amd64 or x86_64, so we can build using a config.guess from FreeBSD or GNU upstream. Change-Id: I372c9c9150b6639fa0cda96052cf50eb2857a3bb Reviewed-on: https://gerrit.openafs.org/15159 Reviewed-by: Cheyenne Wills Reviewed-by: Måns Nilsson Reviewed-by: Michael Meffie Reviewed-by: Andrew Deason Tested-by: Andrew Deason --- src/cf/ostype.m4 | 2 +- src/cf/sysname.m4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cf/ostype.m4 b/src/cf/ostype.m4 index fe95940fd2..5024893a19 100644 --- a/src/cf/ostype.m4 +++ b/src/cf/ostype.m4 @@ -58,7 +58,7 @@ case $system in MKAFS_OSTYPE=FBSD AC_MSG_RESULT(i386_fbsd) ;; - x86_64-*-freebsd*) + x86_64-*-freebsd* | amd64-*-freebsd*) MKAFS_OSTYPE=FBSD AC_MSG_RESULT(amd64_fbsd) ;; diff --git a/src/cf/sysname.m4 b/src/cf/sysname.m4 index dbe62d5b99..e051f983ee 100644 --- a/src/cf/sysname.m4 +++ b/src/cf/sysname.m4 @@ -28,7 +28,7 @@ else vm=${v#*.} AFS_SYSNAME="i386_fbsd_${vM}${vm}" ;; - x86_64-*-freebsd*.*) + x86_64-*-freebsd*.* | amd64-*-freebsd*.*) v=${host#*freebsd} vM=${v%.*} vm=${v#*.}