Prevent linker from stripping exports on Linux (#33)

This commit is contained in:
Andrzej Janik 2021-01-15 01:17:44 +01:00 committed by GitHub
parent 5cd9a5fbc4
commit 09f679693b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -11,6 +11,6 @@ extern crate paste;
extern crate ptx;
#[allow(warnings)]
mod cuda;
pub mod cuda;
mod cuda_impl;
pub(crate) mod r#impl;

View file

@ -1,3 +1,11 @@
pub extern crate zluda;
pub use zluda::*;
pub use zluda::cuda::*;
// For some reason, on Linux linker strips out all our re-exports,
// there's probably a cleaner solution, but for now just exporting
// the function below stops it from doing so
#[no_mangle]
fn _zluda_very_bad_linker_hack() {
cuInit(0);
}