From 1776adcc58174d1d3306af14e32c5131dc2efee5 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Mon, 8 Dec 2025 03:28:03 -0500 Subject: [PATCH] Compile clang in llvm21 --- config/x86_64/ci.toml | 2 +- recipes/dev/llvm21/recipe.toml | 58 ++++++++++++++++++++++++++++++---- 2 files changed, 53 insertions(+), 7 deletions(-) diff --git a/config/x86_64/ci.toml b/config/x86_64/ci.toml index 45a79ac83..1e904f18e 100644 --- a/config/x86_64/ci.toml +++ b/config/x86_64/ci.toml @@ -116,7 +116,7 @@ libwebp = {} libxkbcommon = {} libuuid = {} libxml2 = {} -llvm18 = {} +llvm21 = {} lsd = {} lua54 = {} lz4 = {} diff --git a/recipes/dev/llvm21/recipe.toml b/recipes/dev/llvm21/recipe.toml index 3ef79ecd2..ddd1b793a 100644 --- a/recipes/dev/llvm21/recipe.toml +++ b/recipes/dev/llvm21/recipe.toml @@ -11,8 +11,9 @@ dependencies = [ "libxml2", ] dev-dependencies = [ + "libstdcxx", "host:xz", - "host:libarchive", + "host:libarchive", # workaround for cmake error ] script = """ DYNAMIC_INIT @@ -39,8 +40,9 @@ COOKBOOK_CMAKE_FLAGS+=( -DLLVM_TOOL_LLVM_PROFDATA_BUILD=On -DLLVM_TOOLS_INSTALL_DIR=bin -DLLVM_UTILS_INSTALL_DIR=bin + -DLIBCLANG_BUILD_STATIC=On -DUNIX=1 - -DLLVM_ENABLE_PROJECTS="llvm" + -DLLVM_ENABLE_PROJECTS="llvm;clang;clang-tools-extra;lld" ) # Native tablegen build fails with too many jobs, limit to 16 @@ -49,17 +51,61 @@ COOKBOOK_SOURCE="$COOKBOOK_SOURCE/llvm" cookbook_cmake """ +# clang library and runtime [[optional-packages]] -name = "dev" +name = "clang" dependencies = [ ".runtime" ] files = [ - "usr/include/**", - "usr/lib/*.a", - "usr/lib/cmake/**", + "usr/bin/clang*", + "usr/libexec/**", + "usr/lib/libclang-cpp.so*", + "usr/lib/libclang.so*", + "usr/lib/clang/**", + "usr/lib/libear/**", + "usr/lib/libscanbuild/**", + "usr/share/clang*/**", ] +# lld runtime (no library) +[[optional-packages]] +name = "lld" +dependencies = [ ".runtime" ] +files = [ + "usr/bin/*.lld", + "usr/bin/*-ld", + "usr/bin/lld*", +] + +# llvm runtime [[optional-packages]] name = "runtime" files = [ "usr/bin/**", ] + +[[optional-packages]] +name = "clang-dev" +dependencies = [ ".clang" ] +files = [ + "usr/include/clang*/**", + "usr/lib/libclang*.a", + "usr/lib/cmake/clang/**", +] + +[[optional-packages]] +name = "lld-dev" +dependencies = [ ".lld" ] +files = [ + "usr/include/lld*/**", + "usr/lib/liblld*.a", + "usr/lib/cmake/lld/**", +] + +[[optional-packages]] +name = "dev" +dependencies = [ ".runtime" ] +files = [ + "usr/include/llvm*/**", + "usr/lib/libLLVM*.a", + "usr/lib/cmake/llvm/**", +]