summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2025-06-10 11:05:20 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2025-06-12 15:12:01 +0200
commit172c29862c2bad21fff84e2798cc3fd16822ec57 (patch)
tree7c93ee4a8dfc279322862dd74ad106628ce5b813
parent93720597f80740ec1121140e7f84401b766d70ab (diff)
downloadbootstrappable-toolchain-172c29862c2bad21fff84e2798cc3fd16822ec57.tar.gz
Add IWYU support to clang 20 toolchain
-rw-r--r--README.md2
-rw-r--r--etc/repos.json12
-rw-r--r--src/compilers/clang-20-native.TARGETS12
3 files changed, 23 insertions, 3 deletions
diff --git a/README.md b/README.md
index 64a1614..9a33264 100644
--- a/README.md
+++ b/README.md
@@ -192,7 +192,7 @@ Fields for building the toolchains:
- `INCLUDE_LINTER`:
Add linter to toolchain if supported. (default: `false`)
Currently this option is only supported by `clang` toolchains, adding
- `clang-tidy`. Additionally, Clang versions `18` and `19` will also include
+ `clang-tidy`. Additionally, Clang versions `18` and newer will also include
the *external project*
[Include What You Use](https://github.com/include-what-you-use/include-what-you-use).
diff --git a/etc/repos.json b/etc/repos.json
index c77def8..3aab324 100644
--- a/etc/repos.json
+++ b/etc/repos.json
@@ -525,6 +525,7 @@
{ "rules": "rules/clang_with_gcc14"
, "binutils": "imports/binutils-latest"
, "patches": "patches"
+ , "iwyu": "iwyu-20"
}
}
, "tools/busybox-1.36.1":
@@ -904,6 +905,17 @@
, "target_file_name": "iwyu.TARGETS"
, "target_root": "imports"
}
+ , "iwyu-20":
+ { "repository":
+ { "type": "archive"
+ , "content": "7fc1e96d2aaab23daa3783c82a9214db4dbb3c52"
+ , "fetch": "https://github.com/include-what-you-use/include-what-you-use/archive/refs/tags/0.24.tar.gz"
+ , "sha256": "897b4c864a983f493c8efef4a1a9a2d429fd7ead1011f7a41743ed7b6dbe8c2e"
+ , "subdir": "include-what-you-use-0.24"
+ }
+ , "target_file_name": "iwyu.TARGETS"
+ , "target_root": "imports"
+ }
, "patches/busybox-1593":
{ "repository":
{ "type": "foreign file"
diff --git a/src/compilers/clang-20-native.TARGETS b/src/compilers/clang-20-native.TARGETS
index 838106c..047f7c8 100644
--- a/src/compilers/clang-20-native.TARGETS
+++ b/src/compilers/clang-20-native.TARGETS
@@ -65,7 +65,7 @@
{ "type": ["@", "rules", "CC/foreign/shell", "data"]
, "arguments_config": ["TOOLCHAIN_CONFIG"]
, "project": ["patched_sources"]
- , "localbase": ["binutils_dir"]
+ , "localbase": ["binutils_dir", ["@", "iwyu", "", "sources"]]
, "cmds":
[ { "type": "join"
, "$1":
@@ -161,7 +161,15 @@
, "default": {"type": "empty_map"}
}
}
- , "then": "-DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra'"
+ , "then":
+ { "type": "join"
+ , "separator": " "
+ , "$1":
+ [ "-DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra'"
+ , "-DLLVM_EXTERNAL_PROJECTS=iwyu"
+ , "-DLLVM_EXTERNAL_IWYU_SOURCE_DIR=${LOCALBASE}/iwyu"
+ ]
+ }
, "else": "-DLLVM_ENABLE_PROJECTS=clang"
}
, "-DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind'"