Files
openwrt-armor-g5/tools/util-linux/patches/101-macos-weak-aliases.patch
domenico 27c9d80f51
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Initial commit
2025-06-24 12:51:15 +02:00

27 lines
1.0 KiB
Diff

From 9445f477cfcfb3615ffde8f93b1b98c809ee4eca Mon Sep 17 00:00:00 2001
From: Eugene Gershnik <gershnik@users.noreply.github.com>
Date: Mon, 6 May 2024 09:29:39 -0700
Subject: [PATCH] This re-enables build on macOS.
Weak aliases are not supported by clang on Darwin.
Instead this fix uses inline asm to make `_uuid_time` and alias to `___uuid_time`
Fixes util-linux/util-linux#2873
---
libuuid/src/uuid_time.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/libuuid/src/uuid_time.c
+++ b/libuuid/src/uuid_time.c
@@ -85,6 +85,10 @@ time_t __uuid_time(const uuid_t uu, stru
}
#if defined(__USE_TIME_BITS64) && defined(__GLIBC__)
extern time_t uuid_time64(const uuid_t uu, struct timeval *ret_tv) __attribute__((weak, alias("__uuid_time")));
+#elif defined(__clang__) && defined(__APPLE__)
+__asm__(".globl _uuid_time");
+__asm__(".set _uuid_time, ___uuid_time");
+extern time_t uuid_time(const uuid_t uu, struct timeval *ret_tv);
#else
extern time_t uuid_time(const uuid_t uu, struct timeval *ret_tv) __attribute__((weak, alias("__uuid_time")));
#endif