diff --git a/pkgs/applications/audio/dexed/default.nix b/pkgs/applications/audio/dexed/default.nix index 9bb3937cc03d..46cdb937f75e 100644 --- a/pkgs/applications/audio/dexed/default.nix +++ b/pkgs/applications/audio/dexed/default.nix @@ -34,7 +34,6 @@ stdenv.mkDerivation rec { postPatch = '' # needs special setup on Linux, dunno if it can work on Darwin - # https://github.com/NixOS/nixpkgs/issues/19098 sed -i -e '/juce::juce_recommended_lto_flags/d' Source/CMakeLists.txt ''; diff --git a/pkgs/applications/audio/fire/default.nix b/pkgs/applications/audio/fire/default.nix index 0d4691b9e4f1..5b71667a2af0 100644 --- a/pkgs/applications/audio/fire/default.nix +++ b/pkgs/applications/audio/fire/default.nix @@ -49,7 +49,6 @@ stdenv.mkDerivation rec { postPatch = '' # 1. Remove hardcoded LTO flags: needs extra setup on Linux, # possibly broken on Darwin - # https://github.com/NixOS/nixpkgs/issues/19098 # 2. Disable automatic copying of built plugins during buildPhase, it defaults # into user home and we want to have building & installing separated. sed -i \ diff --git a/pkgs/applications/audio/sonobus/default.nix b/pkgs/applications/audio/sonobus/default.nix index 959c7a9d0623..fc0c5977360f 100644 --- a/pkgs/applications/audio/sonobus/default.nix +++ b/pkgs/applications/audio/sonobus/default.nix @@ -61,7 +61,6 @@ stdenv.mkDerivation (finalAttrs: { postPatch = lib.optionalString (stdenv.isLinux) '' # needs special setup on Linux, dunno if it can work on Darwin - # https://github.com/NixOS/nixpkgs/issues/19098 # Also, I get issues with linking without that, not sure why sed -i -e '/juce::juce_recommended_lto_flags/d' CMakeLists.txt patchShebangs linux/install.sh diff --git a/pkgs/applications/blockchains/miniscript/default.nix b/pkgs/applications/blockchains/miniscript/default.nix index 84b1b55f6618..8a842d507b0c 100644 --- a/pkgs/applications/blockchains/miniscript/default.nix +++ b/pkgs/applications/blockchains/miniscript/default.nix @@ -18,12 +18,8 @@ stdenv.mkDerivation rec { postPatch = lib.optionalString stdenv.isDarwin '' # Replace hardcoded g++ with c++ so clang can be used # on darwin - # - # lto must be disabled on darwin as well due to - # https://github.com/NixOS/nixpkgs/issues/19098 substituteInPlace Makefile \ - --replace-fail 'g++' 'c++' \ - --replace-fail '-flto' "" + --replace-fail 'g++' 'c++' ''; installPhase = '' diff --git a/pkgs/applications/emulators/firebird-emu/default.nix b/pkgs/applications/emulators/firebird-emu/default.nix index 9fd990146161..48f364751427 100644 --- a/pkgs/applications/emulators/firebird-emu/default.nix +++ b/pkgs/applications/emulators/firebird-emu/default.nix @@ -19,9 +19,6 @@ stdenv.mkDerivation rec { hash = "sha256-ZptjlnOiF+hKuKYvBFJL95H5YQuR99d4biOco/MVEmE="; }; - # work around https://github.com/NixOS/nixpkgs/issues/19098 - env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.cc.isClang && stdenv.isDarwin) "-fno-lto"; - nativeBuildInputs = [ wrapQtAppsHook qmake ]; buildInputs = [ qtbase qtdeclarative qtquickcontrols ]; diff --git a/pkgs/applications/science/computer-architecture/timeloop/default.nix b/pkgs/applications/science/computer-architecture/timeloop/default.nix index ec8ec3ed8abc..7fc5da8dfa89 100644 --- a/pkgs/applications/science/computer-architecture/timeloop/default.nix +++ b/pkgs/applications/science/computer-architecture/timeloop/default.nix @@ -41,10 +41,6 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - #link-time optimization fails on darwin - #see https://github.com/NixOS/nixpkgs/issues/19098 - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-fno-lto"; - postPatch = '' # Fix gcc-13 build failure due to missing includes: sed -e '1i #include ' -i \ diff --git a/pkgs/applications/virtualization/rvvm/default.nix b/pkgs/applications/virtualization/rvvm/default.nix index ce90b686bcb0..2d6b7d3da0c5 100644 --- a/pkgs/applications/virtualization/rvvm/default.nix +++ b/pkgs/applications/virtualization/rvvm/default.nix @@ -38,10 +38,7 @@ stdenv.mkDerivation rec { makeFlags = [ "PREFIX=$(out)" ] ++ lib.optional enableSDL "USE_SDL=2" # Use SDL2 instead of SDL1 - ++ lib.optional (!enableSDL && !enableX11) "USE_FB=0" - - # work around https://github.com/NixOS/nixpkgs/issues/19098 - ++ lib.optional (stdenv.cc.isClang && stdenv.isDarwin) "CFLAGS=-fno-lto"; + ++ lib.optional (!enableSDL && !enableX11) "USE_FB=0"; meta = with lib; { homepage = "https://github.com/LekKit/RVVM"; diff --git a/pkgs/by-name/tr/tracy/package.nix b/pkgs/by-name/tr/tracy/package.nix index 82d4b9c285b8..4e462bae4a3b 100644 --- a/pkgs/by-name/tr/tracy/package.nix +++ b/pkgs/by-name/tr/tracy/package.nix @@ -56,9 +56,7 @@ stdenv.mkDerivation rec { # ../../../server/TracyView.cpp:649:34, preventing building. ++ lib.optional stdenv.isDarwin "-Wno-format-security" ++ lib.optional stdenv.isLinux "-ltbb" - ++ lib.optional stdenv.cc.isClang "-faligned-allocation" - # workaround issue #19098 - ++ lib.optional (stdenv.cc.isClang && stdenv.isDarwin) "-fno-lto"); + ++ lib.optional stdenv.cc.isClang "-faligned-allocation"); buildPhase = '' runHook preBuild diff --git a/pkgs/development/compilers/ponyc/default.nix b/pkgs/development/compilers/ponyc/default.nix index 740ff702acd3..b10739ca3363 100644 --- a/pkgs/development/compilers/ponyc/default.nix +++ b/pkgs/development/compilers/ponyc/default.nix @@ -4,7 +4,7 @@ , cmake , coreutils , libxml2 -, lto ? !stdenv.isDarwin +, lto ? true , makeWrapper , openssl , pcre2 diff --git a/pkgs/development/compilers/rgbds/default.nix b/pkgs/development/compilers/rgbds/default.nix index 4f6f0df26222..872dcae2e132 100644 --- a/pkgs/development/compilers/rgbds/default.nix +++ b/pkgs/development/compilers/rgbds/default.nix @@ -14,7 +14,6 @@ stdenv.mkDerivation rec { postPatch = '' patchShebangs --host src/bison.sh ''; - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-fno-lto"; installFlags = [ "PREFIX=${placeholder "out"}" ]; meta = with lib; { diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index 9a155dd62b48..15c32eee3d44 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -70,8 +70,7 @@ , enableNoSemanticInterposition ? true # enabling LTO on 32bit arch causes downstream packages to fail when linking -# enabling LTO on *-darwin causes python3 to fail when linking. -, enableLTO ? stdenv.is64bit && stdenv.isLinux +, enableLTO ? stdenv.isDarwin || (stdenv.is64bit && stdenv.isLinux) # enable asserts to ensure the build remains reproducible , reproducibleBuild ? false @@ -159,7 +158,7 @@ let ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ buildPackages.stdenv.cc pythonOnBuildForHost - ] ++ optionals (stdenv.cc.isClang && (!stdenv.hostPlatform.useAndroidPrebuilt or false) && (enableLTO || enableOptimizations)) [ + ] ++ optionals (stdenv.cc.isClang && !stdenv.isDarwin && (!stdenv.hostPlatform.useAndroidPrebuilt or false) && (enableLTO || enableOptimizations)) [ stdenv.cc.cc.libllvm.out ]; diff --git a/pkgs/development/libraries/liblc3/default.nix b/pkgs/development/libraries/liblc3/default.nix index 3e1be4ba272e..ff04d23cb0c6 100644 --- a/pkgs/development/libraries/liblc3/default.nix +++ b/pkgs/development/libraries/liblc3/default.nix @@ -27,9 +27,6 @@ stdenv.mkDerivation { ninja ]; - # LTO does not work on Darwin: https://github.com/NixOS/nixpkgs/issues/19098 - mesonFlags = lib.optionals stdenv.isDarwin [ "-Db_lto=false" ]; - meta = with lib; { description = "LC3 (Low Complexity Communication Codec) is an efficient low latency audio codec"; homepage = "https://github.com/google/liblc3"; diff --git a/pkgs/development/libraries/wolfssl/default.nix b/pkgs/development/libraries/wolfssl/default.nix index affe693fe88f..c55ad0010d53 100644 --- a/pkgs/development/libraries/wolfssl/default.nix +++ b/pkgs/development/libraries/wolfssl/default.nix @@ -10,7 +10,7 @@ # requiring to build a special variant for that software. Example: 'haproxy' , variant ? "all" , extraConfigureFlags ? [] -, enableLto ? !(stdenv.isDarwin || stdenv.hostPlatform.isStatic || stdenv.cc.isClang) +, enableLto ? !(stdenv.hostPlatform.isStatic || stdenv.cc.isClang) }: stdenv.mkDerivation (finalAttrs: { pname = "wolfssl-${variant}"; diff --git a/pkgs/development/python-modules/cocotb/default.nix b/pkgs/development/python-modules/cocotb/default.nix index e7a322dad473..271ad52a9595 100644 --- a/pkgs/development/python-modules/cocotb/default.nix +++ b/pkgs/development/python-modules/cocotb/default.nix @@ -45,11 +45,6 @@ buildPythonPackage rec { # remove circular dependency cocotb-bus from setup.py substituteInPlace setup.py --replace "'cocotb-bus<1.0'" "" - '' - + lib.optionalString stdenv.isDarwin '' - # disable lto on darwin - # https://github.com/NixOS/nixpkgs/issues/19098 - substituteInPlace cocotb_build_libs.py --replace "-flto" "" ''; patches = [ diff --git a/pkgs/development/python-modules/levenshtein/default.nix b/pkgs/development/python-modules/levenshtein/default.nix index a7913fd5b097..4f04a810bd5e 100644 --- a/pkgs/development/python-modules/levenshtein/default.nix +++ b/pkgs/development/python-modules/levenshtein/default.nix @@ -37,12 +37,6 @@ buildPythonPackage rec { buildInputs = [ rapidfuzz-cpp ]; - env.NIX_CFLAGS_COMPILE = toString ( - lib.optionals (stdenv.cc.isClang && stdenv.isDarwin) [ - "-fno-lto" # work around https://github.com/NixOS/nixpkgs/issues/19098 - ] - ); - dependencies = [ rapidfuzz ]; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/nuitka/darwin-lto.patch b/pkgs/development/python-modules/nuitka/darwin-lto.patch deleted file mode 100644 index bd3a65905498..000000000000 --- a/pkgs/development/python-modules/nuitka/darwin-lto.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/nuitka/build/SconsCompilerSettings.py b/nuitka/build/SconsCompilerSettings.py -index 319b72c4e..89d40f2a2 100644 ---- a/nuitka/build/SconsCompilerSettings.py -+++ b/nuitka/build/SconsCompilerSettings.py -@@ -173,8 +173,8 @@ def _enableLtoSettings( - lto_mode = False - reason = "known to be not supported (CondaCC)" - elif isMacOS() and env.gcc_mode and env.clang_mode: -- lto_mode = True -- reason = "known to be supported (macOS clang)" -+ lto_mode = False -+ reason = "known to not be supported (macOS nix clang)" - elif env.mingw_mode and env.clang_mode: - lto_mode = False - reason = "known to not be supported (new MinGW64 Clang)" diff --git a/pkgs/development/python-modules/nuitka/default.nix b/pkgs/development/python-modules/nuitka/default.nix index fa0842267031..cce4467e73e5 100644 --- a/pkgs/development/python-modules/nuitka/default.nix +++ b/pkgs/development/python-modules/nuitka/default.nix @@ -23,9 +23,6 @@ buildPythonPackage rec { hash = "sha256-nKdCMgA92v9VsSgfktXDbSh3DyKsGlcTjpn0Y7u4rxU="; }; - # default lto off for darwin - patches = [ ./darwin-lto.patch ]; - build-system = [ setuptools wheel diff --git a/pkgs/development/python-modules/rapidfuzz/default.nix b/pkgs/development/python-modules/rapidfuzz/default.nix index 1d406e5d3508..4fe45a1dfa44 100644 --- a/pkgs/development/python-modules/rapidfuzz/default.nix +++ b/pkgs/development/python-modules/rapidfuzz/default.nix @@ -59,12 +59,6 @@ buildPythonPackage rec { export CMAKE_ARGS="-DCMAKE_CXX_COMPILER_AR=$AR -DCMAKE_CXX_COMPILER_RANLIB=$RANLIB" ''; - env.NIX_CFLAGS_COMPILE = toString ( - lib.optionals (stdenv.cc.isClang && stdenv.isDarwin) [ - "-fno-lto" # work around https://github.com/NixOS/nixpkgs/issues/19098 - ] - ); - passthru.optional-dependencies = { full = [ numpy ]; }; diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix index 2e59b8a99cc1..84d0bf21ce34 100644 --- a/pkgs/development/ruby-modules/gem-config/default.nix +++ b/pkgs/development/ruby-modules/gem-config/default.nix @@ -783,10 +783,7 @@ in substituteInPlace lib/sassc/native.rb \ --replace 'gem_root = spec.gem_dir' 'gem_root = File.join(__dir__, "../../")' ''; - } // (lib.optionalAttrs stdenv.isDarwin { - # https://github.com/NixOS/nixpkgs/issues/19098 - buildFlags = [ "--disable-lto" ]; - }); + }; sass-embedded = attrs: { # Patch the Rakefile to use our dart-sass and not try to fetch anything. diff --git a/pkgs/games/eduke32/default.nix b/pkgs/games/eduke32/default.nix index 5bb9966602d8..740d0bc47ea7 100644 --- a/pkgs/games/eduke32/default.nix +++ b/pkgs/games/eduke32/default.nix @@ -83,9 +83,6 @@ in stdenv.mkDerivation (finalAttrs: { makeFlags = [ "SDLCONFIG=${SDL2}/bin/sdl2-config" - ] ++ lib.optionals stdenv.isDarwin [ - # broken, see: https://github.com/NixOS/nixpkgs/issues/19098 - "LTO=0" ]; buildFlags = [ diff --git a/pkgs/games/stockfish/default.nix b/pkgs/games/stockfish/default.nix index 74eff702add1..2e6d142b7148 100644 --- a/pkgs/games/stockfish/default.nix +++ b/pkgs/games/stockfish/default.nix @@ -30,12 +30,6 @@ stdenv.mkDerivation rec { sha256 = "sha256-ASy2vIP94lnSKgxixK1GoC84yAysaJpxeyuggV4MrP4="; }; - # This addresses a linker issue with Darwin - # https://github.com/NixOS/nixpkgs/issues/19098 - preBuild = lib.optionalString stdenv.isDarwin '' - sed -i.orig '/^\#\#\# 3.*Link Time Optimization/,/^\#\#\# 3/d' Makefile - ''; - postUnpack = '' sourceRoot+=/src echo ${nnue} diff --git a/pkgs/tools/misc/remind/default.nix b/pkgs/tools/misc/remind/default.nix index 51448931dcfb..4b204d5a8764 100644 --- a/pkgs/tools/misc/remind/default.nix +++ b/pkgs/tools/misc/remind/default.nix @@ -30,9 +30,6 @@ tcl.mkTclDerivation rec { ''; env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin (toString [ - # Disable clang link time optimization until the following issue is resolved: - # https://github.com/NixOS/nixpkgs/issues/19098 - "-fno-lto" # On Darwin setenv and unsetenv are defined in stdlib.h from libSystem "-DHAVE_SETENV" "-DHAVE_UNSETENV" diff --git a/pkgs/tools/package-management/lix/common.nix b/pkgs/tools/package-management/lix/common.nix index b01b381d1491..f349e06f54fe 100644 --- a/pkgs/tools/package-management/lix/common.nix +++ b/pkgs/tools/package-management/lix/common.nix @@ -188,7 +188,6 @@ stdenv.mkDerivation { mesonFlags = [ # LTO optimization - (lib.mesonBool "b_lto" (!stdenv.isDarwin)) (lib.mesonEnable "gc" true) (lib.mesonBool "enable-tests" true) (lib.mesonBool "enable-docs" enableDocumentation) diff --git a/pkgs/tools/system/bfs/default.nix b/pkgs/tools/system/bfs/default.nix index 3469060c74c5..2b714b56def5 100644 --- a/pkgs/tools/system/bfs/default.nix +++ b/pkgs/tools/system/bfs/default.nix @@ -13,11 +13,6 @@ stdenv.mkDerivation rec { buildInputs = [ oniguruma ] ++ lib.optionals stdenv.isLinux [ libcap acl liburing ]; - # Disable LTO on darwin. See https://github.com/NixOS/nixpkgs/issues/19098 - preConfigure = lib.optionalString stdenv.isDarwin '' - substituteInPlace GNUMakefile --replace "-flto=auto" "" - ''; - makeFlags = [ "PREFIX=$(out)" ]; buildFlags = [ "release" ]; # "release" enables compiler optimizations