From 8f947e417ff684965bd0156c8a444b389ab9310e Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Tue, 17 Jan 2023 19:46:33 +0000 Subject: pkgsCross.wasi32.pkgsBuildTarget.llvm_{{5,12},git}: disable gold plugin on wasi In https://github.com/NixOS/nixpkgs/pull/211126 I simplified `binutils` and `libbfd` derivations to follow upstream binutils build system closer. As a result of `./configure --target=wasm32-unknown-wasi` `binutils` does not install plugin headers by default. This causes `pkgsCross.wasi32.llvm_12` (used by `firefox`) to fail the build as: [ 81%] Building CXX object tools/gold/CMakeFiles/LLVMgold.dir/gold-plugin.cpp.o /build/llvm/tools/gold/gold-plugin.cpp:38:10: fatal error: plugin-api.h: No such file or directory 38 | #include | ^~~~~~~~~~~~~~ The change accomodates this constraint to disable plugin support for `wasi` targets. --- pkgs/development/compilers/llvm/12/llvm/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkgs/development/compilers/llvm/12/llvm/default.nix') diff --git a/pkgs/development/compilers/llvm/12/llvm/default.nix b/pkgs/development/compilers/llvm/12/llvm/default.nix index b04eeb3c726..29f722ae015 100644 --- a/pkgs/development/compilers/llvm/12/llvm/default.nix +++ b/pkgs/development/compilers/llvm/12/llvm/default.nix @@ -5,6 +5,7 @@ , cmake , python3 , libffi +, enableGoldPlugin ? (!stdenv.isDarwin && !stdenv.targetPlatform.isWasi) , libbfd , libpfm , libxml2 @@ -191,7 +192,7 @@ in stdenv.mkDerivation (rec { "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" - ] ++ optionals (!isDarwin) [ + ] ++ optionals (enableGoldPlugin) [ "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" ] ++ optionals isDarwin [ "-DLLVM_ENABLE_LIBCXX=ON" -- cgit 1.4.1