summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Marko2024-06-25 15:51:24 +0000
committerRobert Marko2024-06-26 09:21:04 +0000
commit8b0f892b31086cbb0683fecc2b9f23d7ce24c5ee (patch)
treead47ada13300da76d54176befe6fd5bc9590003a
parentfb99a8d2e6b3e2a872c8246fa294ac9b0c5f4d11 (diff)
downloadopenwrt-8b0f892b31086cbb0683fecc2b9f23d7ce24c5ee.tar.gz
tools: util-linux: build libuuid
util-linux usually provides libuuid, and is preffered by mtd-utils so lets enable building libuuid so we can disable it later in e2fsprogs. Only the static version of library is intentionally built. Link: https://github.com/openwrt/openwrt/pull/15806 Signed-off-by: Robert Marko <robimarko@gmail.com>
-rw-r--r--tools/util-linux/Makefile2
-rw-r--r--tools/util-linux/patches/101-macos-weak-aliases.patch26
2 files changed, 28 insertions, 0 deletions
diff --git a/tools/util-linux/Makefile b/tools/util-linux/Makefile
index cfeb858400..a3a6c2be41 100644
--- a/tools/util-linux/Makefile
+++ b/tools/util-linux/Makefile
@@ -21,8 +21,10 @@ HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
HOST_CONFIGURE_ARGS += \
+ --disable-shared \
--disable-all-programs \
--enable-hexdump \
+ --enable-libuuid \
--without-util \
--without-selinux \
--without-audit \
diff --git a/tools/util-linux/patches/101-macos-weak-aliases.patch b/tools/util-linux/patches/101-macos-weak-aliases.patch
new file mode 100644
index 0000000000..e5d0f9d0b8
--- /dev/null
+++ b/tools/util-linux/patches/101-macos-weak-aliases.patch
@@ -0,0 +1,26 @@
+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