From 0716e49a5492378458a048836035d558ec207f50 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Mon, 21 Aug 2023 13:32:19 -0700 Subject: [PATCH 1/2] pkgs.test.cross.sanity: add musl64-llvm tests --- pkgs/test/cross/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/test/cross/default.nix b/pkgs/test/cross/default.nix index ff83aedca1231..974c7ec999188 100644 --- a/pkgs/test/cross/default.nix +++ b/pkgs/test/cross/default.nix @@ -144,6 +144,8 @@ let pkgs.pkgsCross.mips64el-linux-gnuabi64.stdenv pkgs.pkgsCross.mips64el-linux-gnuabin32.stdenv pkgs.pkgsCross.mingwW64.stdenv + pkgs.pkgsCross.musl64.llvmPackages_16.clang.cc + pkgs.pkgsStatic.llvmPackages_16.clang.cc ]; in { From 45ee21ca30a76d2c703b30d030a3aa4c9ced4023 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Mon, 21 Aug 2023 13:32:31 -0700 Subject: [PATCH 2/2] llvmPackages_{15,16,git}.clang.cc: Fix `canExecute == true` cross Fixes `pkgsCross.musl64.llvmPackages_16.clang.cc`. buildLlvmTools shouldn't be needed at all when build canExecute host, but i'll need more work to fix. `build/build.ninja` has lines like ``` build include/clang/AST/TypeNodes.inc | ${cmake_ninja_workdir}include/clang/AST/TypeNodes.inc: CUSTOM_COMMAND bin/clang-tblgen bin/clang-tblgen /build/clang-src-16.0.6/clang/include/clang/Basic/TypeNodes.td || bin/clang-tblgen lib/Support/obj.clangSupport COMMAND = cd /build/clang-src-16.0.6/clang/build && clang-tblgen -gen-clang-type-nodes ... ``` `&& clang-tblgen` should be `&& bin/clang-tblgen` Maybe `"-DCLANG_TABLEGEN=bin/clang-tblgen"` would work Reported here: https://github.com/NixOS/nixpkgs/pull/226551#discussion_r1300386564 Co-authored-by: Artturin --- pkgs/development/compilers/llvm/15/clang/default.nix | 3 ++- pkgs/development/compilers/llvm/16/clang/default.nix | 3 ++- pkgs/development/compilers/llvm/git/clang/default.nix | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/llvm/15/clang/default.nix b/pkgs/development/compilers/llvm/15/clang/default.nix index 894db1a4975f6..2ccacb43ddd9d 100644 --- a/pkgs/development/compilers/llvm/15/clang/default.nix +++ b/pkgs/development/compilers/llvm/15/clang/default.nix @@ -36,7 +36,8 @@ let "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" - ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + # Should use canExecute but `pkgsCross.musl64.llvmPackages_XX.clang.cc` fails with `/bin/sh: clang-tblgen: not found` + ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" # Added in LLVM15: diff --git a/pkgs/development/compilers/llvm/16/clang/default.nix b/pkgs/development/compilers/llvm/16/clang/default.nix index 2a2656df5fe1c..5f32ef5e5aa00 100644 --- a/pkgs/development/compilers/llvm/16/clang/default.nix +++ b/pkgs/development/compilers/llvm/16/clang/default.nix @@ -36,7 +36,8 @@ let "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" - ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + # Should use canExecute but `pkgsCross.musl64.llvmPackages_XX.clang.cc` fails with `/bin/sh: clang-tblgen: not found` + ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" # Added in LLVM15: diff --git a/pkgs/development/compilers/llvm/git/clang/default.nix b/pkgs/development/compilers/llvm/git/clang/default.nix index 733f5462d320c..09f4840c69ca0 100644 --- a/pkgs/development/compilers/llvm/git/clang/default.nix +++ b/pkgs/development/compilers/llvm/git/clang/default.nix @@ -36,7 +36,8 @@ let "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" - ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + # Should use canExecute but `pkgsCross.musl64.llvmPackages_git.clang.cc` fails with `/bin/sh: clang-tblgen: not found` + ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" # Added in LLVM15: