summary refs log tree commit diff
path: root/pkgs/applications/virtualization
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2023-08-19 14:14:34 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2023-09-24 15:12:06 +0200
commit774a808ec9336326107de4096a07c22ed9c95a8e (patch)
tree89c95608c61beb82874b7cf687387fa8f4ba5ca4 /pkgs/applications/virtualization
parent5497c7ac5df57e4c472a307f62e0072a3ca6c3a1 (diff)
downloadnixpkgs-774a808ec9336326107de4096a07c22ed9c95a8e.tar
nixpkgs-774a808ec9336326107de4096a07c22ed9c95a8e.tar.gz
nixpkgs-774a808ec9336326107de4096a07c22ed9c95a8e.tar.bz2
nixpkgs-774a808ec9336326107de4096a07c22ed9c95a8e.tar.lz
nixpkgs-774a808ec9336326107de4096a07c22ed9c95a8e.tar.xz
nixpkgs-774a808ec9336326107de4096a07c22ed9c95a8e.tar.zst
nixpkgs-774a808ec9336326107de4096a07c22ed9c95a8e.zip
kvmtool: fix build w/ glibc-2.38
Failing Hydra build: https://hydra.nixos.org/build/230541621
Diffstat (limited to 'pkgs/applications/virtualization')
-rw-r--r--pkgs/applications/virtualization/kvmtool/default.nix2
-rw-r--r--pkgs/applications/virtualization/kvmtool/strlcpy-glibc-2.38-fix.patch25
2 files changed, 27 insertions, 0 deletions
diff --git a/pkgs/applications/virtualization/kvmtool/default.nix b/pkgs/applications/virtualization/kvmtool/default.nix
index e7429f3312d..9aeb21e3f06 100644
--- a/pkgs/applications/virtualization/kvmtool/default.nix
+++ b/pkgs/applications/virtualization/kvmtool/default.nix
@@ -10,6 +10,8 @@ stdenv.mkDerivation {
     sha256 = "sha256-wpc5DfHnui0lBVH4uOq6a7pXVUZStjNLRvauu6QpRvE=";
   };
 
+  patches = [ ./strlcpy-glibc-2.38-fix.patch ];
+
   buildInputs = lib.optionals stdenv.hostPlatform.isAarch64 [ dtc ];
 
   enableParallelBuilding = true;
diff --git a/pkgs/applications/virtualization/kvmtool/strlcpy-glibc-2.38-fix.patch b/pkgs/applications/virtualization/kvmtool/strlcpy-glibc-2.38-fix.patch
new file mode 100644
index 00000000000..457f8e3cff5
--- /dev/null
+++ b/pkgs/applications/virtualization/kvmtool/strlcpy-glibc-2.38-fix.patch
@@ -0,0 +1,25 @@
+Manually tell the compiler that strlcpy exists. The `try-build` function seems
+somewhat broken, i.e. any code that I try to pass to it doesn't link because of an
+"undefined reference to main" error (and some more quoting issues with newlines being
+swalloed).
+
+Because both musl and glibc seemt o support strlcpy nowadays, I decided to just skip the
+possibly broken feature-check and hardcode that it exists.
+
+diff --git a/Makefile b/Makefile
+index ed2414b..37be9cd 100644
+--- a/Makefile
++++ b/Makefile
+@@ -239,10 +239,8 @@ endif
+ # On a given system, some libs may link statically, some may not; so, check
+ # both and only build those that link!
+ 
+-ifeq ($(call try-build,$(SOURCE_STRLCPY),$(CFLAGS),$(LDFLAGS)),y)
+-	CFLAGS_DYNOPT	+= -DHAVE_STRLCPY
+-	CFLAGS_STATOPT	+= -DHAVE_STRLCPY
+-endif
++CFLAGS_DYNOPT	+= -DHAVE_STRLCPY
++CFLAGS_STATOPT	+= -DHAVE_STRLCPY
+ 
+ ifeq ($(call try-build,$(SOURCE_BFD),$(CFLAGS),$(LDFLAGS) -lbfd -static),y)
+ 	CFLAGS_STATOPT	+= -DCONFIG_HAS_BFD