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

Cannot compile with thin-lto on MinGW #145

Closed
clubby789 opened this issue Feb 22, 2024 · 1 comment
Closed

Cannot compile with thin-lto on MinGW #145

clubby789 opened this issue Feb 22, 2024 · 1 comment

Comments

@clubby789
Copy link

clubby789 commented Feb 22, 2024

This is a rustc issue, but I thought it might help to be aware of this 🙂
memchr@2.6.0+ does not link when using thin-lto on MinGW, due to the use of #[inline] on functions containing statics. The error this causes when using 2.6+ as a dependency of rustc std can be seen here

#[inline(always)]
pub(crate) fn memchr_raw(
n1: u8,
start: *const u8,
end: *const u8,
) -> Option<*const u8> {
// SAFETY: We provide a valid function pointer type.
unsafe_ifunc!(

static FN: AtomicPtr<()> = AtomicPtr::new(detect as Fn);

@BurntSushi
Copy link
Owner

Yeah I'm aware. If there's a simple patch to fix this, I'd accept it, but I otherwise don't think it's worth tracking here since it's already tracked on rustc.

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

No branches or pull requests

2 participants