about summary refs log tree commit diff
path: root/pkgs/development/tools/misc/gdb
diff options
context:
space:
mode:
authorYureka <yuka@yuka.dev>2023-04-17 23:06:16 +0200
committerGitHub <noreply@github.com>2023-04-17 23:06:16 +0200
commitcb2d5a2fa9f2fa6dd2a619fc3be3e2de21a6a2f4 (patch)
treea52d752872fc10749a6e3fa8bd61718f9445bc5e /pkgs/development/tools/misc/gdb
parent46f0bd317c8896813187d1034d0a2e01dd716dcb (diff)
gdbHostCpuOnly: init (#226134)
Closure size 843.9M -> 212.3M
Diffstat (limited to 'pkgs/development/tools/misc/gdb')
-rw-r--r--pkgs/development/tools/misc/gdb/default.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix
index 29bc6e601e656..1c4d6506b72ee 100644
--- a/pkgs/development/tools/misc/gdb/default.nix
+++ b/pkgs/development/tools/misc/gdb/default.nix
@@ -9,6 +9,7 @@
 , pythonSupport ? stdenv.hostPlatform == stdenv.buildPlatform && !stdenv.hostPlatform.isCygwin, python3 ? null
 , enableDebuginfod ? false, elfutils
 , guile ? null
+, hostCpuOnly ? false
 , safePaths ? [
    # $debugdir:$datadir/auto-load are whitelisted by default by GDB
    "$debugdir" "$datadir/auto-load"
@@ -27,7 +28,7 @@ in
 assert pythonSupport -> python3 != null;
 
 stdenv.mkDerivation rec {
-  pname = targetPrefix + basename;
+  pname = targetPrefix + basename + lib.optionalString hostCpuOnly "-host-cpu-only";
   version = "13.1";
 
   src = fetchurl {
@@ -94,7 +95,8 @@ stdenv.mkDerivation rec {
     "--program-prefix=${targetPrefix}"
 
     "--disable-werror"
-    "--enable-targets=all" "--enable-64-bit-bfd"
+  ] ++ lib.optional (!hostCpuOnly) "--enable-targets=all" ++ [
+    "--enable-64-bit-bfd"
     "--disable-install-libbfd"
     "--disable-shared" "--enable-static"
     "--with-system-zlib"