From 378778fcb7dd97bed6aad7c009639b82608ba158 Mon Sep 17 00:00:00 2001 From: Richard Cooper Date: Thu, 4 Nov 2021 13:23:05 +0000 Subject: [PATCH] ext: Add extra defines to libelf to support Apple silicon. The current version of libelf does not include a configuration compatible with Apple silicon. This patch adds the required defines. Change-Id: I9b7b9b1f711973159f31666d3fe480c2dc01a6b7 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52723 Reviewed-by: Jason Lowe-Power Reviewed-by: Austin Harris Maintainer: Bobby R. Bruce Tested-by: kokoro --- ext/libelf/_libelf_config.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ext/libelf/_libelf_config.h b/ext/libelf/_libelf_config.h index 1b8f35b224..b968441bd7 100644 --- a/ext/libelf/_libelf_config.h +++ b/ext/libelf/_libelf_config.h @@ -36,9 +36,15 @@ #define LIBELF_ARCH EM_386 #define LIBELF_BYTEORDER ELFDATA2LSB #define LIBELF_CLASS ELFCLASS32 +#elif defined(__aarch64__) +#define LIBELF_ARCH EM_AARCH64 +#define LIBELF_BYTEORDER ELFDATA2LSB +#define LIBELF_CLASS ELFCLASS64 +#else +#error Unknown Apple or DragonFly architecture. #endif -#endif /* __DragonFly__ */ +#endif /* __APPLE__ || __DragonFly__ */ #ifdef __FreeBSD__