-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with loading native modules which built with --release #362
Comments
Link to rust issue rust-lang/rust#54691 |
I found temporary workaround.
#[no_mangle]
pub extern "C" fn node_addon_init() {
__LOAD_NEON_MODULE();
}
register_module!(mut cx, {
// your module code
} The
"scripts": {
"install": "RUSTFLAGS='-C link-arg=-Wl,-init=node_addon_init' neon build --release",
}, This solution uses ".init" section instead of ".ctors"/".init_array". See https://github.com/katyo/ledb/tree/master/ledb-node |
katyo
added a commit
to katyo/ledb
that referenced
this issue
Oct 1, 2018
katyo
added a commit
to katyo/neon
that referenced
this issue
Jan 28, 2019
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.
This was fixed in #392. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
neon build --release
produces broken NodeJS native modules:I understand, this is possibly a Cargo/Rust problem related to inapproppriate config.
Experimentally I found that it actual for all opt-level's > 0
But I don't know a proper solution.
The text was updated successfully, but these errors were encountered: