From c76523c9bba19fed65c04bc1d2e288f54fd64686 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Mon, 28 Sep 2026 11:25:25 +0200 Subject: [PATCH] libucontext: build the hand-written asm files with -Wa,--noexecstack meson.build omits the flag the Makefile passes, giving every static consumer (e.g. pkgsStatic.lix via capnproto) an executable stack. :) Signed-off-by: Raito Bezarius --- pkgs/by-name/li/libucontext/package.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/by-name/li/libucontext/package.nix b/pkgs/by-name/li/libucontext/package.nix index 36c010c7218b..1349bde56c0d 100644 --- a/pkgs/by-name/li/libucontext/package.nix +++ b/pkgs/by-name/li/libucontext/package.nix @@ -23,6 +23,11 @@ stdenv.mkDerivation (finalAttrs: { ninja ]; + # Makefile builds the asm files with -Wa,--noexecstack, meson.build does not. + # If you do not pass it, you get PT_GNU_STACK=RWE on static consumers of the library. + # https://github.com/kaniini/libucontext/issues/83 + env.NIX_CFLAGS_COMPILE = "-Wa,--noexecstack"; + passthru.updateScript = nix-update-script { }; meta = {