-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Missing symbol on Linux #107
Comments
If it helps. The problem seems to be related to building using the nightly toolchain. I build with the stable toolchain and everything works fine, when I build with the nightly toolchain I get this error. |
Another datapoint is that a binary cross-compiled on Mac for linux-x86_64 works fine. |
ubuntu 24 rustc 1.86.0-nightly (ad211ced8 2025-01-07)
use export RUSTFLAGS='-Z linker-features=-lld' will be ok more see https://blog.rust-lang.org/2024/05/17/enabling-rust-lld-on-linux.html |
I've inherited a project and I'm trying to compile and use it on Linux instead of MacOS.
There are several such declarations:
pub static ROLE_CHANGED_SERVER_EVENTS_LIST: [fn(&Context, ServerRole)] = [..];
Which are subsequently called thusly:
extern "C" fn role_changed_callback(
ctx: *mut raw::RedisModuleCtx,
_eid: raw::RedisModuleEvent,
subevent: u64,
_data: *mut ::std::os::raw::c_void,
) {
let new_role = if subevent == raw::REDISMODULE_EVENT_REPLROLECHANGED_NOW_MASTER {
ServerRole::Primary
} else {
ServerRole::Replica
};
let ctx = Context::new(ctx);
ROLE_CHANGED_SERVER_EVENTS_LIST.iter().for_each(|callback| {
callback(&ctx, new_role);
});
}
All of this works fine under MacOS, but when we try to load the module in Linux we receive an error that the following symbol is missing:
__start_linkme_ROLE_CHANGED_SERVER_EVENTS_LIST
Thanks
The text was updated successfully, but these errors were encountered: