GitLab will be upgraded to the 12.10.14-ce.0 on 28 Sept 2020 at 2.00pm (AEDT) to 2.30pm (AEDT). During the update, GitLab and Mattermost services will not be available. If you have any concerns with this, please talk to us at N110 (b) CSIT building.

Working test groups: binop, floating_point, alloc

parent edd644e3
...@@ -27,6 +27,7 @@ default = ["aot"] ...@@ -27,6 +27,7 @@ default = ["aot"]
aot = [] aot = []
jit = [] jit = []
sel4-rumprun = [] sel4-rumprun = []
sel4-rumprun-target-side = []
[build-dependencies] [build-dependencies]
gcc = "0.3" gcc = "0.3"
...@@ -34,8 +35,7 @@ gcc = "0.3" ...@@ -34,8 +35,7 @@ gcc = "0.3"
[dependencies] [dependencies]
ast = {path = "src/ast"} ast = {path = "src/ast"}
utils = {path = "src/utils"} utils = {path = "src/utils"}
gc = {path = "src/gc"} #gc = {path = "src/gc"}
field-offset = "0.1.1" field-offset = "0.1.1"
libloading = "0.3" libloading = "0.3"
...@@ -52,3 +52,12 @@ docopt = "0.6" ...@@ -52,3 +52,12 @@ docopt = "0.6"
petgraph = "0.4.1" petgraph = "0.4.1"
extprim = "*" extprim = "*"
num-traits = "*" num-traits = "*"
[target.x86_64-unknown-linux-gnu.dependencies]
gc = { path = "src/gc", default-features = false}
[target.x86_64-apple-darwin.dependencies]
gc = { path = "src/gc", default-features = false}
[target.x86_64-rumprun-netbsd.dependencies]
gc = { path = "src/gc", default-features = false, features = ["sel4-rumprun-target-side"], target = "x86_64-rumprun-netbsd"}
...@@ -13,7 +13,9 @@ ...@@ -13,7 +13,9 @@
// limitations under the License. // limitations under the License.
extern crate gcc; extern crate gcc;
use std::env;
#[cfg(not(feature = "sel4-rumprun-target-side"))]
#[cfg(any(target_os = "macos", target_os = "linux"))] #[cfg(any(target_os = "macos", target_os = "linux"))]
#[cfg(target_arch = "x86_64")] #[cfg(target_arch = "x86_64")]
fn main() { fn main() {
...@@ -24,6 +26,7 @@ fn main() { ...@@ -24,6 +26,7 @@ fn main() {
.compile("libswap_stack.a"); .compile("libswap_stack.a");
} }
#[cfg(not(feature = "sel4-rumprun-target-side"))]
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
#[cfg(target_arch = "aarch64")] #[cfg(target_arch = "aarch64")]
fn main() { fn main() {
...@@ -35,6 +38,7 @@ fn main() { ...@@ -35,6 +38,7 @@ fn main() {
} }
// This is here to enable cross compiling from windows/x86_64 to linux/aarch64 // This is here to enable cross compiling from windows/x86_64 to linux/aarch64
#[cfg(not(feature = "sel4-rumprun-target-side"))]
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
#[cfg(target_arch = "x86_64")] #[cfg(target_arch = "x86_64")]
fn main() { fn main() {
...@@ -45,9 +49,14 @@ fn main() { ...@@ -45,9 +49,14 @@ fn main() {
.compile("libswap_stack.a"); .compile("libswap_stack.a");
} }
#[cfg(feature = "sel4-rumprun")]
//#[cfg(all(target_os = "netbsd", target_vendor = "rumprun"))]
#[cfg(feature = "sel4-rumprun-target-side")]
#[cfg(target_arch = "x86_64")] #[cfg(target_arch = "x86_64")]
fn main() { fn main() {
// env::set_var("ZEBU_TARGET", "x86_64-rumprun-netbsd");
// println!("*****ENV VAR SET*****");
use std::path::Path;
let mut compiler_name = String::new(); let mut compiler_name = String::new();
compiler_name.push_str("x86_64-rumprun-netbsd-gcc"); compiler_name.push_str("x86_64-rumprun-netbsd-gcc");
gcc::Config::new().flag("-O3").flag("-c") gcc::Config::new().flag("-O3").flag("-c")
...@@ -56,10 +65,10 @@ fn main() { ...@@ -56,10 +65,10 @@ fn main() {
.compile("libruntime.a"); .compile("libruntime.a");
gcc::Config::new().flag("-O3").flag("-c") gcc::Config::new().flag("-O3").flag("-c")
.compiler(Path::new(compiler_name.as_str())) .compiler(Path::new(compiler_name.as_str()))
.file("src/runtime/swap_stack_x64_sysv.S") .file("src/runtime/swap_stack_x64_sel4_rumprun_sysv.S")
.compile("libswap_stack.a"); .compile("libswap_stack.a");
gcc::Config::new().flag("-O3").flag("-c") gcc::Config::new().flag("-O3").flag("-c")
.compiler(Path::new(compiler_name.as_str())) .compiler(Path::new(compiler_name.as_str()))
.file("c_helpers.c") .file("zebu_c_helpers.c")
.compile("libc_helpers.a"); .compile("libzebu_c_helpers.a");
} }
\ No newline at end of file
#!/usr/bin/env bash
export ZEBU_TARGET=x86_64-rumprun-netbsd
cd ././../rumprun-sel4/
bash clean_and_build.sh
\ No newline at end of file
This diff is collapsed.
...@@ -802,7 +802,7 @@ impl Value { ...@@ -802,7 +802,7 @@ impl Value {
} }
const DISPLAY_ID : bool = true; const DISPLAY_ID : bool = true;
const DISPLAY_TYPE : bool = false; const DISPLAY_TYPE : bool = true;
const PRINT_ABBREVIATE_NAME: bool = true; const PRINT_ABBREVIATE_NAME: bool = true;
impl fmt::Debug for Value { impl fmt::Debug for Value {
......
...@@ -2790,6 +2790,7 @@ fn write_const_value(f: &mut File, constant: P<Value>) { ...@@ -2790,6 +2790,7 @@ fn write_const_value(f: &mut File, constant: P<Value>) {
} }
} }
use std::collections::HashMap; use std::collections::HashMap;
pub fn emit_context_with_reloc(vm: &VM, pub fn emit_context_with_reloc(vm: &VM,
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#![allow(unused_variables)] #![allow(unused_variables)]
use compiler::backend::AOT_EMIT_CONTEXT_FILE; use compiler::backend::AOT_EMIT_CONTEXT_FILE;
use compiler::backend::AOT_EMIT_SYM_TABLE_FILE;
use compiler::backend::RegGroup; use compiler::backend::RegGroup;
use utils::ByteSize; use utils::ByteSize;
use utils::Address; use utils::Address;
...@@ -2998,6 +2999,7 @@ impl CodeGenerator for ASMCodeGen { ...@@ -2998,6 +2999,7 @@ impl CodeGenerator for ASMCodeGen {
self.add_asm_branch2(asm, dest_name); self.add_asm_branch2(asm, dest_name);
} }
#[cfg(not(feature = "sel4-rumprun"))]
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
fn emit_call_near_rel32(&mut self, callsite: String, func: MuName, pe: Option<MuName>) -> ValueLocation { fn emit_call_near_rel32(&mut self, callsite: String, func: MuName, pe: Option<MuName>) -> ValueLocation {
trace!("emit: call {}", func); trace!("emit: call {}", func);
...@@ -3012,6 +3014,7 @@ impl CodeGenerator for ASMCodeGen { ...@@ -3012,6 +3014,7 @@ impl CodeGenerator for ASMCodeGen {
ValueLocation::Relocatable(RegGroup::GPR, callsite) ValueLocation::Relocatable(RegGroup::GPR, callsite)
} }
#[cfg(not(feature = "sel4-rumprun"))]
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
// generating Position-Independent Code using PLT // generating Position-Independent Code using PLT
fn emit_call_near_rel32(&mut self, callsite: String, func: MuName, pe: Option<MuName>) -> ValueLocation { fn emit_call_near_rel32(&mut self, callsite: String, func: MuName, pe: Option<MuName>) -> ValueLocation {
...@@ -3436,11 +3439,14 @@ fn write_const_min_align(f: &mut File) { ...@@ -3436,11 +3439,14 @@ fn write_const_min_align(f: &mut File) {
write_align(f, MIN_ALIGN); write_align(f, MIN_ALIGN);
} }
#[cfg(not(feature = "sel4-rumprun"))]
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
fn write_align(f: &mut File, align: ByteSize) { fn write_align(f: &mut File, align: ByteSize) {
use std::io::Write; use std::io::Write;
f.write_fmt(format_args!("\t.align {}\n", check_min_align(align))).unwrap(); f.write_fmt(format_args!("\t.align {}\n", check_min_align(align))).unwrap();
} }
#[cfg(not(feature = "sel4-rumprun"))]
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
fn write_align(f: &mut File, align: ByteSize) { fn write_align(f: &mut File, align: ByteSize) {
use std::io::Write; use std::io::Write;
...@@ -3524,6 +3530,128 @@ fn write_const_value(f: &mut File, constant: P<Value>) { ...@@ -3524,6 +3530,128 @@ fn write_const_value(f: &mut File, constant: P<Value>) {
} }
} }
#[cfg(not(feature = "sel4-rumprun"))]
pub fn emit_sym_table(vm: &VM) {
debug!("Currently nothing to emit for --!");
}
#[cfg(feature = "sel4-rumprun")]
pub fn emit_sym_table(vm: &VM){
use std::path;
use std::io::Write;
// Javad-cross-compile
// code to generate an asm file to resolve symbol addresses at link time!
// in this stage, a single sym_file is generated for each test
// these sym_files will be merged in build.rs\
// in the parent directory of sel4 side
//**************************************************
// Code starts here
// first create the asm file in the correct path
// _st added file name and path stands for _SymTable
// *************************************************
debug!("Going to emit Sym table for sel4-rumprun");
let mut file_path_st = path::PathBuf::new();
file_path_st.push(&vm.vm_options.flag_aot_emit_dir);
//just the file name is changed compared to context.s
// vm file name is: "fnID_sym_table.s"
file_path_st.push(format!("{}", AOT_EMIT_SYM_TABLE_FILE));
let mut file_st = match File::create(file_path_st.as_path()) {
Err(why) => panic!("couldn't create SYM TABLE file {}: {}", file_path_st.to_str().unwrap(), why),
Ok(file) => file
};
// **************************************************
// fnID_sym_table.s is created, but it's empty
// *************************************************
// **************************************************
// Code for exporting all of the required symbols \
// in vm, using the following fields:
// compiled_funcs.CompiledFunction.start
// compiled_funcs.CompiledFunction.end
// compiled_funcs.CompiledFunction.Frame. \
// exception_callsites[iter](src,_)
// compiled_funcs.CompiledFunction.Frame. \
// exception_callsites[iter](_,dest)
// ret
// *************************************************
let mut sym_vec: Vec<String> = Vec::new();
let compiled_funcs : &HashMap<_, _> = &vm.compiled_funcs().read().unwrap();
debug!("Number of Compiled functions: {}\n", compiled_funcs.len());
for (theID, theCFs) in compiled_funcs.iter() {
let theCF : &CompiledFunction = &theCFs.read().unwrap();
debug!("new theCF\n");
match theCF.start {
// CF.start can only be relocatable , otherwise panic
ValueLocation::Relocatable(_, ref symbol) => {
debug!("theCF.start, symbol = {}\n", *symbol);
sym_vec.push((*symbol).clone());
},
// CF.start can't reach this state
_ => panic!("Sym_Table_start: expecting Relocatable location, found {}", theCF.start)
}
match theCF.end {
// CF.start can only be relocatable , otherwise panic
ValueLocation::Relocatable(_, ref symbol) => {
debug!("theCF.end, symbol = {}\n", *symbol);
sym_vec.push((*symbol).clone());
},
// CF.end can't reach this state
_ => panic!("Sym_Table_end: expecting Relocatable location, found {}", theCF.end)
}
debug!("Number of exp callsites = {}\n", theCF.frame.get_exception_callsites().len());
for &(ref callsite, ref dest) in theCF.frame.get_exception_callsites().iter(){
debug!("exception callsite, step 1\n");
match *callsite {
ValueLocation::Relocatable(_, ref symbol) => {
debug!("exception callsite, step 2, callsite symbol = {}\n", *symbol);
sym_vec.push((*symbol).clone());
},
// can't reach this state
_ => panic!("Sym_Table_callsite: expecting Relocatable location, found {}", callsite)
}
match *dest {
ValueLocation::Relocatable(_, ref symbol) => {
debug!("exception callsite, step 3, dest symbol = {}\n", *symbol);
sym_vec.push((*symbol).clone());
},
// can't reach this state
_ => panic!("Sym_Table_callsite: expecting Relocatable location, found {}", dest)
}
}
}
// **************************************************
// To generate the following code
// .data
// .globl mu_sym_table
// mu_sym_table:
// for each symbol {
// .quad "symbol_name".length()
// __symbol_name:
// .ascii "symbol_name"
// .quad 0
// }
// *************************************************
file_st.write("\t.data\n".as_bytes()).unwrap();
file_st.write_fmt(format_args!("\t{}\n", directive_globl("mu_sym_table".to_string()))).unwrap();
file_st.write_fmt(format_args!("mu_sym_table:\n")).unwrap();
file_st.write_fmt(format_args!(".quad {}\n", sym_vec.len())).unwrap();
for i in 0..sym_vec.len(){
file_st.write_fmt(format_args!(".quad {}\n", sym_vec[i].len())).unwrap();
file_st.write_fmt(format_args!(".ascii \"{}\"\n", sym_vec[i])).unwrap();
// file_st.write_fmt(format_args!("__{}:\n", sym_vec[i])).unwrap();
file_st.write_fmt(format_args!(".quad {}\n", sym_vec[i])).unwrap();
}
//**************************************************
// Javad's code for generating sym_table ends here
// __
// *************************************************
}
use std::collections::HashMap; use std::collections::HashMap;
use compiler::backend::code_emission::emit_mu_types; use compiler::backend::code_emission::emit_mu_types;
...@@ -3669,6 +3797,8 @@ pub fn emit_context_with_reloc(vm: &VM, ...@@ -3669,6 +3797,8 @@ pub fn emit_context_with_reloc(vm: &VM,
// let primordial = primordial.as_ref().unwrap(); // let primordial = primordial.as_ref().unwrap();
// } // }
emit_sym_table(vm);
debug!("---finish---"); debug!("---finish---");
} }
...@@ -3706,14 +3836,18 @@ fn directive_comm(name: String, size: ByteSize, align: ByteSize) -> String { ...@@ -3706,14 +3836,18 @@ fn directive_comm(name: String, size: ByteSize, align: ByteSize) -> String {
format!(".comm {},{},{}", name, size, align) format!(".comm {},{},{}", name, size, align)
} }
#[cfg(not(feature = "sel4-rumprun"))]
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
pub fn symbol(name: String) -> String { pub fn symbol(name: String) -> String {
name name
} }
#[cfg(not(feature = "sel4-rumprun"))]
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
pub fn symbol(name: String) -> String { pub fn symbol(name: String) -> String {
format!("_{}", name) format!("_{}", name)
} }
// same as Linux // same as Linux
#[cfg(feature = "sel4-rumprun")] #[cfg(feature = "sel4-rumprun")]
pub fn symbol(name: String) -> String { pub fn symbol(name: String) -> String {
...@@ -3722,11 +3856,13 @@ pub fn symbol(name: String) -> String { ...@@ -3722,11 +3856,13 @@ pub fn symbol(name: String) -> String {
#[allow(dead_code)] #[allow(dead_code)]
#[cfg(not(feature = "sel4-rumprun"))]
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
pub fn pic_symbol(name: String) -> String { pub fn pic_symbol(name: String) -> String {
format!("{}@GOTPCREL", name) format!("{}@GOTPCREL", name)
} }
#[allow(dead_code)] #[allow(dead_code)]
#[cfg(not(feature = "sel4-rumprun"))]
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
pub fn pic_symbol(name: String) -> String { pub fn pic_symbol(name: String) -> String {
symbol(name) symbol(name)
......
...@@ -3943,15 +3943,15 @@ impl <'a> InstructionSelection { ...@@ -3943,15 +3943,15 @@ impl <'a> InstructionSelection {
self.backend.emit_mov_r64_imm64(&tmp_h, vals[1] as i64); self.backend.emit_mov_r64_imm64(&tmp_h, vals[1] as i64);
}, },
&Constant::FuncRef(func_id) => { &Constant::FuncRef(func_id) => {
if cfg!(target_os = "macos") { if cfg!(feature = "sel4-rumprun") {
let mem = self.get_mem_for_funcref(func_id, vm);
self.backend.emit_mov_r_mem(&tmp, &mem);
} else if cfg!(target_os = "macos") {
let mem = self.get_mem_for_funcref(func_id, vm); let mem = self.get_mem_for_funcref(func_id, vm);
self.backend.emit_lea_r64(&tmp, &mem); self.backend.emit_lea_r64(&tmp, &mem);
} else if cfg!(target_os = "linux") { } else if cfg!(target_os = "linux") {
let mem = self.get_mem_for_funcref(func_id, vm); let mem = self.get_mem_for_funcref(func_id, vm);
self.backend.emit_mov_r_mem(&tmp, &mem); self.backend.emit_mov_r_mem(&tmp, &mem);
} else if cfg!(feature = "sel4-rumprun") {
let mem = self.get_mem_for_funcref(func_id, vm);
self.backend.emit_mov_r_mem(&tmp, &mem);
} else { } else {
unimplemented!() unimplemented!()
} }
...@@ -4117,17 +4117,7 @@ impl <'a> InstructionSelection { ...@@ -4117,17 +4117,7 @@ impl <'a> InstructionSelection {
unimplemented!() unimplemented!()
} else { } else {
// symbolic // symbolic
if cfg!(target_os = "macos") { if cfg!(feature = "sel4-rumprun") {
P(Value {
hdr: MuEntityHeader::unnamed(vm.next_id()),
ty: types::get_referent_ty(&pv.ty).unwrap(),
v: Value_::Memory(MemoryLocation::Symbolic {
base: Some(x86_64::RIP.clone()),
label: pv.name().unwrap(),
is_global: true,
})
})
} else if cfg!(target_os = "linux") {
// for a(%RIP), we need to load its address from a@GOTPCREL(%RIP) // for a(%RIP), we need to load its address from a@GOTPCREL(%RIP)
// then load from the address. // then load from the address.
// asm_backend will emit a@GOTPCREL(%RIP) for a(%RIP) // asm_backend will emit a@GOTPCREL(%RIP) for a(%RIP)
...@@ -4146,7 +4136,17 @@ impl <'a> InstructionSelection { ...@@ -4146,7 +4136,17 @@ impl <'a> InstructionSelection {
self.emit_move_value_to_value(&actual_loc, &got_loc); self.emit_move_value_to_value(&actual_loc, &got_loc);
self.make_memory_op_base_offset(&actual_loc, 0, types::get_referent_ty(&pv.ty).unwrap(), vm) self.make_memory_op_base_offset(&actual_loc, 0, types::get_referent_ty(&pv.ty).unwrap(), vm)
} else if cfg!(feature = "sel4-rumprun") { } else if cfg!(target_os = "macos") {
P(Value {
hdr: MuEntityHeader::unnamed(vm.next_id()),
ty: types::get_referent_ty(&pv.ty).unwrap(),
v: Value_::Memory(MemoryLocation::Symbolic {
base: Some(x86_64::RIP.clone()),
label: pv.name().unwrap(),
is_global: true,
})
})
} else if cfg!(target_os = "linux") {
// for a(%RIP), we need to load its address from a@GOTPCREL(%RIP) // for a(%RIP), we need to load its address from a@GOTPCREL(%RIP)
// then load from the address. // then load from the address.
// asm_backend will emit a@GOTPCREL(%RIP) for a(%RIP) // asm_backend will emit a@GOTPCREL(%RIP) for a(%RIP)
......
...@@ -27,6 +27,8 @@ pub const WORD_SIZE : ByteSize = 8; ...@@ -27,6 +27,8 @@ pub const WORD_SIZE : ByteSize = 8;
pub const AOT_EMIT_CONTEXT_FILE : &'static str = "context.s"; pub const AOT_EMIT_CONTEXT_FILE : &'static str = "context.s";
pub const AOT_EMIT_SYM_TABLE_FILE : &'static str = "mu_sym_table.s";
// this is not full name, but pro/epilogue name is generated from this // this is not full name, but pro/epilogue name is generated from this
pub const PROLOGUE_BLOCK_NAME: &'static str = "prologue"; pub const PROLOGUE_BLOCK_NAME: &'static str = "prologue";
pub const EPILOGUE_BLOCK_NAME: &'static str = "epilogue"; pub const EPILOGUE_BLOCK_NAME: &'static str = "epilogue";
......
...@@ -24,6 +24,8 @@ crate-type = ["rlib"] ...@@ -24,6 +24,8 @@ crate-type = ["rlib"]
[features] [features]
default = [] default = []
use-sidemap = [] use-sidemap = []
sel4-rumprun = []
sel4-rumprun-target-side = []
[build-dependencies] [build-dependencies]
gcc = "0.3" gcc = "0.3"
......
...@@ -14,32 +14,61 @@ ...@@ -14,32 +14,61 @@
extern crate gcc; extern crate gcc;
//#[cfg(not(feature = "sel4-rumprun-target-side"))]
#[cfg(any(target_os = "macos", target_os = "linux"))] #[cfg(any(target_os = "macos", target_os = "linux"))]
#[cfg(target_arch = "x86_64")] #[cfg(target_arch = "x86_64")]
fn main() { fn build_libgc(){
println!("detected macos or linux");
gcc::compile_library("libgc_clib_x64.a", &["src/heap/gc/clib_x64.c"]); gcc::compile_library("libgc_clib_x64.a", &["src/heap/gc/clib_x64.c"]);
} }
//#[cfg(not(feature = "sel4-rumprun-target-side"))]
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
#[cfg(target_arch = "aarch64")] #[cfg(target_arch = "aarch64")]
fn main() { fn build_libgc() {
println!("detected linux aarch64");
gcc::compile_library("libgc_clib_aarch64.a", &["src/heap/gc/clib_aarch64.S"]); gcc::compile_library("libgc_clib_aarch64.a", &["src/heap/gc/clib_aarch64.S"]);
} }
// This is here to enable cross compiling from windows/x86_64 to linux/aarch64 // This is here to enable cross compiling from windows/x86_64 to linux/aarch64
//#[cfg(not(feature = "sel4-rumprun-target-side"))]
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
#[cfg(target_arch = "x86_64")] #[cfg(target_arch = "x86_64")]
fn main() { fn build_libgc() {
println!("detected windows 64");
gcc::compile_library("libgc_clib_aarch64.a", &["src/heap/gc/clib_aarch64.S"]); gcc::compile_library("libgc_clib_aarch64.a", &["src/heap/gc/clib_aarch64.S"]);
} }
#[cfg(feature = "sel4-rumprun")]
#[cfg(target_arch = "x86_64")] //#[cfg(all(target_os = "netbsd", target_vendor = "rumprun"))]
//#[cfg(feature = "sel4-rumprun-target-side")]
//#[cfg(target_arch = "x86_64")]
fn main() { fn main() {
let mut compiler_name = String::new(); use std::env;
compiler_name.push_str("x86_64-rumprun-netbsd-gcc"); let mut gc_target = 0; // 1 for rumprun-sel4 and 0 otherwise
gcc::Config::new().flag("-O3").flag("-c") for (key, value) in env::vars() {
.compiler(Path::new(compiler_name.as_str())) if key == "ZEBU_TARGET" {
.file("src/heap/gc/clib_x64_sel4_rumprun.c") if value == "x86_64-rumprun-netbsd" {
.compile("libgc_clib_x64_sel4_rumprun.a"); gc_target = 1;
} break;
\ No newline at end of file }
else {
gc_target = 0;
break;
}
}
}
// for sel4-rumprun, do (if)
// otherwise, call the related target function
if gc_target == 1 {
use std::path::Path;
println!("detected rumprun-netbsd");
let mut compiler_name = String::new();
compiler_name.push_str("x86_64-rumprun-netbsd-gcc");
gcc::Config::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(); }
}
...@@ -13,9 +13,11 @@ ...@@ -13,9 +13,11 @@
// limitations under the License. // limitations under the License.
#include <inttypes.h> #include <inttypes.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include <pthread.h>
void* malloc_zero(size_t size) { void* malloc_zero(size_t size) {
void* ret = malloc(size); void* ret = malloc(size);
......
...@@ -87,18 +87,6 @@ extern "C" { ...@@ -87,18 +87,6 @@ extern "C" {
fn get_registers_count() -> i32; fn get_registers_count() -> i32;
} }
#[cfg(target_arch = "x86_64")]
#[cfg(feature = "sel4-rumprun")]
#[link(name = "gc_clib_x64_sel4_rumprun")]
extern "C" {
pub fn malloc_zero(size: usize) -> *const c_void;
fn immmix_get_stack_ptr() -> Address;
pub fn set_low_water_mark();
fn get_low_water_mark() -> Address;
fn get_registers() -> *const Address;
fn get_registers_count() -> i32;
}
pub fn stack_scan() -> Vec<ObjectReference> { pub fn stack_scan() -> Vec<ObjectReference> {
trace!("stack scanning..."); trace!("stack scanning...");
let stack_ptr : Address = unsafe {immmix_get_stack_ptr()}; let stack_ptr : Address = unsafe {immmix_get_stack_ptr()};
......
...@@ -12,6 +12,6 @@ ...@@ -12,6 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
mod test_gc_harness; pub mod test_gc_harness;
mod test_gcbench; mod test_gcbench;
mod test_gc_linked_list; mod test_gc_linked_list;
...@@ -65,7 +65,7 @@ const FIXSIZE_REFx1_ENCODE : u64 = 0xb000000000000001u64; ...@@ -65,7 +65,7 @@ const FIXSIZE_REFx1_ENCODE : u64 = 0xb000000000000001u64;
#[test] #[test]
fn test_exhaust_alloc() { pub fn test_exhaust_alloc() {
gc::gc_init(IMMIX_SPACE_SIZE, LO_SPACE_SIZE, 8, false); gc::gc_init(IMMIX_SPACE_SIZE, LO_SPACE_SIZE, 8, false);
let mut mutator = gc::new_mutator(); let mut mutator = gc::new_mutator();
......
// Copyright 2017 The Australian National University // Copyright 2017 The Australian National University
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
// You may obtain a copy of the License at // You may obtain a copy of the License at
// //
// http://www.apache.org/licenses/LICENSE-2.0 // http://www.apache.org/licenses/LICENSE-2.0
// //
// Unless required by applicable law or agreed to in writing, software // Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![feature(cfg_target_vendor)]
#[macro_use] #[macro_use]
extern crate lazy_static; extern crate lazy_static;
#[macro_use] #[macro_use]
......
...@@ -44,7 +44,8 @@ pub mod exception; ...@@ -44,7 +44,8 @@ pub mod exception;
// consider using libloading crate instead of the raw c functions for dynalic libraries // consider using libloading crate instead of the raw c functions for dynalic libraries