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; diff --git a/pkgs/applications/editors/vim/default.nix b/pkgs/applications/editors/vim/default.nix index ec3e7c9a6253..d9abd14e2e51 100644 --- a/pkgs/applications/editors/vim/default.nix +++ b/pkgs/applications/editors/vim/default.nix @@ -14,6 +14,8 @@ url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/68f6d131750aa778807119e03eed70286a17b1cb/trunk/archlinux.vim"; sha256 = "18ifhv5q9prd175q3vxbqf6qyvkk6bc7d2lhqdk0q78i68kv9y0c"; }, + # TODO: Clean up on `staging` + llvmPackages, }: let @@ -37,6 +39,10 @@ stdenv.mkDerivation { nativeBuildInputs = [ gettext pkg-config + ] + # TODO: Clean up on `staging`. + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + llvmPackages.lld ]; buildInputs = [ ncurses @@ -44,6 +50,13 @@ stdenv.mkDerivation { gawk ]; + # workaround for ld64 hardening issue + # + # TODO: Clean up on `staging` + env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { + NIX_CFLAGS_COMPILE = "-fuse-ld=lld"; + }; + strictDeps = true; configureFlags = [ diff --git a/pkgs/applications/editors/vim/full.nix b/pkgs/applications/editors/vim/full.nix index a2a105e3182c..f07960cf950c 100644 --- a/pkgs/applications/editors/vim/full.nix +++ b/pkgs/applications/editors/vim/full.nix @@ -48,6 +48,9 @@ darwinSupport ? config.vim.darwin or false, # Enable Darwin support ftNixSupport ? config.vim.ftNix or true, # Add nix indentation support from vim-nix (not needed for basic syntax highlighting) sodiumSupport ? config.vim.sodium or true, # Enable sodium based encryption + + # TODO: Clean up on `staging` + llvmPackages, }: let @@ -169,7 +172,9 @@ stdenv.mkDerivation { ++ lib.optional nlsSupport gettext ++ lib.optional perlSupport perl ++ lib.optional (guiSupport == "gtk3") wrapGAppsHook3 - ++ lib.optional waylandSupport wayland-scanner; + ++ lib.optional waylandSupport wayland-scanner + # TODO: Clean up on `staging` + ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.lld; buildInputs = [ ncurses @@ -196,7 +201,10 @@ stdenv.mkDerivation { ++ lib.optional sodiumSupport libsodium; # error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-fdeclspec"; + # workaround for ld64 hardening issue + # + # TODO: Clean up on `staging` + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-fdeclspec -fuse-ld=lld"; preConfigure = lib.optionalString ftNixSupport '' cp ${vimPlugins.vim-nix.src}/ftplugin/nix.vim runtime/ftplugin/nix.vim diff --git a/pkgs/applications/editors/vim/macvim.nix b/pkgs/applications/editors/vim/macvim.nix index 36e22ddc2b0a..9e48750c0b0a 100644 --- a/pkgs/applications/editors/vim/macvim.nix +++ b/pkgs/applications/editors/vim/macvim.nix @@ -17,6 +17,8 @@ # This can be set to one of the `darwin.xcode_*` packages as well. # If set, this should be a path to Xcode.app, e.g. `"/Applications/Xcode.app"`. withXcodePath ? null, + # TODO: Clean up on `staging` + llvmPackages, }: # Try to match MacVim's documented script interface compatibility @@ -48,6 +50,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ pkg-config + # TODO: Clean up on `staging` + llvmPackages.lld ]; buildInputs = [ # MacVim references up to MAC_OS_VERSION_14_0 in its source @@ -188,7 +192,8 @@ stdenv.mkDerivation (finalAttrs: { # macvim obj-c log macro triggers -Wformat-security (seems like a bug? it's a string literal!) hardeningDisable = common.hardeningDisable ++ [ "format" ]; # os_log also enables -Werror,-Wformat by default - env.NIX_CFLAGS_COMPILE = "-DOS_LOG_FORMAT_WARNINGS"; + # TODO: Clean up on `staging` + env.NIX_CFLAGS_COMPILE = "-DOS_LOG_FORMAT_WARNINGS -fuse-ld=lld"; # We rely on the user's Xcode install to build. It may be located in an arbitrary place, and # it's not clear what system-level components it may require, so for now we'll just allow full diff --git a/pkgs/by-name/gt/gtk3/package.nix b/pkgs/by-name/gt/gtk3/package.nix index 3c3ffc066dbb..bd66967f1014 100644 --- a/pkgs/by-name/gt/gtk3/package.nix +++ b/pkgs/by-name/gt/gtk3/package.nix @@ -58,6 +58,8 @@ broadwaySupport ? true, wayland-scanner, testers, + # TODO: Clean up on `staging` + llvmPackages, }: let @@ -142,6 +144,10 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optionals waylandSupport [ wayland-scanner + ] + # TODO: Clean up on `staging` + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + llvmPackages.lld ]; buildInputs = @@ -213,7 +219,17 @@ stdenv.mkDerivation (finalAttrs: { # These are the defines that'd you'd get with --enable-debug=minimum (default). # See: https://developer.gnome.org/gtk3/stable/gtk-building.html#extra-configuration-options - env.NIX_CFLAGS_COMPILE = "-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS"; + env = { + NIX_CFLAGS_COMPILE = "-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS"; + } + // lib.optionalAttrs stdenv.hostPlatform.isDarwin { + # workaround for ld64 hardening issue + # + # TODO: Clean up on `staging` + + CC_LD = "lld"; + OBJC_LD = "lld"; + }; postPatch = '' # See https://github.com/NixOS/nixpkgs/issues/132259