Skip to content
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

This crate depends on libc, but doesn't declare that dependency #85

Closed
petrochenkov opened this issue Nov 14, 2022 · 1 comment · Fixed by #86
Closed

This crate depends on libc, but doesn't declare that dependency #85

petrochenkov opened this issue Nov 14, 2022 · 1 comment · Fixed by #86

Comments

@petrochenkov
Copy link

It refers to atexit in particular.

Unless some other crate pulls libc accidentally you get a linking error like this when using this crate.

[INFO] [stdout]   = note: /usr/bin/ld: /opt/rustwide/target/debug/deps/liblibmimalloc_sys-1551225da21123ef.rlib(static.o): in function `mi_process_load':
[INFO] [stdout]           /opt/rustwide/cargo-home/registry/src/github.com-1ecc6299db9ec823/libmimalloc-sys-0.1.26/c_src/mimalloc/src/init.c:533: undefined reference to `atexit'
[INFO] [stdout]           collect2: error: ld returned 1 exit status

This was found when testing some linking order changes in rustc in rust-lang/rust#102832 (comment) (build failure - https://crater-reports.s3.amazonaws.com/pr-102832-1/try%230c94de7c1a8f4b82b92d562847c35f513f520c7a/reg/mimalloc-0.1.30/log.txt).

@thomcc
Copy link
Contributor

thomcc commented Nov 14, 2022

Plausibly cc should link libc in when compiling C code (as it does for c++'s stdlib when compiling c++), but I suppose that might break some use cases.

Either way, a patch would probably be welcome here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants