NetBSD Problem Report #56003

From www@netbsd.org  Sun Feb 21 22:32:19 2021
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 04A9F1A921F
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 21 Feb 2021 22:32:19 +0000 (UTC)
Message-Id: <20210221223217.8073A1A923A@mollari.NetBSD.org>
Date: Sun, 21 Feb 2021 22:32:17 +0000 (UTC)
From: simmonds@polymorphism.ca
Reply-To: simmonds@polymorphism.ca
To: gnats-bugs@NetBSD.org
Subject: mk/gnu-config - config.guess doesn't recognize M1 Macs
X-Send-Pr-Version: www-1.0

>Number:         56003
>Category:       pkg
>Synopsis:       mk/gnu-config - config.guess doesn't recognize M1 Macs
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 21 22:35:00 +0000 2021
>Originator:     Colin Simmonds
>Release:        pkgsrc git commit e4dd34979ea10f1a2a56831d9e6d1e437a7e4e37
>Organization:
>Environment:
Darwin mirage.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 arm64 arm64 MacBookAir10,1 Darwin
>Description:
Some packages fail to build on M1-based Macs because the GNU config.guess script is out of date and doesn't recognize ARM64 on Darwin as a valid platform.

For example, trying to build graphics/jbig2dec fails with:
checking build system type... Invalid configuration `arm64-apple-darwin20.3.0': machine `arm64-apple' not recognized
configure: error: /bin/sh ./config.sub arm64-apple-darwin20.3.0 failed

>How-To-Repeat:
$ cd graphics/jbig2dec
$ bmake

>Fix:
Below is a quick patch for this based on the latest version of config.guess from the automake project on Savannah <https://git.savannah.gnu.org/cgit/automake.git/commit/lib/config.guess?id=f50685a5f5c04bd8ec2a9577e1a7b8d7cf8967cb>

--- config.guess.orig	2021-02-21 17:16:23.000000000 -0500
+++ config.guess	2021-02-21 17:17:05.000000000 -0500
@@ -1312,6 +1312,9 @@
     *:Rhapsody:*:*)
 	echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
 	exit ;;
+    arm64:Darwin:*:*)
+	echo aarch64-apple-darwin"$UNAME_RELEASE"
+	exit ;;
     *:Darwin:*:*)
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
 	set_cc_for_build

Since this is from upstream, updating all of files in mk/gnu-config to the latest would also resolve it.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.