FS#47450 - [llvm] Alignment issue with wine and mesa nine

Attached to Project: Arch Linux
Opened by Christoph Haag (haagch) - Saturday, 19 December 2015, 23:36 GMT
Last edited by Laurent Carlier (lordheavy) - Sunday, 06 March 2016, 10:47 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Evangelos Foutras (foutrelis)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: See this bug report https://bugs.freedesktop.org/show_bug.cgi?id=93425

Tl;dr: when compiling llvm, gcc produces movaps instructions that access unaligned memory when used in combination with the nine state tracker.

One workaround is to add -mstackrealign to CFLAGS and CXXFLAGS, like wine did in https://bugs.archlinux.org/task/27560


Additional info:
* package version(s) 3.7.0

(I haven't actually tested the llvm version from the repositories, but https://github.com/iXit/Mesa-3D/issues/163#issuecomment-164061836 says, it happens with it too)
This task depends upon

Closed by  Laurent Carlier (lordheavy)
Sunday, 06 March 2016, 10:47 GMT
Reason for closing:  Upstream
Additional comments about closing:  Fixed with mesa 11.2 in Nine
Comment by Evangelos Foutras (foutrelis) - Sunday, 20 December 2015, 02:39 GMT
It seems to me that, similarly to the wine fix (is that even necessary since [1]?), the stack realignment needs to happen further up the call chain.

Adding -mstackrealign to LLVM or any other system library outside of wine and friends feels very wrong.

[1] http://source.winehq.org/git/wine.git/commitdiff/4adfb787f4e8c36a37ce1d53a7e6df16d03ecd8a
Comment by Melanie (zanny) - Sunday, 20 December 2015, 03:28 GMT
The mesagit lib32-llvm-libs-svn with mstackrealign fixes Nine for me.
Comment by Christoph Haag (haagch) - Sunday, 20 December 2015, 10:27 GMT
Having this fixed in wine would be better, of course, but considering they weren't very interested with the other issue either, I feel they won't do much about this one either, even more so since this *only* happens with nine as far as I can tell.

If it's only a small change in wine, perhaps archlinux or the nine project could include a patch.
Comment by Felix Yan (felixonmars) - Tuesday, 19 January 2016, 06:48 GMT
From upstream report: "False alarm I guess, I just tried your svn package and the upstream mesagit one and both are working now. Wondering what changed between last night when they announced that package was working and now..."

Is it still an issue here?
Comment by Melanie (zanny) - Tuesday, 19 January 2016, 15:01 GMT
Just tried it with mesagit and llvm-svn repos - Gallium Nine is still crashing on the alignment issue with llvm-svn/lib32-llvm-libs-svn 3.9.0svn_r258112-1 and still works fine with mesa-git/lib32-llvm-libs-svn 257992-1. The build date on the former is today at 10:40 UTC, so its still not working as of upstream four hours ago.
Comment by Christoph Haag (haagch) - Tuesday, 19 January 2016, 15:05 GMT
llvm in mesa-git should be compiled with -mstackrealign until there is a proper fix:
https://bbs.archlinux.org/viewtopic.php?pid=1587818#p1587818

For me the llvm packages from mesa-git work with nine.

Note that there may be other alignment issues with nine, for example when mesa is compiled with SSE (-march=native): https://github.com/iXit/Mesa-3D/issues/111

Loading...