xorg-server: disable false positive buffer overrun check

The bounds checks introduced by `-D_FORTIFY_SOURCE=2` in functions
like `strlcpy` interact poorly with data structures that treat fixed
sized arrays as flexible arrays (e.g. `struct sockaddr`).  This bug
manifested as an endless crashloop in XQuartz.

See also https://github.com/llvm/llvm-project/issues/29694

(cherry picked from commit 44f2933184)
This commit is contained in:
George Huebner 2026-06-16 10:35:24 -07:00 committed by github-actions[bot]
commit 4a35131769

View file

@ -176,6 +176,9 @@ stdenv.mkDerivation (finalAttrs: {
--subst-var-by XQUARTZ_APP "$out/Applications/XQuartz.app"
'';
# avoid linux rebuilds
${if stdenv.hostPlatform.isDarwin then "hardeningDisable" else null} = [ "strictflexarrays1" ];
# default X install symlinks this to Xorg, we want XQuartz
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
ln -sf $out/bin/Xquartz $out/bin/X