Skip to content

Commit

Permalink
Fix for release builds (issue neon-bindings#362)
Browse files Browse the repository at this point in the history
During link-time optimization (particularly when you build with --release)
linker removes unused static symbol `__LOAD_NEON_MODULE`.

I forced it to be used to avoid such incorrect behavior.
  • Loading branch information
katyo committed Jan 28, 2019
1 parent 6a5d91c commit 3319c6c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ macro_rules! register_module {
#[cfg_attr(target_os = "linux", link_section = ".ctors")]
#[cfg_attr(target_os = "macos", link_section = "__DATA,__mod_init_func")]
#[cfg_attr(target_os = "windows", link_section = ".CRT$XCU")]
#[used]
pub static __LOAD_NEON_MODULE: extern "C" fn() = {
fn __init_neon_module($module: $crate::context::ModuleContext) -> $crate::result::NeonResult<()> $init

Expand Down

0 comments on commit 3319c6c

Please sign in to comment.