remove unused Cargo subprojects
This commit is contained in:
parent
dbcec72ca1
commit
bd9c835f44
@ -1,8 +0,0 @@
|
||||
[package]
|
||||
name = "compiler-rt"
|
||||
version = "0.1.0"
|
||||
authors = ["Alex Crichton <alex@alexcrichton.com>"]
|
||||
|
||||
[dependencies]
|
||||
compiler-rt-cdylib = { path = "compiler-rt-cdylib" }
|
||||
libloading = "0.3"
|
@ -1,12 +0,0 @@
|
||||
[package]
|
||||
name = "compiler-rt-cdylib"
|
||||
version = "0.1.0"
|
||||
authors = ["Alex Crichton <alex@alexcrichton.com>"]
|
||||
build = "build.rs"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[build-dependencies]
|
||||
gcc = "0.3.36"
|
||||
|
@ -1,104 +0,0 @@
|
||||
extern crate gcc;
|
||||
|
||||
use std::env;
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
|
||||
struct Sources {
|
||||
files: Vec<&'static str>,
|
||||
}
|
||||
|
||||
impl Sources {
|
||||
fn new() -> Sources {
|
||||
Sources { files: Vec::new() }
|
||||
}
|
||||
|
||||
fn extend(&mut self, sources: &[&'static str]) {
|
||||
self.files.extend(sources);
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
if !Path::new("compiler-rt/.git").exists() {
|
||||
let _ = Command::new("git").args(&["submodule", "update", "--init"])
|
||||
.status();
|
||||
}
|
||||
|
||||
let target = env::var("TARGET").expect("TARGET was not set");
|
||||
let cfg = &mut gcc::Config::new();
|
||||
|
||||
if target.contains("msvc") {
|
||||
cfg.define("__func__", Some("__FUNCTION__"));
|
||||
} else {
|
||||
cfg.flag("-fno-builtin");
|
||||
cfg.flag("-fomit-frame-pointer");
|
||||
cfg.flag("-ffreestanding");
|
||||
}
|
||||
|
||||
let mut sources = Sources::new();
|
||||
|
||||
sources.extend(&[
|
||||
"muldi3.c",
|
||||
"mulosi4.c",
|
||||
"mulodi4.c",
|
||||
"divsi3.c",
|
||||
"divdi3.c",
|
||||
"modsi3.c",
|
||||
"moddi3.c",
|
||||
"divmodsi4.c",
|
||||
"divmoddi4.c",
|
||||
"ashldi3.c",
|
||||
"ashrdi3.c",
|
||||
"lshrdi3.c",
|
||||
"udivdi3.c",
|
||||
"umoddi3.c",
|
||||
"udivmoddi4.c",
|
||||
"udivsi3.c",
|
||||
"umodsi3.c",
|
||||
"udivmodsi4.c",
|
||||
"adddf3.c",
|
||||
"addsf3.c",
|
||||
"powidf2.c",
|
||||
"powisf2.c",
|
||||
"subdf3.c",
|
||||
"subsf3.c",
|
||||
"floatsisf.c",
|
||||
"floatsidf.c",
|
||||
"floatdidf.c",
|
||||
"floatunsisf.c",
|
||||
"floatunsidf.c",
|
||||
"floatundidf.c",
|
||||
"fixsfsi.c",
|
||||
"fixsfdi.c",
|
||||
"fixdfsi.c",
|
||||
"fixdfdi.c",
|
||||
"fixunssfsi.c",
|
||||
"fixunssfdi.c",
|
||||
"fixunsdfsi.c",
|
||||
"fixunsdfdi.c",
|
||||
// 128 bit integers
|
||||
"lshrti3.c",
|
||||
"modti3.c",
|
||||
"muloti4.c",
|
||||
"multi3.c",
|
||||
"udivmodti4.c",
|
||||
"udivti3.c",
|
||||
"umodti3.c",
|
||||
"ashlti3.c",
|
||||
"ashrti3.c",
|
||||
"divti3.c",
|
||||
]);
|
||||
|
||||
let builtins_dir = Path::new("compiler-rt/lib/builtins");
|
||||
for src in sources.files.iter() {
|
||||
cfg.file(builtins_dir.join(src));
|
||||
}
|
||||
|
||||
cfg.compile("libcompiler-rt.a");
|
||||
|
||||
println!("cargo:rerun-if-changed=build.rs");
|
||||
|
||||
for source in sources.files.iter() {
|
||||
println!("cargo:rerun-if-changed={}", builtins_dir.join(source).display());
|
||||
}
|
||||
}
|
@ -1,126 +0,0 @@
|
||||
#![feature(lang_items)]
|
||||
#![no_std]
|
||||
|
||||
extern {
|
||||
fn __ashldi3();
|
||||
fn __ashrdi3();
|
||||
fn __divdi3();
|
||||
fn __divmoddi4();
|
||||
fn __divmodsi4();
|
||||
fn __divsi3();
|
||||
fn __lshrdi3();
|
||||
fn __moddi3();
|
||||
fn __modsi3();
|
||||
fn __muldi3();
|
||||
fn __mulodi4();
|
||||
fn __mulosi4();
|
||||
fn __udivdi3();
|
||||
fn __udivmoddi4();
|
||||
fn __udivmodsi4();
|
||||
fn __udivsi3();
|
||||
fn __umoddi3();
|
||||
fn __umodsi3();
|
||||
fn __addsf3();
|
||||
fn __adddf3();
|
||||
fn __powisf2();
|
||||
fn __powidf2();
|
||||
fn __subsf3();
|
||||
fn __subdf3();
|
||||
fn __floatsisf();
|
||||
fn __floatsidf();
|
||||
fn __floatdidf();
|
||||
fn __floatunsisf();
|
||||
fn __floatunsidf();
|
||||
fn __floatundidf();
|
||||
fn __fixsfsi();
|
||||
fn __fixsfdi();
|
||||
fn __fixdfsi();
|
||||
fn __fixdfdi();
|
||||
fn __fixunssfsi();
|
||||
fn __fixunssfdi();
|
||||
fn __fixunsdfsi();
|
||||
fn __fixunsdfdi();
|
||||
}
|
||||
|
||||
macro_rules! declare {
|
||||
($func:ident, $sym:ident) => {
|
||||
#[no_mangle]
|
||||
pub extern fn $func() -> usize {
|
||||
$sym as usize
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
declare!(___ashldi3, __ashldi3);
|
||||
declare!(___ashrdi3, __ashrdi3);
|
||||
declare!(___divdi3, __divdi3);
|
||||
declare!(___divmoddi4, __divmoddi4);
|
||||
declare!(___divmodsi4, __divmodsi4);
|
||||
declare!(___divsi3, __divsi3);
|
||||
declare!(___lshrdi3, __lshrdi3);
|
||||
declare!(___moddi3, __moddi3);
|
||||
declare!(___modsi3, __modsi3);
|
||||
declare!(___muldi3, __muldi3);
|
||||
declare!(___mulodi4, __mulodi4);
|
||||
declare!(___mulosi4, __mulosi4);
|
||||
declare!(___udivdi3, __udivdi3);
|
||||
declare!(___udivmoddi4, __udivmoddi4);
|
||||
declare!(___udivmodsi4, __udivmodsi4);
|
||||
declare!(___udivsi3, __udivsi3);
|
||||
declare!(___umoddi3, __umoddi3);
|
||||
declare!(___umodsi3, __umodsi3);
|
||||
declare!(___addsf3, __addsf3);
|
||||
declare!(___adddf3, __adddf3);
|
||||
declare!(___powisf2, __powisf2);
|
||||
declare!(___powidf2, __powidf2);
|
||||
declare!(___subsf3, __subsf3);
|
||||
declare!(___subdf3, __subdf3);
|
||||
declare!(___floatsisf, __floatsisf);
|
||||
declare!(___floatsidf, __floatsidf);
|
||||
declare!(___floatdidf, __floatdidf);
|
||||
declare!(___floatunsisf, __floatunsisf);
|
||||
declare!(___floatunsidf, __floatunsidf);
|
||||
declare!(___floatundidf, __floatundidf);
|
||||
declare!(___fixsfsi, __fixsfsi);
|
||||
declare!(___fixsfdi, __fixsfdi);
|
||||
declare!(___fixdfsi, __fixdfsi);
|
||||
declare!(___fixdfdi, __fixdfdi);
|
||||
declare!(___fixunssfsi, __fixunssfsi);
|
||||
declare!(___fixunssfdi, __fixunssfdi);
|
||||
declare!(___fixunsdfsi, __fixunsdfsi);
|
||||
declare!(___fixunsdfdi, __fixunsdfdi);
|
||||
|
||||
#[cfg(all(not(windows),
|
||||
not(target_arch = "mips64"),
|
||||
not(target_arch = "mips64el"),
|
||||
target_pointer_width="64"))]
|
||||
pub mod int_128 {
|
||||
extern {
|
||||
fn __lshrti3();
|
||||
fn __modti3();
|
||||
fn __muloti4();
|
||||
fn __multi3();
|
||||
fn __udivmodti4();
|
||||
fn __udivti3();
|
||||
fn __umodti3();
|
||||
fn __ashlti3();
|
||||
fn __ashrti3();
|
||||
fn __divti3();
|
||||
}
|
||||
|
||||
declare!(___lshrti3, __lshrti3);
|
||||
declare!(___modti3, __modti3);
|
||||
declare!(___muloti4, __muloti4);
|
||||
declare!(___multi3, __multi3);
|
||||
declare!(___udivmodti4, __udivmodti4);
|
||||
declare!(___udivti3, __udivti3);
|
||||
declare!(___umodti3, __umodti3);
|
||||
declare!(___ashlti3, __ashlti3);
|
||||
declare!(___ashrti3, __ashrti3);
|
||||
declare!(___divti3, __divti3);
|
||||
}
|
||||
|
||||
#[lang = "eh_personality"]
|
||||
fn eh_personality() {}
|
||||
#[lang = "panic_fmt"]
|
||||
fn panic_fmt() {}
|
@ -1,35 +0,0 @@
|
||||
#![feature(drop_types_in_const)]
|
||||
|
||||
extern crate libloading;
|
||||
|
||||
use std::sync::{Once, ONCE_INIT};
|
||||
use std::env;
|
||||
|
||||
use libloading::Library;
|
||||
|
||||
fn compiler_rt() -> &'static Library {
|
||||
let dir = env::current_exe().unwrap();
|
||||
let cdylib = dir.parent().unwrap().read_dir().unwrap().map(|c| {
|
||||
c.unwrap().path()
|
||||
}).find(|path| {
|
||||
path.file_name().unwrap().to_str().unwrap().contains("compiler_rt_cdylib")
|
||||
}).unwrap();
|
||||
|
||||
unsafe {
|
||||
static mut COMPILER_RT: Option<Library> = None;
|
||||
static INIT: Once = ONCE_INIT;
|
||||
|
||||
INIT.call_once(|| {
|
||||
COMPILER_RT = Some(Library::new(&cdylib).unwrap());
|
||||
});
|
||||
COMPILER_RT.as_ref().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get(sym: &str) -> usize {
|
||||
unsafe {
|
||||
let sym = format!("_{}", sym);
|
||||
let f: fn() -> usize = *compiler_rt().get(sym.as_bytes()).unwrap();
|
||||
f()
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
[package]
|
||||
authors = ["Jorge Aparicio <japaricious@gmail.com>"]
|
||||
name = "gcc_s"
|
||||
version = "0.1.0"
|
||||
|
||||
[dependencies]
|
||||
libloading = "0.3.0"
|
@ -1,39 +0,0 @@
|
||||
#![feature(drop_types_in_const)]
|
||||
|
||||
extern crate libloading;
|
||||
|
||||
use std::sync::{Once, ONCE_INIT};
|
||||
|
||||
use libloading::Library;
|
||||
|
||||
static mut GCC_S: Option<Library> = None;
|
||||
|
||||
#[cfg(not(windows))]
|
||||
fn gcc_s() -> &'static Library {
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
const LIBGCC_S: &'static str = "libgcc_s.so.1";
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
const LIBGCC_S: &'static str = "libgcc_s.1.dylib";
|
||||
|
||||
unsafe {
|
||||
static INIT: Once = ONCE_INIT;
|
||||
|
||||
INIT.call_once(|| {
|
||||
GCC_S = Some(Library::new(LIBGCC_S).unwrap());
|
||||
});
|
||||
GCC_S.as_ref().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
pub fn get(_sym: &str) -> Option<usize> {
|
||||
None
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
pub fn get(sym: &str) -> Option<usize> {
|
||||
unsafe {
|
||||
gcc_s().get(sym.as_bytes()).ok().map(|s| *s)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user