Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 11 additions & 27 deletions pkgs/development/compilers/llvm/common/clang/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -95,37 +95,28 @@ stdenv.mkDerivation (
(lib.cmakeFeature "CLANG_INSTALL_PACKAGE_DIR" "${placeholder "dev"}/lib/cmake/clang")
(lib.cmakeBool "CLANGD_BUILD_XPC" false)
(lib.cmakeBool "LLVM_ENABLE_RTTI" true)
(lib.cmakeBool "LLVM_INCLUDE_TESTS" false)
(lib.cmakeFeature "LLVM_TABLEGEN_EXE" "${buildLlvmTools.tblgen}/bin/llvm-tblgen")
(lib.cmakeFeature "CLANG_TABLEGEN" "${buildLlvmTools.tblgen}/bin/clang-tblgen")
(lib.cmakeFeature "CLANG_TIDY_CONFUSABLE_CHARS_GEN" "${buildLlvmTools.tblgen}/bin/clang-tidy-confusable-chars-gen")
]
++ lib.optional (lib.versionAtLeast release_version "20") (
lib.cmakeFeature "LLVM_DIR" "${libllvm.dev}/lib/cmake/llvm"
)
Comment on lines +103 to +105
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I sorted LLVM_DIR up to here so that when llvm 19 is dropped it will already be in the right place instead of left in an unconditional ++ [ … ] at the bottom.

++ lib.optionals (lib.versionAtLeast release_version "21") [
(lib.cmakeFeature "CLANG_RESOURCE_DIR" "${placeholder "lib"}/lib/clang/${lib.versions.major release_version}")
]
# TODO: Clean up on `staging`.
++ [
(lib.cmakeBool "LLVM_INCLUDE_TESTS" false)
]
++ lib.optionals enableManpages [
(lib.cmakeBool "CLANG_INCLUDE_DOCS" true)
(lib.cmakeBool "LLVM_ENABLE_SPHINX" true)
(lib.cmakeBool "SPHINX_OUTPUT_MAN" true)
(lib.cmakeBool "SPHINX_OUTPUT_HTML" false)
(lib.cmakeBool "SPHINX_WARNINGS_AS_ERRORS" false)
]
# TODO: Clean up on `staging`.
++ [
# Added in LLVM15:
# `clang-tidy-confusable-chars-gen`: https://github.com/llvm/llvm-project/commit/c3574ef739fbfcc59d405985a3a4fa6f4619ecdb
# `clang-pseudo-gen`: https://github.com/llvm/llvm-project/commit/cd2292ef824591cc34cc299910a3098545c840c7
(lib.cmakeFeature "CLANG_TIDY_CONFUSABLE_CHARS_GEN" "${buildLlvmTools.tblgen}/bin/clang-tidy-confusable-chars-gen")
]
++ lib.optionals (lib.versionOlder release_version "20") [
# clang-pseudo removed in LLVM20: https://github.com/llvm/llvm-project/commit/ed8f78827895050442f544edef2933a60d4a7935
(lib.cmakeFeature "CLANG_PSEUDO_GEN" "${buildLlvmTools.tblgen}/bin/clang-pseudo-gen")
]
++ lib.optional (lib.versionAtLeast release_version "20") (
lib.cmakeFeature "LLVM_DIR" "${libllvm.dev}/lib/cmake/llvm"
)
++ devExtraCmakeFlags;

postPatch = ''
Expand Down Expand Up @@ -173,20 +164,13 @@ stdenv.mkDerivation (
patchShebangs $python/bin

mkdir -p $dev/bin
''
# TODO(@LunNova): Clean up this rebuild avoidance in staging
+ lib.optionalString enableClangToolsExtra (
if lib.versionOlder release_version "20" then
''
cp bin/{clang-tblgen,clang-tidy-confusable-chars-gen,clang-pseudo-gen} $dev/bin
''
else
''
cp bin/{clang-tblgen,clang-tidy-confusable-chars-gen} $dev/bin
''
)
+ lib.optionalString (!enableClangToolsExtra) ''
cp bin/clang-tblgen $dev/bin
''
+ lib.optionalString enableClangToolsExtra ''
cp bin/clang-tidy-confusable-chars-gen $dev/bin
''
+ lib.optionalString (enableClangToolsExtra && lib.versionOlder release_version "20") ''
cp bin/clang-pseudo-gen $dev/bin
'';

env =
Expand Down
20 changes: 8 additions & 12 deletions pkgs/development/compilers/llvm/common/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -374,18 +374,14 @@ let

# This is an "oddly ordered" bootstrap just for Darwin. Probably
# don't want it otherwise.
clangNoCompilerRtWithLibc =
wrapCCWith rec {
cc = tools.clang-unwrapped;
libcxx = null;
bintools = bintools';
extraPackages = [ ];
extraBuildCommands = mkExtraBuildCommands0 cc;
}
# FIXME: This should be inside the `wrapCCWith` call.
// lib.optionalAttrs stdenv.targetPlatform.isWasm {
nixSupport.cc-cflags = [ "-fno-exceptions" ];
};
clangNoCompilerRtWithLibc = wrapCCWith rec {
cc = tools.clang-unwrapped;
libcxx = null;
bintools = bintools';
extraPackages = [ ];
extraBuildCommands = mkExtraBuildCommands0 cc;
nixSupport.cc-cflags = lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
};

# Aliases
clangNoCompilerRt = tools.clangNoLibcNoRt;
Expand Down
3 changes: 0 additions & 3 deletions pkgs/development/compilers/llvm/common/libcxx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,6 @@ stdenv.mkDerivation (finalAttrs: {
patchShebangs utils/cat_files.py
'';

# TODO: Remove on `staging`.
patches = [ ];

nativeBuildInputs = [
cmake
ninja
Expand Down
7 changes: 0 additions & 7 deletions pkgs/development/compilers/llvm/common/libunwind/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ stdenv.mkDerivation (finalAttrs: {

inherit version;

# TODO: Remove on `staging`.
patches = [ ];

src =
if monorepoSrc != null then
runCommand "libunwind-src-${version}" { inherit (monorepoSrc) passthru; } ''
Expand Down Expand Up @@ -60,10 +57,6 @@ stdenv.mkDerivation (finalAttrs: {
]
++ devExtraCmakeFlags;

# TODO: Remove on `staging`.
prePatch = "";
postPatch = "";

postInstall =
lib.optionalString (enableShared && !stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isWindows)
''
Expand Down
3 changes: 0 additions & 3 deletions pkgs/development/compilers/llvm/common/lld/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ stdenv.mkDerivation (finalAttrs: {
]
++ devExtraCmakeFlags;

# TODO: Remove on `staging`.
postPatch = "";

# Musl's default stack size is too small for lld to be able to link Firefox.
LDFLAGS = lib.optionalString stdenv.hostPlatform.isMusl "-Wl,-z,stack-size=2097152";

Expand Down
13 changes: 2 additions & 11 deletions pkgs/development/compilers/llvm/common/lldb/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ stdenv.mkDerivation (

nativeBuildInputs = [
cmake
ninja
python3
which
swig
Expand All @@ -84,10 +85,6 @@ stdenv.mkDerivation (
++ lib.optionals enableManpages [
python3.pkgs.sphinx
python3.pkgs.myst-parser
]
# TODO: Clean up on `staging`.
++ [
ninja
];

buildInputs = [
Expand All @@ -112,17 +109,14 @@ stdenv.mkDerivation (
(lib.cmakeBool "LLVM_ENABLE_RTTI" false)
(lib.cmakeFeature "Clang_DIR" "${lib.getDev libclang}/lib/cmake")
(lib.cmakeFeature "LLVM_EXTERNAL_LIT" "${lit}/bin/lit")
(lib.cmakeFeature "CLANG_RESOURCE_DIR" "../../../../${lib.getLib libclang}")
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
(lib.cmakeBool "LLDB_USE_SYSTEM_DEBUGSERVER" true)
]
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
(lib.cmakeFeature "LLDB_CODESIGN_IDENTITY" "") # codesigning makes nondeterministic
]
# TODO: Clean up on `staging`.
++ [
(lib.cmakeFeature "CLANG_RESOURCE_DIR" "../../../../${lib.getLib libclang}")
]
++ lib.optionals enableManpages [
(lib.cmakeBool "LLVM_ENABLE_SPHINX" true)
(lib.cmakeBool "SPHINX_OUTPUT_MAN" true)
Expand Down Expand Up @@ -184,9 +178,6 @@ stdenv.mkDerivation (
// lib.optionalAttrs enableManpages {
pname = "lldb-manpages";

# TODO: Remove on `staging`.
buildPhase = "";

ninjaFlags = [ "docs-lldb-man" ];

propagatedBuildInputs = [ ];
Expand Down
3 changes: 0 additions & 3 deletions pkgs/development/compilers/llvm/common/llvm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ stdenv.mkDerivation (
pname = "llvm";
inherit version;

# TODO: Remove on `staging`.
shortVersion = lib.concatStringsSep "." (lib.take 1 (lib.splitString "." release_version));

src =
if monorepoSrc != null then
runCommand "llvm-src-${version}" { inherit (monorepoSrc) passthru; } (
Expand Down
3 changes: 0 additions & 3 deletions pkgs/development/compilers/llvm/common/openmp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ stdenv.mkDerivation (finalAttrs: {
"dev"
];

# TODO: Remove on `staging`.
patchFlags = null;

patches =
lib.optional (lib.versionOlder release_version "19") (getVersionFile "openmp/fix-find-tool.patch")
++ [
Expand Down
Loading