From 49c3b62b248f6403bd63dcccd81ed5386542e00c Mon Sep 17 00:00:00 2001 From: Bart Brouns Date: Sun, 21 Jun 2026 15:29:54 +0200 Subject: [PATCH] surge: fix build with glibc 2.41 The generated ScalablePiggy.S has no .note.GNU-stack section, so the linker marks the LV2/VST3 plugin .so as requiring an executable stack. Since glibc 2.41, dlopen() refuses to load such objects, which breaks the post-build LV2 step that dlopen()s the freshly built plugin to generate its .ttl manifest: OSError: .../Surge.lv2/Surge.so: cannot enable executable stack as shared object requires: Invalid argument Force a non-executable stack at link time with -z noexecstack. Fixes #533882 --- pkgs/by-name/su/surge/package.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/by-name/su/surge/package.nix b/pkgs/by-name/su/surge/package.nix index 505c2755f0c4..d8f039bf1e12 100644 --- a/pkgs/by-name/su/surge/package.nix +++ b/pkgs/by-name/su/surge/package.nix @@ -73,6 +73,14 @@ stdenv.mkDerivation (finalAttrs: { # Fix build with gcc 15 env.NIX_CFLAGS_COMPILE = "-Wno-deprecated"; + # The generated ScalablePiggy.S has no .note.GNU-stack section, so the linker + # marks the LV2/VST3 plugin .so as requiring an executable stack. Since glibc + # 2.41 dlopen() refuses to load such objects ("cannot enable executable stack + # as shared object requires"). This breaks the post-build step that dlopens + # the freshly built LV2 plugin to generate its .ttl manifest. Force a + # non-executable stack at link time. + env.NIX_LDFLAGS = "-z noexecstack"; + postPatch = '' substituteInPlace src/common/SurgeStorage.cpp \ --replace "/usr/share/Surge" "$out/share/surge"