revive llvm builder utility (#154)

Pre-eliminary support for LLVM releases and resolc binary releases by streamlining the build process for all supported hosts platforms.

- Introduce the revive-llvm-builder crate with the revive-llvm builder utilty.
- Do not rely on the LLVM dependency in $PATH to decouple the system LLVM installation from the LLVM host dependency.
- Fix the emscripten build by decoupling the host and native LLVM dependencies. Thus allowing a single LLVM emscripten release that can be used on any host platform.
- An example Dockerfile building an alpine container with a fully statically linked resolc ELF binary.
- Remove the Debian builder utilities and workflow.
This commit is contained in:
Cyrill Leutwiler
2025-01-13 15:58:27 +01:00
committed by GitHub
parent fde9edab10
commit 7f81f37e0c
65 changed files with 4847 additions and 557 deletions
+3
View File
@@ -8,3 +8,6 @@ description = "revive compiler stdlib components"
[dependencies]
inkwell = { workspace = true, features = ["target-riscv", "no-libffi-linking", "llvm18-0"] }
[build-dependencies]
revive-build-utils = { workspace = true }
+8 -3
View File
@@ -1,18 +1,23 @@
use std::{env, fs, path::Path, process::Command};
fn main() {
println!(
"cargo:rerun-if-env-changed={}",
revive_build_utils::REVIVE_LLVM_HOST_PREFIX
);
let lib = "stdlib.bc";
let out_dir = env::var_os("OUT_DIR").expect("env should have $OUT_DIR");
let bitcode_path = Path::new(&out_dir).join(lib);
let output = Command::new("llvm-as")
let llvm_as = revive_build_utils::llvm_host_tool("llvm-as");
let output = Command::new(llvm_as)
.args([
"-o",
bitcode_path.to_str().expect("$OUT_DIR should be UTF-8"),
"stdlib.ll",
])
.output()
.expect("should be able to invoke llvm-as");
.unwrap_or_else(|error| panic!("failed to execute llvm-as: {}", error));
assert!(
output.status.success(),