From nobody Tue May 17 07:53:43 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 411571ADF4E0; Tue, 17 May 2022 07:53:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L2Szr1K69z4SwC; Tue, 17 May 2022 07:53:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652774024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oyGQ2+6RBykBSVsBjAACC7LXrXtOnT0qfesVhtJofJc=; b=aXhZtlFsq18qk2ZStHyusVYR15dmI8TBZD05Z53O183BoQgRvkUd9Stxq+j6o/YTWjPCf0 Fo/ruVjwsdyp6b9aD9QD34TK2YSLdDUEhlXIcNR77X3wfQqCuqMBwJzAyUWU7oD64hLo3Q sJP/ublwAMTM1f1asFee/7fmpPvGiBzdig+r1Fpfo3z/lkSTLtjp62MvuZdWqgkwU2Jjmc XQ+WR/m44qJuvSmsnnTyz0PzffOqxFCbAf0ysHjKbLWmAiQBPu3K9/8qFbHwmOXZsRjfEo 6qEIzWOYvMyIhmmuOPtCDgtuuFN+j4LhhXNdqw2shOImTOPuF+JiXmq3VuM15Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C5E0111BC; Tue, 17 May 2022 07:53:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24H7rhFT043527; Tue, 17 May 2022 07:53:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24H7rh2v043526; Tue, 17 May 2022 07:53:43 GMT (envelope-from git) Date: Tue, 17 May 2022 07:53:43 GMT Message-Id: <202205170753.24H7rh2v043526@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Alexey Dokuchaev Subject: git: 3951881016b7 - main - sysutils/cpuid2cpuflags: make the port build and work on ARM List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: danfe X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3951881016b76468ed9e558b26e23ab3d2a4d3db Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652774024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oyGQ2+6RBykBSVsBjAACC7LXrXtOnT0qfesVhtJofJc=; b=lqjM9VI50yXSEq7dCj0Vj7pLS91non+PVoft0zoLu2huKg+nuayOmwCD2QYiaZAK5WU6y/ ytjlFjT7sm1RcF/CRULJZb+Q5MybRGMDuzWUEmEjw9nWO4WFIfOD+cycdbeMooPpLkPh64 tqsxdd5hBDmqwwcvzmFryxWICOPgr3LMlVJFbn5CdxiwIs2gZaXjBR1gCkcJnUKWUt7hkN 6T7F3dU85cajSv3QBAaacJxB3xb2aZRrkN0RVVmZP+mwWb6qxvrB5EaHEOF1xoR6DlDzKz 3HRmOK9ZGAISygbtfaJa1LLI689X7Ge3vSJ77kyfB1fDAzA6mXYCrPv2HKV2JQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652774024; a=rsa-sha256; cv=none; b=Rf/zia0LQrl2frJ2r3u3YGt2U/07zu2fO9It/KvMRMXjVbvK9AOlLiZAlJ0vUsKoVqiMd8 5DoWzDGVlq1rSMCnxR21qn1oJt3daFKUIAgeRtNvSUzdV5fkZexPOf8GVeU0eJgAGRd0Wn x5byzHm1ku5WNa9BBy9vCe7kzGnRDv0Cgy+yL4iwhJpdPgPZSV2RHvbj5e2CKKe8JOk2YH 4gEjulQd6ySZP6oBrOBiS1aNnkG2e+4qV6QndCwMw9m9Wkr+6G3zV9mMc2y+y7gizbImAs vV2HDTu4IkoH4KYw6gl2WdPz9Fqtywirl9aXSIZK2CX76HDw4n5pl/G/ztUf+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by danfe: URL: https://cgit.FreeBSD.org/ports/commit/?id=3951881016b76468ed9e558b26e23ab3d2a4d3db commit 3951881016b76468ed9e558b26e23ab3d2a4d3db Author: Alexey Dokuchaev AuthorDate: 2022-05-17 07:53:14 +0000 Commit: Alexey Dokuchaev CommitDate: 2022-05-17 07:53:14 +0000 sysutils/cpuid2cpuflags: make the port build and work on ARM - Replace getauxval(3), a non-standard glibc extension, with our native elf_aux_info(3) call - Return features supported by the specific machine processor architecture (uname -p) rather than the hardware platform (uname -m), because the latter is too vague on FreeBSD/arm PR: 258445 Reported by: pkg-fallout --- sysutils/cpuid2cpuflags/files/patch-src_hwcap.c | 48 +++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/sysutils/cpuid2cpuflags/files/patch-src_hwcap.c b/sysutils/cpuid2cpuflags/files/patch-src_hwcap.c new file mode 100644 index 000000000000..89c88e4f92b8 --- /dev/null +++ b/sysutils/cpuid2cpuflags/files/patch-src_hwcap.c @@ -0,0 +1,48 @@ +--- src/hwcap.c.orig 2020-07-13 17:14:55 UTC ++++ src/hwcap.c +@@ -14,13 +14,19 @@ + #ifdef HAVE_SYS_AUXV_H + # include + #endif ++#ifdef __FreeBSD__ ++#include ++#else + #include +- +-#ifndef __linux__ +-# error "Platform not supported (only Linux supported at the moment)" + #endif ++ + #ifndef HAVE_GETAUXVAL +-# error "Platform not supported (no getauxval())" ++static unsigned long getauxval(int aux) ++{ ++ unsigned long auxval = 0; ++ elf_aux_info(aux, &auxval, sizeof(auxval)); ++ return auxval; ++} + #endif + + #include "hwcap.h" +@@ -53,9 +59,21 @@ unsigned long get_hwcap2() + */ + char* get_uname_machine() + { ++#ifdef __FreeBSD__ ++ /** ++ * Contrary to this code expectation, on FreeBSD/arm, `uname -m' ++ * is always `arm', so we return more unique `uname -p' instead. ++ */ ++ int mib[] = { CTL_HW, HW_MACHINE_ARCH }; ++ static char buf[48]; ++ size_t len = sizeof(buf); ++ if (sysctl(mib, 2, &buf, &len, NULL, 0) == 0) ++ return buf; ++#else + static struct utsname uname_res; + if (uname(&uname_res) != -1) + return uname_res.machine; ++#endif + else + return NULL; + }