From owner-dev-commits-src-all@freebsd.org Sat Mar 20 17:58:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 211E45B0736; Sat, 20 Mar 2021 17:58:27 +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 4F2pQq0VGfz4pVn; Sat, 20 Mar 2021 17:58:27 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 03B5244EF; Sat, 20 Mar 2021 17:58:27 +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 12KHwQ32017138; Sat, 20 Mar 2021 17:58:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12KHwQna017137; Sat, 20 Mar 2021 17:58:26 GMT (envelope-from git) Date: Sat, 20 Mar 2021 17:58:26 GMT Message-Id: <202103201758.12KHwQna017137@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 839fdcfc0c1d - main - elftoolchain: Support building on Arm-based Macs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 839fdcfc0c1dba34f728813d9756515ad82ff58a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Mar 2021 17:58:27 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=839fdcfc0c1dba34f728813d9756515ad82ff58a commit 839fdcfc0c1dba34f728813d9756515ad82ff58a Author: Jessica Clarke AuthorDate: 2021-03-20 17:58:10 +0000 Commit: Jessica Clarke CommitDate: 2021-03-20 17:58:10 +0000 elftoolchain: Support building on Arm-based Macs Currently macOS and DragonFlyBSD get their own special case and only handle x86. Since all the FreeBSD cases should be general enough for macOS and DragonFlyBSD (and the x86 ones are identical to the existing ones) we can just delete the special cases and reuse the FreeBSD ones. Note that upstream has since removed all the architecture-specific checks in this file, with the only code relevant to us being an endianness check that uses the generic compiler-provided macros. Thus this patch will not be upstreamed, and will be dropped in a future vendor import. Reviewed by: dim MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29352 --- contrib/elftoolchain/libelf/_libelf_config.h | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/contrib/elftoolchain/libelf/_libelf_config.h b/contrib/elftoolchain/libelf/_libelf_config.h index 05869757f663..0f16f3aefde5 100644 --- a/contrib/elftoolchain/libelf/_libelf_config.h +++ b/contrib/elftoolchain/libelf/_libelf_config.h @@ -26,25 +26,11 @@ * $Id: _libelf_config.h 3764 2019-06-28 21:44:46Z emaste $ */ -#if defined(__APPLE__) || defined(__DragonFly__) - -#if defined(__amd64__) -#define LIBELF_ARCH EM_X86_64 -#define LIBELF_BYTEORDER ELFDATA2LSB -#define LIBELF_CLASS ELFCLASS64 -#elif defined(__i386__) -#define LIBELF_ARCH EM_386 -#define LIBELF_BYTEORDER ELFDATA2LSB -#define LIBELF_CLASS ELFCLASS32 -#endif - -#endif /* __DragonFly__ */ - -#ifdef __FreeBSD__ +#if defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) /* * Define LIBELF_{ARCH,BYTEORDER,CLASS} based on the machine architecture. - * See also: . + * See also: on FreeBSD. */ #if defined(__amd64__) @@ -126,9 +112,9 @@ #define LIBELF_CLASS ELFCLASS64 #else -#error Unknown FreeBSD architecture. +#error Unknown architecture. #endif -#endif /* __FreeBSD__ */ +#endif /* defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) */ /* * Definitions for Minix3.