Very similar to #27. I am opening it to ask for help in understanding what exactly doesn't work here.
I have a project with the following structure:
- Rust library which uses
ctor;
- static C API library, which is compiled by
cargo and cbindgen and depends on the Rust library with ctor
When C API library is built in release mode and linked to the executable binary then ctor is successfully called on start. If library is build in debug mode then ctor function is not included into the final binary by the linker while it is still present in a static library itself.
I use absolutely same minimal gcc options to try both debug and release:
gcc ./main.c -o ./debug -I. -L./c/target/debug -l:libhyperonc.a -lm
I have tried to repeat the issue building a minimal example from scratch but in minimal example it works correctly.
Platform: Linux x86_64
ctor version 0.2.0
Rust version 1.69.0
GCC version 12.2.1
LD version 2.40
Very similar to #27. I am opening it to ask for help in understanding what exactly doesn't work here.
I have a project with the following structure:
ctor;cargoandcbindgenand depends on the Rust library withctorWhen C API library is built in
releasemode and linked to the executable binary thenctoris successfully called on start. If library is build indebugmode thenctorfunction is not included into the final binary by the linker while it is still present in a static library itself.I use absolutely same minimal
gccoptions to try bothdebugandrelease:I have tried to repeat the issue building a minimal example from scratch but in minimal example it works correctly.
Platform: Linux x86_64
ctor version 0.2.0
Rust version 1.69.0
GCC version 12.2.1
LD version 2.40