util-linux: 2.39.4 -> 2.40.4

This commit is contained in:
Jared Baur
2025-02-09 09:29:28 +01:00
committed by Alyssa Ross
parent d570710367
commit fb70653cda
2 changed files with 42 additions and 10 deletions
@@ -0,0 +1,35 @@
From e47c6f751a7ef87640c61316ada774e8e9cc6b07 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] libuuid: fix uuid_time on macOS without attribute((alias))
Weak aliases are not supported by clang on Darwin.
Instead this fix uses inline asm to make `_uuid_time` an alias to
`___uuid_time`
It appears that on macOS the time API is purely 32 or 64 bit depending
on the build type. There is no ABI issue on that platform and `uuid_time`
can be unconditionally aliased to `_uuid_time`. This is all conjectural,
however, since I have no ability to make 32-bit builds for macOS - the
Apple toolchain doesn't support this since 2019.
Fixes util-linux/util-linux#2873
---
libuuid/src/uuid_time.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libuuid/src/uuid_time.c b/libuuid/src/uuid_time.c
index 9b415b3ee73..df0478e1909 100644
--- a/libuuid/src/uuid_time.c
+++ b/libuuid/src/uuid_time.c
@@ -85,6 +85,10 @@ time_t __uuid_time(const uuid_t uu, struct timeval *ret_tv)
}
#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
+7 -10
View File
@@ -2,7 +2,6 @@
lib, lib,
stdenv, stdenv,
fetchurl, fetchurl,
fetchpatch,
pkg-config, pkg-config,
zlib, zlib,
shadow, shadow,
@@ -15,6 +14,7 @@
pam, pam,
systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd,
systemd, systemd,
sqlite,
nlsSupport ? true, nlsSupport ? true,
translateManpages ? true, translateManpages ? true,
po4a, po4a,
@@ -27,21 +27,16 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = pname =
"util-linux" + lib.optionalString (!nlsSupport && !ncursesSupport && !systemdSupport) "-minimal"; "util-linux" + lib.optionalString (!nlsSupport && !ncursesSupport && !systemdSupport) "-minimal";
version = "2.39.4"; version = "2.40.4";
src = fetchurl { src = fetchurl {
url = "mirror://kernel/linux/utils/util-linux/v${lib.versions.majorMinor version}/util-linux-${version}.tar.xz"; url = "mirror://kernel/linux/utils/util-linux/v${lib.versions.majorMinor version}/util-linux-${version}.tar.xz";
hash = "sha256-bE+HI9r9QcOdk+y/FlCfyIwzzVvTJ3iArlodl6AU/Q4="; hash = "sha256-XB2vczsE6YWa/cO9h8xIEYDuD4i1wJRrFv3skxl1+3k=";
}; };
patches = [ patches = [
./rtcwake-search-PATH-for-shutdown.patch ./rtcwake-search-PATH-for-shutdown.patch
./fix-darwin-build.patch
(fetchpatch {
name = "basename.patch";
url = "https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/patch/?id=77454e58d58f904cfdc02d3ca5bb65f1bd8739fc";
hash = "sha256-ELWC4bYN3rvn9XIN0XgCo55pXNfS2VpbZWuwzRLfO/0=";
})
]; ];
# We separate some of the utilities into their own outputs. This # We separate some of the utilities into their own outputs. This
@@ -64,7 +59,7 @@ stdenv.mkDerivation rec {
postPatch = postPatch =
'' ''
patchShebangs tests/run.sh patchShebangs tests/run.sh tools/all_syscalls
substituteInPlace sys-utils/eject.c \ substituteInPlace sys-utils/eject.c \
--replace "/bin/umount" "$bin/bin/umount" --replace "/bin/umount" "$bin/bin/umount"
@@ -95,6 +90,7 @@ stdenv.mkDerivation rec {
(lib.withFeature ncursesSupport "ncursesw") (lib.withFeature ncursesSupport "ncursesw")
(lib.withFeature systemdSupport "systemd") (lib.withFeature systemdSupport "systemd")
(lib.withFeatureAs systemdSupport "systemdsystemunitdir" "${placeholder "bin"}/lib/systemd/system/") (lib.withFeatureAs systemdSupport "systemdsystemunitdir" "${placeholder "bin"}/lib/systemd/system/")
(lib.withFeatureAs systemdSupport "tmpfilesdir" "${placeholder "out"}/lib/tmpfiles.d")
(lib.enableFeature translateManpages "poman") (lib.enableFeature translateManpages "poman")
"SYSCONFSTATICDIR=${placeholder "lib"}/lib" "SYSCONFSTATICDIR=${placeholder "lib"}/lib"
] ]
@@ -121,6 +117,7 @@ stdenv.mkDerivation rec {
[ [
zlib zlib
libxcrypt libxcrypt
sqlite
] ]
++ lib.optionals pamSupport [ pam ] ++ lib.optionals pamSupport [ pam ]
++ lib.optionals capabilitiesSupport [ libcap_ng ] ++ lib.optionals capabilitiesSupport [ libcap_ng ]