llvmPackages_20.libc-full: fix building

This commit is contained in:
Tristan Ross
2025-02-27 18:21:34 -08:00
parent a99aed50a5
commit 14647cefc0
@@ -46,6 +46,7 @@ stdenv.mkDerivation (finalAttrs: {
outputs = [ "out" ] ++ (lib.optional isFullBuild "dev");
postUnpack = lib.optionalString isFullBuild ''
chmod +w $sourceRoot/../$pname/utils/hdrgen
patchShebangs $sourceRoot/../$pname/utils/hdrgen/main.py
chmod +x $sourceRoot/../$pname/utils/hdrgen/main.py
'';
@@ -65,10 +66,20 @@ stdenv.mkDerivation (finalAttrs: {
libc = if (!isFullBuild) then stdenv.cc.libc else null;
cmakeFlags = [
(lib.cmakeBool "LLVM_LIBC_FULL_BUILD" isFullBuild)
(lib.cmakeFeature "LLVM_ENABLE_RUNTIMES" "libc")
];
cmakeFlags =
[
(lib.cmakeBool "LLVM_LIBC_FULL_BUILD" isFullBuild)
(lib.cmakeFeature "LLVM_ENABLE_RUNTIMES" "libc")
# Tests requires the host to have a libc.
(lib.cmakeBool "LLVM_INCLUDE_TESTS" (stdenv.cc.libc != null))
]
++ lib.optional (isFullBuild && stdenv.cc.libc == null) [
# CMake runs a check to see if the compiler works.
# This includes including headers which requires a libc.
# Skip these checks because a libc cannot be used when one doesn't exist.
(lib.cmakeBool "CMAKE_C_COMPILER_WORKS" true)
(lib.cmakeBool "CMAKE_CXX_COMPILER_WORKS" true)
];
# For the update script:
passthru = {