Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Mar 2021 02:10:56 GMT
From:      Jessica Clarke <jrtc27@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: a20427cc0391 - stable/13 - elftoolchain: Support building on Arm-based Macs
Message-ID:  <202103270210.12R2AulH025965@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by jrtc27:

URL: https://cgit.FreeBSD.org/src/commit/?id=a20427cc039191ec0488873cdcee16604f5a8c7c

commit a20427cc039191ec0488873cdcee16604f5a8c7c
Author:     Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2021-03-20 17:58:10 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2021-03-27 02:10:29 +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.
    
    (cherry picked from commit 839fdcfc0c1dba34f728813d9756515ad82ff58a)
---
 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: <machine/elf.h>.
+ * See also: <machine/elf.h> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103270210.12R2AulH025965>