The version of macOS running on Apple Silicon doesn't need to
concern itself with backwards compatibility with 32-bit
applications, and so it could jettison all the symbol aliasing
shenanigans involved.
https://gitlab.com/libvirt/libvirt/-/issues/121
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
tests/virfilewrapper.c | 2 +-
tests/virmockstathelpers.c | 4 ++--
tests/virpcimock.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/virfilewrapper.c b/tests/virfilewrapper.c
index ca2356b5c9..1369cfb766 100644
--- a/tests/virfilewrapper.c
+++ b/tests/virfilewrapper.c
@@ -56,7 +56,7 @@ static void init_syms(void)
VIR_MOCK_REAL_INIT(access);
VIR_MOCK_REAL_INIT(mkdir);
VIR_MOCK_REAL_INIT(open);
-# ifdef __APPLE__
+# if defined(__APPLE__) && defined(__x86_64__)
VIR_MOCK_REAL_INIT_ALIASED(opendir, "opendir$INODE64");
# else
VIR_MOCK_REAL_INIT(opendir);
diff --git a/tests/virmockstathelpers.c b/tests/virmockstathelpers.c
index 830dfe1085..9344345baa 100644
--- a/tests/virmockstathelpers.c
+++ b/tests/virmockstathelpers.c
@@ -161,7 +161,7 @@ static void virMockStatInit(void)
debug = getenv("VIR_MOCK_STAT_DEBUG");
#ifdef MOCK_STAT
-# ifdef __APPLE__
+# if defined(__APPLE__) && defined(__x86_64__)
VIR_MOCK_REAL_INIT_ALIASED(stat, "stat$INODE64");
# else
VIR_MOCK_REAL_INIT(stat);
@@ -181,7 +181,7 @@ static void virMockStatInit(void)
fdebug("real __xstat64 %p\n", real___xstat64);
#endif
#ifdef MOCK_LSTAT
-# ifdef __APPLE__
+# if defined(__APPLE__) && defined(__x86_64__)
VIR_MOCK_REAL_INIT_ALIASED(lstat, "lstat$INODE64");
# else
VIR_MOCK_REAL_INIT(lstat);
diff --git a/tests/virpcimock.c b/tests/virpcimock.c
index f6280fc8b5..d1c6220c57 100644
--- a/tests/virpcimock.c
+++ b/tests/virpcimock.c
@@ -936,7 +936,7 @@ init_syms(void)
VIR_MOCK_REAL_INIT(__open_2);
# endif /* ! __GLIBC__ */
VIR_MOCK_REAL_INIT(close);
-# ifdef __APPLE__
+# if defined(__APPLE__) && defined(__x86_64__)
VIR_MOCK_REAL_INIT_ALIASED(opendir, "opendir$INODE64");
# else
VIR_MOCK_REAL_INIT(opendir);
--
2.26.2