Skip to content

Conversation

@stratakis
Copy link
Contributor

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

@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
Contributor 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
Contributor 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.

@r-devulap
Copy link
Member

Please rebase to run the CI.

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.
@stratakis stratakis force-pushed the fix_x86_64_gcc_16_build branch from cb42dd6 to 4273453 Compare January 30, 2026 13:16
@r-devulap
Copy link
Member

Thanks @stratakis!

@r-devulap r-devulap merged commit 5adb334 into numpy:main Jan 30, 2026
12 of 13 checks passed
@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?

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

See numpy/numpy#30747

@stratakis stratakis deleted the fix_x86_64_gcc_16_build branch January 31, 2026 01:53
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