right! non-cdylibs dylibs exist. neat!

This commit is contained in:
khyperia 2020-09-15 16:03:26 +02:00
parent d6a1e0372f
commit fd1471066d
5 changed files with 5 additions and 7 deletions

View File

@ -5,7 +5,7 @@ authors = ["Ashley Hauck <ashley.hauck@embark-studios.com>"]
edition = "2018"
[lib]
crate-type = ["cdylib"]
crate-type = ["dylib"]
[dependencies]
spirv-std = { path = "../../spirv-std" }

View File

@ -5,8 +5,7 @@
use core::panic::PanicInfo;
use spirv_std::Private;
#[no_mangle]
pub extern "C" fn screaming_bananans(mut x: Private<u32>) {
pub fn screaming_bananans(mut x: Private<u32>) {
x.store(x.load() + 1);
}

View File

@ -9,7 +9,6 @@
"exe-suffix": ".spv",
"crt-static-allows-dylibs": true,
"dynamic-linking": true,
"only-cdylib": true,
"emit-debug-gdb-scripts": false,
"env": "",
"executables": true,

View File

@ -331,7 +331,7 @@ impl WriteBackendMethods for SpirvCodegenBackend {
impl ExtraBackendMethods for SpirvCodegenBackend {
fn new_metadata(&self, _: TyCtxt<'_>, _: &str) -> Self::Module {
todo!()
Self::Module::new()
}
fn write_compressed_metadata<'tcx>(
@ -340,7 +340,7 @@ impl ExtraBackendMethods for SpirvCodegenBackend {
_: &EncodedMetadata,
_: &mut Self::Module,
) {
todo!()
// Ignore for now.
}
fn codegen_allocator<'tcx>(&self, _: TyCtxt<'tcx>, _: &mut Self::Module, _: AllocatorKind) {

View File

@ -58,7 +58,7 @@ pub fn link<'a>(
CrateType::Rlib => {
link_rlib(codegen_results, &out_filename);
}
CrateType::Executable | CrateType::Cdylib => {
CrateType::Executable | CrateType::Cdylib | CrateType::Dylib => {
link_exe(sess, crate_type, &out_filename, codegen_results)
}
other => panic!("CrateType {:?} not supported yet", other),