Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile rustc for wasm15 dev keep #7

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
2e5cd07
patch
oligamiq Sep 1, 2024
628b88d
patch
oligamiq Sep 1, 2024
792ff51
patch
oligamiq Sep 2, 2024
380fd5d
test
oligamiq Sep 2, 2024
47b19ed
save
oligamiq Sep 2, 2024
f160775
test
oligamiq Sep 2, 2024
5d97278
save
oligamiq Sep 2, 2024
35e64bb
save
oligamiq Sep 2, 2024
042d7c9
patch
oligamiq Sep 2, 2024
3a005cc
test
oligamiq Sep 3, 2024
c37b856
add
oligamiq Sep 3, 2024
311fff4
patch
oligamiq Sep 3, 2024
626cf58
patch
oligamiq Sep 3, 2024
1d56a96
patch
oligamiq Sep 3, 2024
b0af63e
test
oligamiq Sep 3, 2024
3d295c0
test
oligamiq Sep 3, 2024
4836741
test
oligamiq Sep 3, 2024
27c05ea
rm
oligamiq Sep 3, 2024
2e140e4
save
oligamiq Sep 4, 2024
f2db387
save
oligamiq Sep 4, 2024
b2f8b18
save
oligamiq Sep 4, 2024
acd4399
save
oligamiq Sep 4, 2024
a01d329
save
oligamiq Sep 4, 2024
85905e3
save
oligamiq Sep 4, 2024
7d67e83
save
oligamiq Sep 4, 2024
edff917
save
oligamiq Sep 4, 2024
86f8a1b
save
oligamiq Sep 4, 2024
ff0ba6e
save
oligamiq Sep 4, 2024
d379359
save
oligamiq Sep 4, 2024
35899b5
save
oligamiq Sep 4, 2024
5f3a142
save
oligamiq Sep 4, 2024
86b25e4
save
oligamiq Sep 4, 2024
40193e7
save
oligamiq Sep 4, 2024
4dec1b7
save
oligamiq Sep 4, 2024
9b2ee34
save
oligamiq Sep 4, 2024
60aafa0
save
oligamiq Sep 4, 2024
4629fb6
save
oligamiq Sep 4, 2024
32d92ca
save
oligamiq Sep 4, 2024
fb77332
save
oligamiq Sep 4, 2024
5aa8fdd
save
oligamiq Sep 4, 2024
baf715a
save
oligamiq Sep 4, 2024
9133e93
save
oligamiq Sep 4, 2024
333f563
save
oligamiq Sep 4, 2024
d7453b2
save
oligamiq Sep 4, 2024
c0e6fa9
save
oligamiq Sep 4, 2024
aec8f41
rm
oligamiq Sep 4, 2024
c22e057
add
oligamiq Sep 4, 2024
ec4bf32
update
oligamiq Sep 4, 2024
72f5ae4
Revert "add"
oligamiq Sep 4, 2024
0b70f6f
add
oligamiq Sep 4, 2024
22ee732
rm
oligamiq Sep 4, 2024
7df2bf0
save
oligamiq Sep 4, 2024
4aceac8
save
oligamiq Sep 4, 2024
0585aa7
save
oligamiq Sep 4, 2024
b883e73
add
oligamiq Sep 4, 2024
38ce5e6
add
oligamiq Sep 4, 2024
e45eff3
save
oligamiq Sep 4, 2024
651485f
add
oligamiq Sep 4, 2024
f7d383b
add
oligamiq Sep 4, 2024
5f84137
add
oligamiq Sep 4, 2024
4bda74b
save
oligamiq Sep 5, 2024
ed43d24
add
oligamiq Sep 5, 2024
ac5e4e3
#
oligamiq Sep 5, 2024
602cb9f
#
oligamiq Sep 5, 2024
d2e45ee
j
oligamiq Sep 5, 2024
ce197c1
add
oligamiq Sep 5, 2024
fe546f0
patch
oligamiq Sep 5, 2024
f48527b
patch
oligamiq Sep 5, 2024
857384a
patch
oligamiq Sep 5, 2024
8f3e918
add flag
oligamiq Sep 6, 2024
0861030
patch
oligamiq Sep 6, 2024
9ca0a26
patch
oligamiq Sep 6, 2024
af5e05b
save
oligamiq Sep 7, 2024
d35f740
save
oligamiq Sep 7, 2024
9c854f2
error LLVM compiled without support for threads
oligamiq Sep 7, 2024
c8f06b1
save
oligamiq Sep 7, 2024
28e3fa0
save
oligamiq Sep 7, 2024
2b258a0
save
oligamiq Sep 7, 2024
f59cd61
save
oligamiq Sep 7, 2024
bacd78f
save
oligamiq Sep 7, 2024
6657e13
reset
oligamiq Sep 8, 2024
91eb23e
save
oligamiq Sep 8, 2024
bfa8d93
save
oligamiq Sep 8, 2024
52439aa
update
oligamiq Sep 8, 2024
7f42b14
update
oligamiq Sep 8, 2024
8dc5097
save
oligamiq Sep 8, 2024
f164050
Update comment.txt
oligamiq Sep 21, 2024
affc3dc
Update installation instructions, remove unused linker flag, and dele…
oligamiq Sep 22, 2024
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
10 changes: 5 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@
path = src/doc/edition-guide
url = https://github.com/rust-lang/edition-guide.git
shallow = true
[submodule "src/llvm-project"]
path = src/llvm-project
url = https://github.com/rust-lang/llvm-project.git
branch = rustc/18.0-2024-02-13
shallow = true
[submodule "src/doc/embedded-book"]
path = src/doc/embedded-book
url = https://github.com/rust-embedded/book.git
Expand All @@ -43,3 +38,8 @@
path = library/backtrace
url = https://github.com/rust-lang/backtrace-rs.git
shallow = true
[submodule "src/llvm-project"]
path = src/llvm-project
url = https://github.com/YoWASP/llvm-project
branch = main+wasm
shallow = true
7 changes: 5 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -475,9 +475,12 @@ version = "0.1.0"

[[package]]
name = "cc"
version = "1.0.90"
version = "1.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5"
checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6"
dependencies = [
"shlex",
]

[[package]]
name = "cfg-if"
Expand Down
26 changes: 24 additions & 2 deletions comment.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Got a new version up. This time all logic to handle using different codegen back

* Make sure you are running on Linux.
* Clone https://github.com/bjorn3/rust
* Checkout the `compile_rustc_for_wasm10` branch
* Download and extract https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz into the rust checkout.
* Checkout the `compile_rustc_for_wasm15` branch
* Download and extract https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-22/wasi-sdk-22.0-linux.tar.gz into the rust checkout.
* Run `./x.py install` to build the compiler and install it into the dist dir.
* Use `wasmtime run --dir tmp::/ --dir dist dist/bin/rustc.wasm --sysroot dist --target x86_64-unknown-linux-gnu` to run rustc.

Expand All @@ -16,3 +16,25 @@ $ gcc -fuse-ld=lld tmp/rmeta*/lib.rmeta tmp/rust_out.* dist/lib/rustlib/x86_64-u
$ ./rust_out
Hello World!
```

use LLVM
Install example:
WASI_SDK_PATH=`pwd`/wasi-sdk-22.0 WASI_SYSROOT=`pwd`/wasi-sdk-22.0/share/wasi-sysroot WASI_CLANG_WRAPPER_LINKER="`pwd`/wrapper_linker_clang++.sh" ./x.py install

If you just want to run it, https://github.com/oligamiq/rust_wasm/tree/main/rustc_llvm
```
$ mkdir tmp
$ echo 'fn main() { println!("Hello World!"); }' | wasmtime run -Sthreads=y -Spreview2=n --dir tmp::/ --dir dist --env RUST_MIN_STACK=16777216 dist/bin/rustc.wasm - --sysroot dist --target wasm32-wasip1-threads -Csave-temps
$ gcc -fuse-ld=lld tmp/rmeta*/lib.rmeta tmp/rust_out.*.o dist/lib/rustlib/x86_64-unknown-linux-gnu/lib/lib*.rlib -o rust_out
$ ./rust_out
Hello World!
```

to Wasi
```
$ mkdir tmp
$ echo 'fn main() { println!("Hello World!"); }' | wasmtime run -Sthreads=y -Spreview2=n --dir tmp::/ --dir dist --env RUST_MIN_STACK=16777216 dist/bin/rustc.wasm - --sysroot dist --target wasm32-wasip1-threads -Csave-temps
$ wasi-sdk-22.0/bin/wasm-ld --shared-memory --max-memory=1073741824 --import-memory --export __main_void -z stack-size=1048576 --stack-first --allow-undefined --no-demangle --import-memory --export-memory --shared-memory dist/lib/rustlib/wasm32-wasip1-threads/lib/self-contained/crt1-command.o tmp/rust_out.*.o dist/lib/rustlib/wasm32-wasip1-threads/lib/lib*.rlib -L dist/lib/rustlib/wasm32-wasip1-threads/lib/self-contained -lc -o rust_out.wasm
$ wasmtime run -Sthreads=y rust_out.wasm
Hello World!
```
4 changes: 2 additions & 2 deletions compiler/rustc_fs_util/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![feature(absolute_path)]

#[cfg(any(unix, windows))]
#[cfg(any(unix, windows, target_os = "wasi"))]
use std::ffi::CString;
use std::fs;
use std::io;
Expand Down Expand Up @@ -87,7 +87,7 @@ pub fn path_to_c_string(p: &Path) -> CString {
let p: &OsStr = p.as_ref();
CString::new(p.as_bytes()).unwrap()
}
#[cfg(windows)]
#[cfg(any(windows, target_os = "wasi"))]
pub fn path_to_c_string(p: &Path) -> CString {
CString::new(p.to_str().unwrap()).unwrap()
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_llvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ libc = "0.2.73"

[build-dependencies]
# tidy-alphabetical-start
cc = "1.0.90"
cc = "1.1.15"
# tidy-alphabetical-end
14 changes: 14 additions & 0 deletions compiler/rustc_llvm/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ fn output(cmd: &mut Command) -> String {
}

fn main() {
if env::var("TARGET").expect("TARGET was not set").contains("wasi") {
std::env::var("WASI_SYSROOT").expect("WASI_SYSROOT not set");
}

for component in REQUIRED_COMPONENTS.iter().chain(OPTIONAL_COMPONENTS.iter()) {
println!("cargo:rustc-check-cfg=cfg(llvm_component,values(\"{component}\"))");
}
Expand Down Expand Up @@ -201,6 +205,16 @@ fn main() {
cfg.debug(false);
}


if target.contains("wasi") {
// ref src/bootstrap/src/core/build_steps/llvm.rs

let wasi_sysroot = env::var("WASI_SYSROOT").expect("WASI_SYSROOT not set");
cfg.compiler(format!("{wasi_sysroot}/../../bin/{target}-clang++"));
cfg.flag("-pthread");
cfg.flag("-D_WASI_EMULATED_MMAN");
}

rerun_if_changed_anything_in_dir(Path::new("llvm-wrapper"));
cfg.file("llvm-wrapper/PassWrapper.cpp")
.file("llvm-wrapper/RustWrapper.cpp")
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_target/src/target_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,9 @@ const X86_ALLOWED_FEATURES: &[(&str, Stability)] = &[
("avx512bw", Unstable(sym::avx512_target_feature)),
("avx512cd", Unstable(sym::avx512_target_feature)),
("avx512dq", Unstable(sym::avx512_target_feature)),
("avx512er", Unstable(sym::avx512_target_feature)),
("avx512f", Unstable(sym::avx512_target_feature)),
("avx512fp16", Unstable(sym::avx512_target_feature)),
("avx512ifma", Unstable(sym::avx512_target_feature)),
("avx512pf", Unstable(sym::avx512_target_feature)),
("avx512vbmi", Unstable(sym::avx512_target_feature)),
("avx512vbmi2", Unstable(sym::avx512_target_feature)),
("avx512vl", Unstable(sym::avx512_target_feature)),
Expand Down
41 changes: 41 additions & 0 deletions config.llvm.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Includes one of the default files in src/bootstrap/defaults
profile = "compiler"
change-id = 9999999

[rust]
codegen-backends = ["llvm"]
deny-warnings = false
llvm-bitcode-linker = false

[llvm]
cflags = "-march=native"
cxxflags = "-march=native"
static-libstdcpp = true
ninja = false
download-ci-llvm = false
link-shared = false
# thin-lto = true

[build]
docs = false
extended = false
tools = []
# host = ["wasm32-wasip1-threads", "x86_64-unknown-linux-gnu"]
host = ["wasm32-wasip1-threads"]
target = ["x86_64-unknown-linux-gnu", "wasm32-wasip1-threads"]
# target = ["wasm32-wasip1-threads"]
cargo-native-static = true

[install]
prefix = "dist"
sysconfdir = "etc"

[target.'wasm32-wasip1-threads']
wasi-root = "wasi-sdk-22.0/share/wasi-sysroot"
# linker = "wasi-sdk-22.0/bin/wasm-ld"
linker = "./wrapper_linker_clang.sh"
# codegen-backends = ["cranelift"]
codegen-backends = ["llvm"]

[target.'x86_64-unknown-linux-gnu']
cc = "gcc"
8 changes: 4 additions & 4 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ prefix = "dist"
sysconfdir = "etc"

[target.'wasm32-wasi']
wasi-root = "wasi-sdk-20.0/share/wasi-sysroot"
linker = "wasi-sdk-20.0/bin/clang"
wasi-root = "wasi-sdk-22.0/share/wasi-sysroot"
linker = "wasi-sdk-22.0/bin/clang"
codegen-backends = ["cranelift"]

[target.'wasm32-wasip1-threads']
wasi-root = "wasi-sdk-20.0/share/wasi-sysroot"
linker = "wasi-sdk-20.0/bin/clang"
wasi-root = "wasi-sdk-22.0/share/wasi-sysroot"
linker = "wasi-sdk-22.0/bin/clang"
codegen-backends = ["cranelift"]

[target.'x86_64-unknown-linux-gnu']
Expand Down
172 changes: 172 additions & 0 deletions src/bootstrap/src/core/build_steps/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,178 @@ impl Step for Llvm {
return res;
}

if target.contains("wasi") {
let wasi_sysroot = env::var("WASI_SYSROOT").expect("WASI_SYSROOT not set");
let wasi_sdk_path = std::path::Path::new(&wasi_sysroot).join("../../").canonicalize().expect("invalid WASI_SYSROOT");
let wasi_sysroot = format!("--sysroot={wasi_sysroot}");
let wasi_sdk_path = wasi_sdk_path.to_str().expect("invalid WASI_SYSROOT");
let wasi_target = target.triple.to_string();
let wasi_cflags = String::from("");
let wasi_ldflags = String::from("");
let wasi_target_llvm = target.triple.to_string();
let wasi_cflags_llvm = format!("{wasi_cflags} -pthread");
let wasi_ldflags_llvm = wasi_ldflags;
// LLVM has some (unreachable in our configuration) calls to mmap.
let wasi_cflags_llvm = format!("{wasi_cflags_llvm} -D_WASI_EMULATED_MMAN");
let wasi_ldflags_llvm = format!("{wasi_ldflags_llvm} -lwasi-emulated-mman");
// Depending on the code being compiled, both Clang and LLD can consume unbounded amounts of memory.
let wasi_ldflags_llvm = format!("{wasi_ldflags_llvm} -Wl,--max-memory=4294967296");
// Compiling C++ code requires a lot of stack space and can overflow and corrupt the heap.
// (For example, `#include <iostream>` alone does it in a build with the default stack size.)
let wasi_ldflags_llvm = format!("{wasi_ldflags_llvm} -Wl,-z,stack-size=1048576 -Wl,--stack-first");
// Some of the host APIs that are statically required by LLVM (notably threading) are dynamically
// never used. An LTO build removes imports of these APIs, simplifying deployment
let wasi_cflags_llvm = format!("{wasi_cflags_llvm} -flto");
let wasi_ldflags_llvm = format!("{wasi_ldflags_llvm} -flto -Wl,--strip-all");

// We need two toolchain files: one for the compiler itself (which needs threads at the moment since
// -DLLVM_ENABLE_THREADS=OFF is kind of broken), and one for the runtime libs.
cfg.define("WASI", "TRUE")
.define("CMAKE_SYSTEM_NAME", "Generic")
.define("CMAKE_SYSTEM_VERSION", "1")
.define("CMAKE_SYSTEM_PROCESSOR", "wasm32")
.define("CMAKE_EXECUTABLE_SUFFIX", ".wasm")
.define("CMAKE_FIND_ROOT_PATH_MODE_PROGRAM", "NEVER")
.define("CMAKE_FIND_ROOT_PATH_MODE_LIBRARY", "ONLY")
.define("CMAKE_FIND_ROOT_PATH_MODE_INCLUDE", "ONLY")
.define("CMAKE_FIND_ROOT_PATH_MODE_PACKAGE", "ONLY")
.define("CMAKE_C_COMPILER", format!("{wasi_sdk_path}/bin/{wasi_target}-clang"))
.define("CMAKE_CXX_COMPILER", format!("{wasi_sdk_path}/bin/{wasi_target}-clang++"))
.define("CMAKE_LINKER", format!("{wasi_sdk_path}/bin/wasm-ld"))
.define("CMAKE_AR", format!("{wasi_sdk_path}/bin/ar"))
.define("CMAKE_RANLIB", format!("{wasi_sdk_path}/bin/ranlib"))
.define("CMAKE_C_COMPILER_TARGET", &wasi_target_llvm)
.define("CMAKE_CXX_COMPILER_TARGET", &wasi_target_llvm)
.define("CMAKE_C_FLAGS", format!("{wasi_sysroot} {wasi_cflags_llvm}"))
.define("CMAKE_CXX_FLAGS", format!("{wasi_sysroot} {wasi_cflags_llvm}"))
.define("CMAKE_EXE_LINKER_FLAGS", wasi_ldflags_llvm)
.define("LLVM_BUILD_SHARED_LIBS", "OFF")
.define("LLVM_ENABLE_PIC", "OFF")
.define("LLVM_BUILD_STATIC", "ON")
// .define("LLVM_ENABLE_THREADS", "OFF")
.define("LLVM_ENABLE_THREADS", "ON")
.define("LLVM_BUILD_RUNTIME", "OFF")
.define("LLVM_BUILD_TOOLS", "OFF")
.define("LLVM_INCLUDE_UTILS", "OFF")
.define("LLVM_BUILD_UTILS", "OFF")
.define("LLVM_INCLUDE_RUNTIMES", "OFF")
.define("LLVM_INCLUDE_EXAMPLES", "OFF")
.define("LLVM_INCLUDE_TESTS", "OFF")
.define("LLVM_INCLUDE_BENCHMARKS", "OFF")
.define("LLVM_INCLUDE_DOCS", "OFF")
.define("LLVM_TOOL_BUGPOINT_BUILD", "OFF")
.define("LLVM_TOOL_BUGPOINT_PASSES_BUILD", "OFF")
.define("LLVM_TOOL_DSYMUTIL_BUILD", "OFF")
.define("LLVM_TOOL_DXIL_DIS_BUILD", "OFF")
.define("LLVM_TOOL_GOLD_BUILD", "OFF")
.define("LLVM_TOOL_LLC_BUILD", "OFF")
.define("LLVM_TOOL_LLI_BUILD", "OFF")
// .define("LLVM_TOOL_LLVM_AR_BUILD", "ON")
// .define("LLVM_TOOL_LLVM_AS_BUILD", "ON")
.define("LLVM_TOOL_LLVM_AS_FUZZER_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_BCANALYZER_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_CAT_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_CFI_VERIFY_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_CONFIG_BUILD", "OFF")
// .define("LLVM_TOOL_LLVM_COV_BUILD", "ON")
.define("LLVM_TOOL_LLVM_CVTRES_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_CXXDUMP_BUILD", "OFF")
// .define("LLVM_TOOL_LLVM_CXXFILT_BUILD", "ON")
.define("LLVM_TOOL_LLVM_CXXMAP_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_C_TEST_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_DEBUGINFOD_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_DEBUGINFOD_FIND_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_DEBUGINFO_ANALYZER_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_DIFF_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_DIS_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_DIS_FUZZER_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_DLANG_DEMANGLE_FUZZER_BUILD", "OFF")
// .define("LLVM_TOOL_LLVM_DRIVER_BUILD", "ON")
// .define("LLVM_TOOL_LLVM_DWARFDUMP_BUILD", "ON")
.define("LLVM_TOOL_LLVM_DWARFUTIL_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_DWP_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_EXEGESIS_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_EXTRACT_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_GSYMUTIL_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_IFS_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_ISEL_FUZZER_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_ITANIUM_DEMANGLE_FUZZER_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_JITLINK_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_JITLISTENER_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_LIBTOOL_DARWIN_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_LINK_BUILD", "ON")
.define("LLVM_TOOL_LLVM_LIPO_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_LTO2_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_LTO_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_MCA_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_MC_ASSEMBLE_FUZZER_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_MC_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_MC_DISASSEMBLE_FUZZER_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_MICROSOFT_DEMANGLE_FUZZER_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_ML_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_MODEXTRACT_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_MT_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_NM_BUILD", "OFF")
// .define("LLVM_TOOL_LLVM_OBJCOPY_BUILD", "ON")
// .define("LLVM_TOOL_LLVM_OBJDUMP_BUILD", "ON")
.define("LLVM_TOOL_LLVM_OPT_FUZZER_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_OPT_REPORT_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_PDBUTIL_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_PROFDATA_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_PROFGEN_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_RC_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_READOBJ_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_READTAPI_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_REDUCE_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_REMARKUTIL_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_RTDYLD_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_RUST_DEMANGLE_FUZZER_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_SHLIB_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_SIM_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_SIZE_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_SPECIAL_CASE_LIST_FUZZER_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_SPLIT_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_STRESS_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_STRINGS_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_SYMBOLIZER_BUILD", "ON")
.define("LLVM_TOOL_LLVM_TLI_CHECKER_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_UNDNAME_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_XRAY_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_YAML_NUMERIC_PARSER_FUZZER_BUILD", "OFF")
.define("LLVM_TOOL_LLVM_YAML_PARSER_FUZZER_BUILD", "OFF")
.define("LLVM_TOOL_LTO_BUILD", "OFF")
.define("LLVM_TOOL_OBJ2YAML_BUILD", "OFF")
.define("LLVM_TOOL_OPT_BUILD", "OFF")
.define("LLVM_TOOL_OPT_VIEWER_BUILD", "OFF")
.define("LLVM_TOOL_REDUCE_CHUNK_LIST_BUILD", "OFF")
.define("LLVM_TOOL_REMARKS_SHLIB_BUILD", "OFF")
.define("LLVM_TOOL_SANCOV_BUILD", "OFF")
.define("LLVM_TOOL_SANSTATS_BUILD", "OFF")
.define("LLVM_TOOL_SPIRV_TOOLS_BUILD", "OFF")
.define("LLVM_TOOL_VERIFY_USELISTORDER_BUILD", "OFF")
.define("LLVM_TOOL_VFABI_DEMANGLE_FUZZER_BUILD", "OFF")
.define("LLVM_TOOL_XCODE_TOOLCHAIN_BUILD", "OFF")
.define("LLVM_TOOL_YAML2OBJ_BUILD", "OFF")
// .define("LLVM_ENABLE_PROJECTS", "clang;lld")
.define("LLVM_ENABLE_PROJECTS", "")
// .define("CLANG_ENABLE_ARCMT", "OFF")
// .define("CLANG_ENABLE_STATIC_ANALYZER", "OFF")
// .define("CLANG_INCLUDE_TESTS", "OFF")
// .define("CLANG_BUILD_TOOLS", "OFF")
// .define("CLANG_TOOL_CLANG_SCAN_DEPS_BUILD", "OFF")
// .define("CLANG_TOOL_CLANG_INSTALLAPI_BUILD", "OFF")
// .define("CLANG_BUILD_EXAMPLES", "OFF")
// .define("CLANG_INCLUDE_DOCS", "OFF")
// .define("CLANG_LINKS_TO_CREATE", "clang;clang++")
// .define("CLANG_LINKS_TO_CREATE", "")
.define("LLD_BUILD_TOOLS", "OFF")
.define("CMAKE_BUILD_TYPE", "MinSizeRel")
.define("HAVE_DLOPEN", "");
} else {
cfg.define("LLVM_TOOL_LLVM_CONFIG_BUILD", "ON")
.define("LLVM_BUILD_TOOLS", "ON");
}

cfg.build();

// Helper to find the name of LLVM's shared library on darwin and linux.
Expand Down
2 changes: 1 addition & 1 deletion src/llvm-project
Loading