mmastrac / rust-ctor

Module initialization/global constructor functions for Rust
Apache License 2.0
739 stars 49 forks source link

The #[link_section] setup generates LLVM error `unsupported relocation of variable` on MacOS with -Zsanitizer=address #290

Closed danakj closed 1 year ago

danakj commented 1 year ago

https://bugs.chromium.org/p/chromium/issues/detail?id=1459686

Replacing #[link_section="__DATA,__mod_init_func"] with #[link_section="__DATA_CONST,__mod_init_func"] resolves the error.

We're using small_ctor in Chromium at the moment, but it uses the same setup.

mmastrac commented 1 year ago

Thanks for the report. Released as 0.2.3.

danakj commented 1 year ago

Thank you :)