push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
Look up .build-id files relative to the directories in the
colon-separated environment variable NIX_DEBUG_INFO_DIRS, unless
overriden by --debuginfo-path.
diff -ru elfutils-0.169-orig/libdwfl/argp-std.c elfutils-0.169/libdwfl/argp-std.c
--- elfutils-0.169-orig/libdwfl/argp-std.c 2017-05-02 23:05:52.000000000 +0200
+++ elfutils-0.169/libdwfl/argp-std.c 2017-07-28 16:08:06.739558106 +0200
@@ -376,5 +376,7 @@
const struct argp *
dwfl_standard_argp (void)
{
+ debuginfo_path = getenv("NIX_DEBUG_INFO_DIRS");
+
return &libdwfl_argp;
}
diff -ru elfutils-0.169-orig/src/stack.c elfutils-0.169/src/stack.c
--- elfutils-0.169-orig/src/stack.c 2017-02-24 11:55:28.000000000 +0100
+++ elfutils-0.169/src/stack.c 2017-07-28 15:50:06.743196696 +0200
@@ -631,6 +631,8 @@
/* Set locale. */
(void) setlocale (LC_ALL, "");
+ debuginfo_path = getenv("NIX_DEBUG_INFO_DIRS");
+
const struct argp_option options[] =
{
{ NULL, 0, NULL, 0, N_("Input selection options:"), 0 },

View File

@@ -0,0 +1,66 @@
diff -crb --new-file a/lib/error.h b/lib/error.h
*** a/lib/error.h 1969-12-31 19:00:00.000000000 -0500
--- b/lib/error.h 2021-01-21 04:38:25.000000000 -0500
***************
*** 0 ****
--- 1,27 ----
+ #ifndef _ERROR_H_
+ #define _ERROR_H_
+
+ #include <stdarg.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <errno.h>
+
+ static unsigned int error_message_count = 0;
+
+ static inline void error(int status, int errnum, const char* format, ...)
+ {
+ va_list ap;
+ fprintf(stderr, "%s: ", program_invocation_name);
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+ if (errnum)
+ fprintf(stderr, ": %s", strerror(errnum));
+ fprintf(stderr, "\n");
+ error_message_count++;
+ if (status)
+ exit(status);
+ }
+
+ #endif /* _ERROR_H_ */
diff -crb --new-file a/src/error.h b/src/error.h
*** a/src/error.h 1969-12-31 19:00:00.000000000 -0500
--- b/src/error.h 2021-01-21 04:38:29.000000000 -0500
***************
*** 0 ****
--- 1,27 ----
+ #ifndef _ERROR_H_
+ #define _ERROR_H_
+
+ #include <stdarg.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <errno.h>
+
+ static unsigned int error_message_count = 0;
+
+ static inline void error(int status, int errnum, const char* format, ...)
+ {
+ va_list ap;
+ fprintf(stderr, "%s: ", program_invocation_name);
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+ if (errnum)
+ fprintf(stderr, ": %s", strerror(errnum));
+ fprintf(stderr, "\n");
+ error_message_count++;
+ if (status)
+ exit(status);
+ }
+
+ #endif /* _ERROR_H_ */

View File

@@ -0,0 +1,177 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
pkg-config,
musl-fts,
musl-obstack,
m4,
zlib,
zstd,
bzip2,
bison,
flex,
gettext,
xz,
setupDebugInfoDirs,
argp-standalone,
enableDebuginfod ? lib.meta.availableOn stdenv.hostPlatform libarchive,
sqlite,
curl,
json_c,
libmicrohttpd,
libarchive,
gitUpdater,
}:
# TODO: Look at the hardcoded paths to kernel, modules etc.
stdenv.mkDerivation rec {
pname = "elfutils";
version = "0.193";
src = fetchurl {
url = "https://sourceware.org/elfutils/ftp/${version}/${pname}-${version}.tar.bz2";
hash = "sha256-eFf0S2JPTY1CHfhRqq57FALP5rzdLYBJ8V/AfT3edjU=";
};
patches = [
./debug-info-from-env.patch
(fetchpatch {
name = "fix-aarch64_fregs.patch";
url = "https://git.alpinelinux.org/aports/plain/main/elfutils/fix-aarch64_fregs.patch?id=2e3d4976eeffb4704cf83e2cc3306293b7c7b2e9";
sha256 = "zvncoRkQx3AwPx52ehjA2vcFroF+yDC2MQR5uS6DATs=";
})
(fetchpatch {
name = "musl-asm-ptrace-h.patch";
url = "https://git.alpinelinux.org/aports/plain/main/elfutils/musl-asm-ptrace-h.patch?id=2e3d4976eeffb4704cf83e2cc3306293b7c7b2e9";
sha256 = "8D1wPcdgAkE/TNBOgsHaeTZYhd9l+9TrZg8d5C7kG6k=";
})
(fetchpatch {
name = "musl-macros.patch";
url = "https://git.alpinelinux.org/aports/plain/main/elfutils/musl-macros.patch?id=2e3d4976eeffb4704cf83e2cc3306293b7c7b2e9";
sha256 = "tp6O1TRsTAMsFe8vw3LMENT/vAu6OmyA8+pzgThHeA8=";
})
(fetchpatch {
name = "musl-strndupa.patch";
url = "https://git.alpinelinux.org/aports/plain/main/elfutils/musl-strndupa.patch?id=2e3d4976eeffb4704cf83e2cc3306293b7c7b2e9";
sha256 = "sha256-7daehJj1t0wPtQzTv+/Rpuqqs5Ng/EYnZzrcf2o/Lb0=";
})
]
++ lib.optionals stdenv.hostPlatform.isMusl [ ./musl-error_h.patch ];
postPatch = ''
patchShebangs tests/*.sh
''
+ lib.optionalString stdenv.hostPlatform.isRiscV ''
# disable failing test:
#
# > dwfl_thread_getframes: No DWARF information found
sed -i s/run-backtrace-dwarf.sh//g tests/Makefile.in
'';
outputs = [
"bin"
"dev"
"out"
"man"
];
# We need bzip2 in NativeInputs because otherwise we can't unpack the src,
# as the host-bzip2 will be in the path.
nativeBuildInputs = [
m4
bison
flex
gettext
bzip2
]
++ lib.optional enableDebuginfod pkg-config;
buildInputs = [
zlib
zstd
bzip2
xz
]
++ lib.optionals stdenv.hostPlatform.isMusl [
argp-standalone
musl-fts
musl-obstack
]
++ lib.optionals enableDebuginfod [
sqlite
curl
json_c
libmicrohttpd
libarchive
];
propagatedNativeBuildInputs = [ setupDebugInfoDirs ];
hardeningDisable = [ "strictflexarrays3" ];
# build elfutils out-of-source-tree to avoid ./stack inclusion
# as a c++ header on libc++: https://sourceware.org/PR33103
preConfigure =
if (stdenv.targetPlatform.useLLVM or false) then
''
mkdir build-tree
cd build-tree
''
else
null;
configureScript = if (stdenv.targetPlatform.useLLVM or false) then "../configure" else null;
configureFlags = [
"--program-prefix=eu-" # prevent collisions with binutils
"--enable-deterministic-archives"
(lib.enableFeature enableDebuginfod "libdebuginfod")
(lib.enableFeature enableDebuginfod "debuginfod")
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766
# Versioned symbols are nice to have, but we can do without.
(lib.enableFeature (!stdenv.hostPlatform.isMicroBlaze) "symbol-versioning")
]
++ lib.optional (stdenv.targetPlatform.useLLVM or false) "--disable-demangler";
enableParallelBuilding = true;
doCheck =
# Backtrace unwinding tests rely on glibc-internal symbol names.
# Musl provides slightly different forms and fails.
# Let's disable tests there until musl support is fully upstreamed.
!stdenv.hostPlatform.isMusl
# Test suite tries using `uname` to determine whether certain tests
# can be executed, so we need to match build and host platform exactly.
&& (stdenv.hostPlatform == stdenv.buildPlatform);
doInstallCheck = !stdenv.hostPlatform.isMusl && (stdenv.hostPlatform == stdenv.buildPlatform);
preCheck = ''
# Workaround lack of rpath linking:
# ./dwarf_srclang_check: error while loading shared libraries:
# libelf.so.1: cannot open shared object file: No such file or directory
# Remove once https://sourceware.org/PR32929 is fixed.
export LD_LIBRARY_PATH="$PWD/libelf:$LD_LIBRARY_PATH"
'';
passthru.updateScript = gitUpdater {
url = "https://sourceware.org/git/elfutils.git";
rev-prefix = "elfutils-";
};
meta = with lib; {
homepage = "https://sourceware.org/elfutils/";
description = "Set of utilities to handle ELF objects";
platforms = platforms.linux;
# https://lists.fedorahosted.org/pipermail/elfutils-devel/2014-November/004223.html
badPlatforms = [ lib.systems.inspect.platformPatterns.isStatic ];
# licenses are GPL2 or LGPL3+ for libraries, GPL3+ for bins,
# but since this package isn't split that way, all three are listed.
license = with licenses; [
gpl2Only
lgpl3Plus
gpl3Plus
];
maintainers = with maintainers; [ r-burns ];
};
}