From c331209980ea6072843f4691b76870bed8aae54d Mon Sep 17 00:00:00 2001 From: Emily Date: Wed, 15 Jul 2026 03:19:14 +0100 Subject: [PATCH] Revert "livekit-libwebrtc: link with lld on darwin" The ld64 issue has been fixed. This reverts commit 7149c9fa371b483948da77550d66f70c265ac396. --- pkgs/by-name/li/livekit-libwebrtc/package.nix | 24 +++---------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/pkgs/by-name/li/livekit-libwebrtc/package.nix b/pkgs/by-name/li/livekit-libwebrtc/package.nix index b4cebbf58efd..f7e1fd2e88b3 100644 --- a/pkgs/by-name/li/livekit-libwebrtc/package.nix +++ b/pkgs/by-name/li/livekit-libwebrtc/package.nix @@ -7,8 +7,6 @@ fetchurl, fetchpatch, xcbuild, - lld, - llvm, python3, ninja, git, @@ -184,13 +182,7 @@ stdenv.mkDerivation { ln -sf ${lib.getExe gn} buildtools/mac/gn chmod +x build/toolchain/apple/linker_driver.py patchShebangs build/toolchain/apple/linker_driver.py - - # When 'use_lld=true' is set, llvm-ar is used instead of ar. - # The build config expects llvm-ar to be inside the provided clang base path, - # but this is not the case in nixpkgs. - substituteInPlace build/toolchain/apple/toolchain.gni \ - --replace-fail "/bin/cp -Rc" "cp -a" \ - --replace-fail '${"$"}{prefix}llvm-ar' '${lib.getExe' llvm "llvm-ar"}' + substituteInPlace build/toolchain/apple/toolchain.gni --replace-fail "/bin/cp -Rc" "cp -a" # nixpkgs calls the target "darwin" instead of "macos", and passing a different target # results in warnings by the nixpkgs compiler wrapper @@ -218,10 +210,7 @@ stdenv.mkDerivation { cpio pkg-config ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - xcbuild - lld - ]; + ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ]; buildInputs = [ nasm @@ -290,8 +279,7 @@ stdenv.mkDerivation { "rtc_enable_objc_symbol_export=true" "rtc_include_dav1d_in_internal_decoder_factory=true" "clang_use_chrome_plugins=false" - # ld64 traps on linking because of C++ hardening - "use_lld=true" + "use_lld=false" ''clang_base_path="${clang}"'' ]); @@ -309,12 +297,6 @@ stdenv.mkDerivation { "desktop_capture_objc" ]; - env = { - # ensure install_name_tool has enough space in binary headers - # to replace rpaths with very long nix store paths - NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-headerpad_max_install_names"; - }; - postBuild = lib.optionalString stdenv.hostPlatform.isLinux '' objcopy --redefine-syms="${boringSslSymbols}" "libwebrtc.so"