Skip to content

Fix illegal instruction on x86_64 CPUs without AVX2 support #1099

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mkannwischer
Copy link
Contributor

Fixes #1086

This PR prevents illegal instruction errors on x86_64 CPUs that don't support AVX2 by:

  • Removing automatic AVX2 flags from for all x86_64 systems
  • Adding explicit AVX2 flags to CI workflows for x86_64 systems using nix-shell

The fix ensures compatibility with older x86_64 CPUs while maintaining optimized builds in controlled CI environments.

Fixes #1086

Remove automatic AVX2 flags from auto.mk for all x86_64 systems and add
explicit AVX2 flags to CI workflows for x86_64 systems using nix-shell.

Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
@@ -5,7 +5,6 @@
# Native compilation
ifeq ($(CROSS_PREFIX),)
ifeq ($(HOST_PLATFORM),Linux-x86_64)
CFLAGS += -mavx2 -mbmi2 -mpopcnt -maes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we not want to try to detect if the host platform supports AVX2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would you detect it?

I think gcc should do the right thing by default in most setups.
In nix it doesn't which is why we need to pass explicit flags.

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.

Test fails with Illegal instruction (core dumped) on x86_64 machine without AVX2
2 participants