Commit 8a1a2d3f authored by Zixian Cai's avatar Zixian Cai

Refactor deprecated method calls

parent 01136bf7
Pipeline #1031 passed with stages
in 55 minutes and 5 seconds
......@@ -21,9 +21,11 @@ extern crate gcc;
#[cfg(any(target_os = "macos", target_os = "linux"))]
#[cfg(target_arch = "x86_64")]
fn main() {
gcc::compile_library("libruntime_c.a", &["src/runtime/runtime_c_x64_sysv.c"]);
gcc::Build::new()
.file("src/runtime/runtime_c_x64_sysv.c")
.compile("libruntime_c.a");
gcc::Config::new()
gcc::Build::new()
.flag("-O3")
.flag("-c")
.file("src/runtime/runtime_asm_x64_sysv.S")
......@@ -36,9 +38,11 @@ fn main() {
#[cfg(target_os = "linux")]
#[cfg(target_arch = "aarch64")]
fn main() {
gcc::compile_library("libruntime_c.a", &["src/runtime/runtime_c_aarch64_sysv.c"]);
gcc::Build::new()
.file("src/runtime/runtime_c_aarch64_sysv.c")
.compile("libruntime_c.a");
gcc::Config::new()
gcc::Build::new()
.flag("-O3")
.flag("-c")
.file("src/runtime/runtime_asm_aarch64_sysv.S")
......@@ -59,19 +63,19 @@ fn main() {
use std::path::Path;
let mut compiler_name = String::new();
compiler_name.push_str("x86_64-rumprun-netbsd-gcc");
gcc::Config::new()
gcc::Build::new()
.flag("-O3")
.flag("-c")
.compiler(Path::new(compiler_name.as_str()))
.file("src/runtime/runtime_x64_sel4_rumprun_sysv.c")
.compile("libruntime_c.a");
gcc::Config::new()
gcc::Build::new()
.flag("-O3")
.flag("-c")
.compiler(Path::new(compiler_name.as_str()))
.file("src/runtime/runtime_asm_x64_sel4_rumprun_sysv.S")
.compile("libruntime_asm.a");
gcc::Config::new()
gcc::Build::new()
.flag("-O3")
.flag("-c")
.compiler(Path::new(compiler_name.as_str()))
......
......@@ -17,20 +17,26 @@ extern crate gcc;
#[cfg(any(target_os = "macos", target_os = "linux"))]
#[cfg(target_arch = "x86_64")]
fn build_libgc() {
gcc::compile_library("libgc_clib_x64.a", &["src/heap/gc/clib_x64.c"]);
gcc::Build::new()
.file("src/heap/gc/clib_x64.c")
.compile("libgc_clib_x64.a");
}
#[cfg(target_os = "linux")]
#[cfg(target_arch = "aarch64")]
fn build_libgc() {
gcc::compile_library("libgc_clib_aarch64.a", &["src/heap/gc/clib_aarch64.S"]);
gcc::Build::new()
.file("src/heap/gc/clib_aarch64.S")
.compile("libgc_clib_aarch64.a");
}
// This is here to enable cross compiling from windows/x86_64 to linux/aarch64
#[cfg(target_os = "windows")]
#[cfg(target_arch = "x86_64")]
fn build_libgc() {
gcc::compile_library("libgc_clib_aarch64.a", &["src/heap/gc/clib_aarch64.S"]);
gcc::Build::new()
.file("src/heap/gc/clib_aarch64.S")
.compile("libgc_clib_aarch64.a");
}
// Due to bugs, it is currently not possible to use conditional compilation \
......@@ -56,9 +62,13 @@ fn main() {
use std::path::Path;
let mut compiler_name = String::new();
compiler_name.push_str("x86_64-rumprun-netbsd-gcc");
gcc::Config::new().flag("-O3").flag("-c")
gcc::Build::new()
.flag("-O3")
.flag("-c")
.compiler(Path::new(compiler_name.as_str()))
.file("src/heap/gc/clib_x64_sel4_rumprun.c")
.compile("libgc_clib_x64.a");
} else { build_libgc(); }
} else {
build_libgc();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment