From e75c5353bb337b8e8bacf02c7b369b1e897771b9 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Fri, 16 Apr 2021 18:00:56 +0200 Subject: [PATCH] gdb: always set --program-prefix and pass --target This makes the targetPrefix always conform to nixpkgs' expectations instead of relying on the autotools build system to figure it out correctly (which is also inconsistent across versions). See also ca9be0511b0661be5255dd1fe0b05c5eaf3e56d8. --- pkgs/development/tools/misc/gdb/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix index 6f9237789750..66d4e8bc0572 100644 --- a/pkgs/development/tools/misc/gdb/default.nix +++ b/pkgs/development/tools/misc/gdb/default.nix @@ -61,8 +61,7 @@ stdenv.mkDerivation rec { NIX_CFLAGS_COMPILE = "-Wno-format-nonliteral"; - # TODO(@Ericson2314): Always pass "--target" and always prefix. - configurePlatforms = [ "build" "host" ] ++ lib.optional (stdenv.targetPlatform != stdenv.hostPlatform) "target"; + configurePlatforms = [ "build" "host" "target" ]; # GDB have to be built out of tree. preConfigure = '' @@ -72,6 +71,13 @@ stdenv.mkDerivation rec { configureScript = "../configure"; configureFlags = with lib; [ + # Set the program prefix to the current targetPrefix. + # This ensures that the prefix always conforms to + # nixpkgs' expectations instead of relying on the build + # system which only receives `config` which is merely a + # subset of the platform description. + "--program-prefix=${targetPrefix}" + "--enable-targets=all" "--enable-64-bit-bfd" "--disable-install-libbfd" "--disable-shared" "--enable-static"