summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--src/compilers/clang-16-native.TARGETS12
-rw-r--r--src/compilers/clang-17-native.TARGETS12
-rw-r--r--src/compilers/clang-18-native.TARGETS52
-rw-r--r--src/compilers/clang-19-native.TARGETS52
-rw-r--r--src/compilers/clang-20-native.TARGETS47
6 files changed, 160 insertions, 17 deletions
diff --git a/README.md b/README.md
index 9a33264..5124a71 100644
--- a/README.md
+++ b/README.md
@@ -195,6 +195,8 @@ Fields for building the toolchains:
`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).
+- `INCLUDE_LLD`:
+ For `clang` toolchains, add the LLD linker to toolchain. (default: `false`)
Fields for using the toolchains
(within [Justbuild](https://github.com/just-buildsystem/justbuild) projects):
diff --git a/src/compilers/clang-16-native.TARGETS b/src/compilers/clang-16-native.TARGETS
index e19e4de..0cf9e65 100644
--- a/src/compilers/clang-16-native.TARGETS
+++ b/src/compilers/clang-16-native.TARGETS
@@ -170,6 +170,18 @@
}
, "then": ["clang-tools-extra"]
}
+ , { "type": "if"
+ , "cond":
+ { "type": "lookup"
+ , "key": "INCLUDE_LLD"
+ , "map":
+ { "type": "var"
+ , "name": "TOOLCHAIN_CONFIG"
+ , "default": {"type": "empty_map"}
+ }
+ }
+ , "then": ["lld"]
+ }
]
}
}
diff --git a/src/compilers/clang-17-native.TARGETS b/src/compilers/clang-17-native.TARGETS
index 78b2bd4..3f0837f 100644
--- a/src/compilers/clang-17-native.TARGETS
+++ b/src/compilers/clang-17-native.TARGETS
@@ -170,6 +170,18 @@
}
, "then": ["clang-tools-extra"]
}
+ , { "type": "if"
+ , "cond":
+ { "type": "lookup"
+ , "key": "INCLUDE_LLD"
+ , "map":
+ { "type": "var"
+ , "name": "TOOLCHAIN_CONFIG"
+ , "default": {"type": "empty_map"}
+ }
+ }
+ , "then": ["lld"]
+ }
]
}
}
diff --git a/src/compilers/clang-18-native.TARGETS b/src/compilers/clang-18-native.TARGETS
index 3a75343..4860702 100644
--- a/src/compilers/clang-18-native.TARGETS
+++ b/src/compilers/clang-18-native.TARGETS
@@ -65,10 +65,7 @@
{ "type": ["@", "rules", "CC/foreign/shell", "data"]
, "arguments_config": ["TOOLCHAIN_CONFIG"]
, "project": ["patched_sources"]
- , "localbase":
- [ "binutils_dir"
- , ["@", "iwyu", "", "sources"]
- ]
+ , "localbase": ["binutils_dir", ["@", "iwyu", "", "sources"]]
, "cmds":
[ { "type": "join"
, "$1":
@@ -154,6 +151,48 @@
, "-DLLVM_INCLUDE_DOCS=OFF"
, "-DLLVM_INCLUDE_TESTS=OFF"
, "-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON"
+ , { "type": "join"
+ , "$1":
+ [ "-DLLVM_ENABLE_PROJECTS="
+ , { "type": "join_cmd"
+ , "$1":
+ [ { "type": "join"
+ , "separator": ";"
+ , "$1":
+ { "type": "++"
+ , "$1":
+ [ ["clang"]
+ , { "type": "if"
+ , "cond":
+ { "type": "lookup"
+ , "key": "INCLUDE_LINTER"
+ , "map":
+ { "type": "var"
+ , "name": "TOOLCHAIN_CONFIG"
+ , "default": {"type": "empty_map"}
+ }
+ }
+ , "then": ["clang-tools-extra"]
+ }
+ , { "type": "if"
+ , "cond":
+ { "type": "lookup"
+ , "key": "INCLUDE_LLD"
+ , "map":
+ { "type": "var"
+ , "name": "TOOLCHAIN_CONFIG"
+ , "default": {"type": "empty_map"}
+ }
+ }
+ , "then": ["lld"]
+ }
+ ]
+ }
+ }
+ ]
+ }
+ ]
+ }
, { "type": "if"
, "cond":
{ "type": "lookup"
@@ -168,12 +207,11 @@
{ "type": "join"
, "separator": " "
, "$1":
- [ "-DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra'"
- , "-DLLVM_EXTERNAL_PROJECTS=iwyu"
+ [ "-DLLVM_EXTERNAL_PROJECTS=iwyu"
, "-DLLVM_EXTERNAL_IWYU_SOURCE_DIR=${LOCALBASE}/iwyu"
]
}
- , "else": "-DLLVM_ENABLE_PROJECTS=clang"
+ , "else": ""
}
, "-DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind'"
, "-DLLVM_TARGETS_TO_BUILD=X86"
diff --git a/src/compilers/clang-19-native.TARGETS b/src/compilers/clang-19-native.TARGETS
index 6ab96c3..652d329 100644
--- a/src/compilers/clang-19-native.TARGETS
+++ b/src/compilers/clang-19-native.TARGETS
@@ -65,10 +65,7 @@
{ "type": ["@", "rules", "CC/foreign/shell", "data"]
, "arguments_config": ["TOOLCHAIN_CONFIG"]
, "project": ["patched_sources"]
- , "localbase":
- [ "binutils_dir"
- , ["@", "iwyu", "", "sources"]
- ]
+ , "localbase": ["binutils_dir", ["@", "iwyu", "", "sources"]]
, "cmds":
[ { "type": "join"
, "$1":
@@ -154,6 +151,48 @@
, "-DLLVM_INCLUDE_DOCS=OFF"
, "-DLLVM_INCLUDE_TESTS=OFF"
, "-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON"
+ , { "type": "join"
+ , "$1":
+ [ "-DLLVM_ENABLE_PROJECTS="
+ , { "type": "join_cmd"
+ , "$1":
+ [ { "type": "join"
+ , "separator": ";"
+ , "$1":
+ { "type": "++"
+ , "$1":
+ [ ["clang"]
+ , { "type": "if"
+ , "cond":
+ { "type": "lookup"
+ , "key": "INCLUDE_LINTER"
+ , "map":
+ { "type": "var"
+ , "name": "TOOLCHAIN_CONFIG"
+ , "default": {"type": "empty_map"}
+ }
+ }
+ , "then": ["clang-tools-extra"]
+ }
+ , { "type": "if"
+ , "cond":
+ { "type": "lookup"
+ , "key": "INCLUDE_LLD"
+ , "map":
+ { "type": "var"
+ , "name": "TOOLCHAIN_CONFIG"
+ , "default": {"type": "empty_map"}
+ }
+ }
+ , "then": ["lld"]
+ }
+ ]
+ }
+ }
+ ]
+ }
+ ]
+ }
, { "type": "if"
, "cond":
{ "type": "lookup"
@@ -168,12 +207,11 @@
{ "type": "join"
, "separator": " "
, "$1":
- [ "-DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra'"
- , "-DLLVM_EXTERNAL_PROJECTS=iwyu"
+ [ "-DLLVM_EXTERNAL_PROJECTS=iwyu"
, "-DLLVM_EXTERNAL_IWYU_SOURCE_DIR=${LOCALBASE}/iwyu"
]
}
- , "else": "-DLLVM_ENABLE_PROJECTS=clang"
+ , "else": ""
}
, "-DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind'"
, "-DLLVM_TARGETS_TO_BUILD=X86"
diff --git a/src/compilers/clang-20-native.TARGETS b/src/compilers/clang-20-native.TARGETS
index 047f7c8..f7c6c3c 100644
--- a/src/compilers/clang-20-native.TARGETS
+++ b/src/compilers/clang-20-native.TARGETS
@@ -151,6 +151,48 @@
, "-DLLVM_INCLUDE_DOCS=OFF"
, "-DLLVM_INCLUDE_TESTS=OFF"
, "-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON"
+ , { "type": "join"
+ , "$1":
+ [ "-DLLVM_ENABLE_PROJECTS="
+ , { "type": "join_cmd"
+ , "$1":
+ [ { "type": "join"
+ , "separator": ";"
+ , "$1":
+ { "type": "++"
+ , "$1":
+ [ ["clang"]
+ , { "type": "if"
+ , "cond":
+ { "type": "lookup"
+ , "key": "INCLUDE_LINTER"
+ , "map":
+ { "type": "var"
+ , "name": "TOOLCHAIN_CONFIG"
+ , "default": {"type": "empty_map"}
+ }
+ }
+ , "then": ["clang-tools-extra"]
+ }
+ , { "type": "if"
+ , "cond":
+ { "type": "lookup"
+ , "key": "INCLUDE_LLD"
+ , "map":
+ { "type": "var"
+ , "name": "TOOLCHAIN_CONFIG"
+ , "default": {"type": "empty_map"}
+ }
+ }
+ , "then": ["lld"]
+ }
+ ]
+ }
+ }
+ ]
+ }
+ ]
+ }
, { "type": "if"
, "cond":
{ "type": "lookup"
@@ -165,12 +207,11 @@
{ "type": "join"
, "separator": " "
, "$1":
- [ "-DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra'"
- , "-DLLVM_EXTERNAL_PROJECTS=iwyu"
+ [ "-DLLVM_EXTERNAL_PROJECTS=iwyu"
, "-DLLVM_EXTERNAL_IWYU_SOURCE_DIR=${LOCALBASE}/iwyu"
]
}
- , "else": "-DLLVM_ENABLE_PROJECTS=clang"
+ , "else": ""
}
, "-DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind'"
, "-DLLVM_TARGETS_TO_BUILD=X86"