diff --git a/pkgs/applications/editors/emacs/make-emacs.nix b/pkgs/applications/editors/emacs/make-emacs.nix index 0a92e2cb11d9..d33fb2ef12bc 100644 --- a/pkgs/applications/editors/emacs/make-emacs.nix +++ b/pkgs/applications/editors/emacs/make-emacs.nix @@ -116,6 +116,8 @@ # test callPackage, + # TODO: Clean up on `staging` + llvmPackages, }: assert (withGTK3 && !withNS && variant != "macport") -> withX || withPgtk; @@ -252,7 +254,11 @@ stdenv.mkDerivation (finalAttrs: { autoreconfHook ] ++ lib.optionals (withPgtk || withX && (withGTK3 || withXwidgets)) [ wrapGAppsHook3 ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ sigtool ]; + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + sigtool + # TODO: Clean up on `staging` + llvmPackages.lld + ]; buildInputs = [ gnutls @@ -418,10 +424,15 @@ stdenv.mkDerivation (finalAttrs: { NATIVE_FULL_AOT = "1"; LIBRARY_PATH = lib.concatStringsSep ":" libGccJitLibraryPaths; } - // lib.optionalAttrs (variant == "macport") { - # Fixes intermittent segfaults when compiled with LLVM >= 7.0. - # See https://github.com/NixOS/nixpkgs/issues/127902 - NIX_CFLAGS_COMPILE = "-isystem ${./macport-noescape-noop}"; + // lib.optionalAttrs stdenv.hostPlatform.isDarwin { + # workaround for ld64 hardening issue + # + # TODO: Clean up on `staging` + NIX_CFLAGS_COMPILE = + "-fuse-ld=lld" + # Fixes intermittent segfaults when compiled with LLVM >= 7.0. + # See https://github.com/NixOS/nixpkgs/issues/127902 + + lib.optionalString (variant == "macport") " -isystem ${./macport-noescape-noop}"; }; enableParallelBuilding = true;