Merge pull request #142799 from Ma27/glibc-mtrace

mtrace: init at 2.33-50
This commit is contained in:
Maximilian Bosch 2021-11-04 23:01:02 +01:00 committed by GitHub
commit b8ab5de781
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 1 deletions

View File

@ -198,7 +198,7 @@ stdenv.mkDerivation ({
BASH_SHELL = "/bin/sh";
# Used by libgcc, elf-header, and others to determine ABI
passthru = { inherit version; };
passthru = { inherit version; minorRelease = version; };
}
// (removeAttrs args [ "withLinuxHeaders" "withGd" ]) //

View File

@ -0,0 +1,38 @@
{ glibc, perl }:
# Small wrapper which only exposes `mtrace(3)` from `glibc`. This can't be placed
# into `glibc` itself because it depends on Perl which would mean that the final
# `glibc` inside a stdenv bootstrap has a dependency `glibc -> perl -> bootstrap tools`,
# so this is now in its own package that isn't used for bootstrapping.
#
# `glibc` needs to be overridden here because it's still needed to `./configure` the source in order
# to have a build environment where we can call the needed make target.
glibc.overrideAttrs ({ meta ? {}, ... }: {
pname = "glibc-mtrace";
buildPhase = ''
runHook preBuild
mkdir malloc
make -C ../glibc-${glibc.minorRelease}/malloc objdir=`pwd` `pwd`/malloc/mtrace;
runHook postBuild
'';
installPhase = ''
mkdir -p $out/bin
mv malloc/mtrace $out/bin/
'';
# Perl interpreter used for `mtrace`.
buildInputs = [ perl ];
# Reset a few things declared by `pkgs.glibc`.
outputs = [ "out" ];
separateDebugInfo = false;
meta = meta // {
description = "Perl script used to interpret and provide human readable output of the trace log contained in the file mtracedata, whose contents were produced by mtrace(3).";
};
})

View File

@ -16325,6 +16325,8 @@ with pkgs;
stdenv = gccStdenv; # doesn't compile without gcc
};
mtrace = callPackage ../development/libraries/glibc/mtrace.nix { };
# Provided by libc on Operating Systems that use the Extensible Linker Format.
elf-header =
if stdenv.hostPlatform.parsed.kernel.execFormat.name == "elf"