Skip to content

Conversation

@stratakis
Copy link

Remove always_inline from STDSortComparator. This function is passed to std::sort, and GCC 16 rejects forced inlining when the caller and callee have mismatched target attributes during LTO.

This occurs when the library is used via the header-only static include with multiple dispatch targets (e.g. AVX-512 and baseline) linked together, as NumPy does.

Standalone builds are unaffected since they use -march=skylake-avx512 for the entire translation unit.

Fixes: #224

Remove always_inline from STDSortComparator. This function is passed
to std::sort, and GCC 16 rejects forced inlining when the caller and
callee have mismatched target attributes during LTO.

This occurs when the library is used via the header-only static include
with multiple dispatch targets (e.g. AVX-512 and baseline) linked
together, as NumPy does.

Standalone builds are unaffected since they use -march=skylake-avx512
for the entire translation unit.
@r-devulap
Copy link
Member

HI @stratakis thanks for reporting the issue and patching it up! Happy to merge this as soon as the CI passes. I am assuming NumPy needs an update after merging this one?

@stratakis
Copy link
Author

HI @stratakis thanks for reporting the issue and patching it up! Happy to merge this as soon as the CI passes. I am assuming NumPy needs an update after merging this one?

Yes, numpy bundles it, so it will need an update.

@r-devulap r-devulap closed this Jan 25, 2026
@r-devulap r-devulap reopened this Jan 25, 2026
@r-devulap
Copy link
Member

Close/open to trigger CI runs. Not sure why they didnt find a runner.

@r-devulap
Copy link
Member

ah, I need to port commits 4e209f1 and 3c007d7

@stratakis
Copy link
Author

Also something I'd like to point out is that this file has mixed windows line endings and linux ones (CRLF and LF). Working on Linux it was a bit of a pain, as git by default does conversions of line endings on changes. Not sure if important, but if Linux is the main target you might wanna consider converting everything to LF?

@r-devulap
Copy link
Member

but if Linux is the main target you might wanna consider converting everything to LF?

Yes, linux is the main target and I do want to get that fixed in a separate PR. Feel free to add a commit to this PR, if you would like.

Also, please rebase when #226 is merged in a few minutes.

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 this pull request may close these issues.

Build failure with GCC 16.0.1 and LTO (NumPy)

2 participants