2021-01-21 12:00:49 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, pkg-config, autoreconfHook, musl-fts
|
|
|
|
, musl-obstack, m4, zlib, bzip2, bison, flex, gettext, xz, setupDebugInfoDirs
|
|
|
|
, argp-standalone }:
|
2009-02-17 16:42:51 +00:00
|
|
|
|
2012-01-05 23:15:48 +00:00
|
|
|
# TODO: Look at the hardcoded paths to kernel, modules etc.
|
2009-02-17 16:42:51 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "elfutils";
|
2021-01-21 12:00:49 +00:00
|
|
|
version = "0.182";
|
2013-03-17 09:26:44 +00:00
|
|
|
|
2009-02-17 16:42:51 +00:00
|
|
|
src = fetchurl {
|
2019-08-15 13:41:18 +01:00
|
|
|
url = "https://sourceware.org/elfutils/ftp/${version}/${pname}-${version}.tar.bz2";
|
2021-01-21 12:00:49 +00:00
|
|
|
sha256 = "7MQGkU7fM18Lf8CE6+bEYMTW1Rdb/dZojBx42RRriFg=";
|
2009-02-17 16:42:51 +00:00
|
|
|
};
|
|
|
|
|
2021-01-21 12:00:49 +00:00
|
|
|
patches = [
|
|
|
|
./debug-info-from-env.patch
|
|
|
|
./musl-cdefs_h.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-fts-obstack.patch";
|
|
|
|
url = "https://git.alpinelinux.org/aports/plain/main/elfutils/musl-fts-obstack.patch?id=2e3d4976eeffb4704cf83e2cc3306293b7c7b2e9";
|
|
|
|
sha256 = "3lbC0UtscTIJgT7kOXnnjWrpPAVt2PYMbW+uJK6K350=";
|
|
|
|
})
|
|
|
|
(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-qsort_r.patch";
|
|
|
|
url = "https://git.alpinelinux.org/aports/plain/main/elfutils/musl-qsort_r.patch?id=2e3d4976eeffb4704cf83e2cc3306293b7c7b2e9";
|
|
|
|
sha256 = "FPWCkdtFT3zw8aNnz0Jz5Vmu8B/mRfNgfhbM/ej7d8M=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "musl-strerror_r.patch";
|
|
|
|
url = "https://git.alpinelinux.org/aports/plain/main/elfutils/musl-strerror_r.patch?id=2e3d4976eeffb4704cf83e2cc3306293b7c7b2e9";
|
|
|
|
sha256 = "QF6YwWkcT12dZHKzfqFgxy/1fkIllo0AAosbV0sM5PU=";
|
|
|
|
})
|
|
|
|
(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.optional stdenv.hostPlatform.isMusl [ ./musl-error_h.patch ];
|
2017-07-28 15:10:59 +01:00
|
|
|
|
2016-02-26 17:38:15 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
2015-12-23 01:59:47 +00:00
|
|
|
|
2012-01-06 16:45:14 +00:00
|
|
|
# We need bzip2 in NativeInputs because otherwise we can't unpack the src,
|
|
|
|
# as the host-bzip2 will be in the path.
|
2021-01-21 12:00:49 +00:00
|
|
|
nativeBuildInputs = [ m4 bison flex gettext bzip2 ]
|
|
|
|
++ lib.optional stdenv.hostPlatform.isMusl [ pkg-config autoreconfHook ];
|
2020-07-06 06:51:46 +01:00
|
|
|
buildInputs = [ zlib bzip2 xz ]
|
2021-01-21 12:00:49 +00:00
|
|
|
++ lib.optional stdenv.hostPlatform.isMusl [
|
|
|
|
argp-standalone
|
|
|
|
musl-fts
|
|
|
|
musl-obstack
|
|
|
|
];
|
2016-01-15 13:59:53 +00:00
|
|
|
|
2017-07-28 15:10:59 +01:00
|
|
|
propagatedNativeBuildInputs = [ setupDebugInfoDirs ];
|
|
|
|
|
2020-07-06 06:51:46 +01:00
|
|
|
preConfigure = lib.optionalString stdenv.hostPlatform.isMusl ''
|
2021-01-21 12:00:49 +00:00
|
|
|
NIX_CFLAGS_COMPILE+=" -Wno-null-dereference"
|
2020-07-06 06:51:46 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-21 12:00:49 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--program-prefix=eu-" # prevent collisions with binutils
|
|
|
|
"--enable-deterministic-archives"
|
|
|
|
"--disable-libdebuginfod"
|
|
|
|
"--disable-debuginfod"
|
|
|
|
];
|
2012-01-06 16:45:14 +00:00
|
|
|
|
2016-01-15 13:59:53 +00:00
|
|
|
enableParallelBuilding = true;
|
2013-04-05 23:45:25 +01:00
|
|
|
|
2018-08-08 22:10:14 +01:00
|
|
|
doCheck = false; # fails 3 out of 174 tests
|
|
|
|
doInstallCheck = false; # fails 70 out of 174 tests
|
|
|
|
|
2021-01-21 12:00:49 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://sourceware.org/elfutils/";
|
2016-01-15 13:59:53 +00:00
|
|
|
description = "A set of utilities to handle ELF objects";
|
2021-01-21 12:00:49 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
# 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 = [ maintainers.eelco ];
|
2009-02-17 16:42:51 +00:00
|
|
|
};
|
|
|
|
}
|