From 495a318fbc38c106e2fdc2c4fb2838eabfff3045 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Tue, 30 May 2023 00:23:35 +0200 Subject: [PATCH] chromiumBeta: Fix the build with LLVM 16 by reverting a commit This reverts a small commit [0] that adds the flag "-disable-auto-upgrade-debug-info" as it requires an unreleased LLVM version or the build will fail with the following error message: ``` ld.lld: error: -mllvm: ld.lld: Unknown command line argument '-disable-auto-upgrade-debug-info'. Try: '/nix/store/bx494s1r30zwa7zdsyg72sjryy0k0pyg-llvm-binutils-16.0.1/bin/ld.lld --help' ld.lld: Did you mean '--disable-auto-paired-vec-st'? clang++: error: linker command failed with exit code 1 (use -v to see invocation) ``` See [1] for a full example output. Thanks to Lorenz Brun for the analysis/help [2]. [0]: https://github.com/chromium/chromium/commit/54969766fd2029c506befc46e9ce14d67c7ed02a [1]: https://github.com/NixOS/nixpkgs/issues/213862#issuecomment-1542887001 [2]: https://github.com/NixOS/nixpkgs/issues/213862#issuecomment-1542927502 (cherry picked from commit 16f87c4cdb1fe2388965cb5eb1f17e2d8192a0b9) --- pkgs/applications/networking/browsers/chromium/common.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index 774c61b55678a..976f09d38f693 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -170,6 +170,14 @@ let # (we currently package 1.26 in Nixpkgs while Chromium bundles 1.21): # Source: https://bugs.chromium.org/p/angleproject/issues/detail?id=7582#c1 ./patches/angle-wayland-include-protocol.patch + ] ++ lib.optionals (chromiumVersionAtLeast "114") [ + # We need to revert this patch to build M114+ with LLVM 16: + (githubPatch { + # Reland [clang] Disable autoupgrading debug info in ThinLTO builds + commit = "54969766fd2029c506befc46e9ce14d67c7ed02a"; + sha256 = "sha256-Vryjg8kyn3cxWg3PmSwYRG6zrHOqYWBMSdEMGiaPg6M="; + revert = true; + }) ]; postPatch = ''