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

[build] Use -mpreferred-stack-boundary=2 on 32-bit x86 #4633

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

ventureoo
Copy link
Contributor

@ventureoo ventureoo commented Jan 21, 2025

I know DXVK doesn't officially support AVX builds, but I'd still like to suggest this flag to fix stack alignment issues when using mingw, since apparently i686-w64-mingw32 assumes that stack alignment is 16-bit when SSE is used, which is incorrect and causes game crashing issues. Wine experienced similar issues and added this flag about a year ago to workaround them by ensuring that the stack alignment is always 4 bytes, please see for more details:

https://gitlab.winehq.org/wine/wine/-/merge_requests/4030
https://gitlab.winehq.org/wine/wine/-/commit/4b458775bb8c9492ac859cfd167c5f54f245dec1

I'm fine if there any concerns why this can't be merged, as I realize that stack alignment issues need to be fixed either on the compiler side or by more courteous code, but it's too hard to debug, and things like #4627 were more about luck.

Fixes: #4447 (Not tested in Arma 3, but at least confirmed in Company Of Heroes 1)

Copy link
Owner

@doitsujin doitsujin left a comment

Choose a reason for hiding this comment

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

No complaints from my side, although I'm kind of surprised this hasn't bitten us yet, GCC somehow only seems to emit unaligned SSE loads and stores anyway.

@doitsujin doitsujin merged commit 84ccad3 into doitsujin:master Jan 21, 2025
4 checks passed
@ventureoo ventureoo deleted the preferred-stack-boundary branch January 21, 2025 20:59
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.

Compiling latest dxvk with -march=native (znver2) causes games to crash
2 participants