From bff0e5412db91410d759e2eefbbca3df80a1e672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Sun, 6 Sep 2026 13:07:10 +0100 Subject: [PATCH] build: sort: explicitly tag libcrypto dependency This adds an ELF note as per the UAPI Group's .note.dlopen spec: $ readelf -p .note.dlopen src/sort String dump of section '.note.dlopen': [ 4] y [ a] |@FDO [ 10] [{"feature":"random-sort", "description":"Support for random sorting", "priority":"required", "soname":["libcrypto.so.3"]}] * bootstrap.conf: Add sd-dlopen. * src/sort.c (DLOPEN_LIBCRYPTO && HAVE_OPENSSL_MD5): Add an ELF note with SD_ELF_NOTE_DLOPEN() so that packagers can determine the libcrypto dependency, needed when --random-sort is specified. * NEWS: Mention the Build-related change. --- NEWS | 3 +++ bootstrap.conf | 1 + src/sort.c | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/NEWS b/NEWS index e52e8b7ce..84940fbdb 100644 --- a/NEWS +++ b/NEWS @@ -176,6 +176,9 @@ GNU coreutils NEWS -*- outline -*- The configure option '--enable-systemd' is renamed to '--with-systemd'. The option '--enable-systemd' was a misnomer and is now deprecated. + The 'sort' binary now uses the UAPI Group's .note.dlopen ELF note + to indicate its dependency on libcrypto. + * Noteworthy changes in release 9.11 (2026-04-20) [stable] diff --git a/bootstrap.conf b/bootstrap.conf index 865933e06..56474edae 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -262,6 +262,7 @@ gnulib_modules=" save-cwd savedir savewd + sd-dlopen select selinux-at setenv diff --git a/src/sort.c b/src/sort.c index b3a17d6b1..c0c5c2237 100644 --- a/src/sort.c +++ b/src/sort.c @@ -2370,6 +2370,14 @@ getmonth (char const *month, char **ea) # endif # include +/* Require distributions make OpenSSL available for hardware + optimized implementations of MD-5. */ +# include "sd-dlopen.h" +SD_ELF_NOTE_DLOPEN ("random-sort", + "Support for random sorting", + SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED, + LIBCRYPTO_SONAME); + /* Diagnose a dynamic linking failure. */ static void link_failure (void)