From c0952b6478194c01081d338b46402803cbfd14a6 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Fri, 18 Feb 2022 21:28:37 +0100 Subject: [PATCH 1/3] chromium{Beta,Dev}: Switch to LLVM 14 This fixes the following build error: [24751/48400] ACTION //components/url_formatter/spoof_checks/top_domains:generate_top_domain_list_variables_file(//build/toolchain/linux/unbundle:default)d_tmp/browser_command.mojom-webui.js.mojom-webui.jsui.js FAILED: gen/components/url_formatter/spoof_checks/top_domains/top500-domains-inc.cc python3 ../../build/gn_run_binary.py make_top_domain_list_variables ../../components/url_formatter/spoof_checks/top_domains/domains.list top500_domains gen/components/url_formatter/spoof_checks/top_domains/top500-domains-inc.cc make_top_domain_list_variables failed with exit code -4 The "make_top_domain_list_variables" program fails due to a SIGILL error (illegal instruction). See: - https://bugs.chromium.org/p/chromium/issues/detail?id=1273966 - https://reviews.llvm.org/D115015 - https://bugs.chromium.org/p/chromium/issues/detail?id=1269407 --- pkgs/applications/networking/browsers/chromium/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix index 53762744504e..084db58f38b7 100644 --- a/pkgs/applications/networking/browsers/chromium/default.nix +++ b/pkgs/applications/networking/browsers/chromium/default.nix @@ -1,5 +1,5 @@ { newScope, config, stdenv, fetchurl, makeWrapper -, llvmPackages_13, ed, gnugrep, coreutils, xdg-utils +, llvmPackages_13, llvmPackages_14, ed, gnugrep, coreutils, xdg-utils , glib, gtk3, gnome, gsettings-desktop-schemas, gn, fetchgit , libva, pipewire, wayland , gcc, nspr, nss, runCommand @@ -54,6 +54,9 @@ let inherit (upstream-info.deps.gn) url rev sha256; }; }); + } // lib.optionalAttrs (chromiumVersionAtLeast "99") rec { + llvmPackages = llvmPackages_14; + stdenv = llvmPackages_14.stdenv; }); browser = callPackage ./browser.nix { From 1bdf7862e3f8007cdb21bbbde1d496064f869bb3 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Sun, 27 Feb 2022 20:30:43 +0100 Subject: [PATCH 2/3] chromiumBeta: Fix the build This "fixes" the following error: gen/shim_headers/opus_shim/third_party/opus/src/include/opus.h:5:10: error: 'opus.h' file not found with include; use "quotes" instead ^~~~~~~~ "opus.h" Our system library isn't discovered anymore so I'm switching to the bundled Opus library for now since I don't have time to look into it. --- pkgs/applications/networking/browsers/chromium/common.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index c377c0ab2079..0eb1893e95c0 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -96,7 +96,7 @@ let "libpng" "libwebp" "libxslt" - "opus" + # "opus" ]; opusWithCustomModes = libopus.override { From 3bce8227a0019104590dfab07d527f7493a9e1f6 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Mon, 28 Feb 2022 12:31:39 +0100 Subject: [PATCH 3/3] llvmPackages_14.lld: Update fix-root-src-dir.patch to fix the build --- .../compilers/llvm/14/lld/fix-root-src-dir.patch | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/development/compilers/llvm/14/lld/fix-root-src-dir.patch b/pkgs/development/compilers/llvm/14/lld/fix-root-src-dir.patch index 26ecef256495..38fb965b472a 100644 --- a/pkgs/development/compilers/llvm/14/lld/fix-root-src-dir.patch +++ b/pkgs/development/compilers/llvm/14/lld/fix-root-src-dir.patch @@ -1,13 +1,13 @@ -diff --git a/lld/CMakeLists.txt b/lld/CMakeLists.txt -index e1a29b884d17..9d542f8fbfc1 100644 +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9bcc135665d0..d38679ed41e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -64,7 +64,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - - set(LLVM_MAIN_INCLUDE_DIR ${MAIN_INCLUDE_DIR} CACHE PATH "Path to llvm/include") - set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree") -- set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree") +@@ -74,7 +74,7 @@ if(LLD_BUILT_STANDALONE) + + set(LLVM_MAIN_INCLUDE_DIR "${MAIN_INCLUDE_DIR}" CACHE PATH "Path to llvm/include") + set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree") +- set(LLVM_MAIN_SRC_DIR "${MAIN_SRC_DIR}" CACHE PATH "Path to LLVM source tree") + set(LLVM_MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm" CACHE PATH "Path to LLVM source tree") - + find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)