https://bugs.winehq.org/show_bug.cgi?id=52420
Bug ID: 52420 Summary: Wine 7.0 Release Compiled with Clang on Arch Produces a Broken Build Product: Wine Version: 7.0 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: critical Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: nekoNexus@protonmail.ch Distribution: ---
Created attachment 71674 --> https://bugs.winehq.org/attachment.cgi?id=71674 Arch PKGBUILD File for Wine 7.0 Release
Using the default Arch makepkg flags (from /etc/makepkg.conf - by default this uses GCC so the user either has to change this to Clang or export to Clang in the PKGBUILD), using this example PKGBUILD produces a WoW64 build but throws stack overflow errors upon calling winecfg and doesn't run winecfg.
The same is true if all of the miscellaneous variables exported along with Clang are not set; this will still occur. Un-setting lld and/or any of the llvm variables bakes no difference.
This topic also has a page an the Arch forums: https://bbs.archlinux.org/viewtopic.php?id=273313
https://bugs.winehq.org/show_bug.cgi?id=52420
nekoNexus@protonmail.ch changed:
What |Removed |Added ---------------------------------------------------------------------------- Distribution|--- |ArchLinux
https://bugs.winehq.org/show_bug.cgi?id=52420
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4@web.de
--- Comment #1 from Fabian Maurer dark.shadow4@web.de --- I usually use the following configure:
PKG_CONFIG_PATH=/usr/lib32/pkgconfig CC="clang" CFLAGS="-O3" ../wine-git/configure --without-cups --without-mingw
This works for me when compiling 32bit wine from source. Can you try if that works for you as well? Or what you make different?
https://bugs.winehq.org/show_bug.cgi?id=52420
--- Comment #2 from nekoNexus@protonmail.ch --- Over here I go over exactly what was different; this other issue is for GCC specifically but the same PKGBUILD is used and I explain that the variables are all reset in the PKGBUILD and the only things that seem to be different are the CFLAGS: https://bugs.winehq.org/show_bug.cgi?id=52419#c7
https://bugs.winehq.org/show_bug.cgi?id=52420
--- Comment #3 from nekoNexus@protonmail.ch --- For that other issue, the -fno-plt flag was the problem; however, removing it doesn't fix compiling with Clang.
https://bugs.winehq.org/show_bug.cgi?id=52420
--- Comment #4 from nekoNexus@protonmail.ch --- To clarify again, it *does* compile, it just doesn't run
https://bugs.winehq.org/show_bug.cgi?id=52420
nekoNexus@protonmail.ch changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #71674|0 |1 is obsolete| |
--- Comment #5 from nekoNexus@protonmail.ch --- Created attachment 71681 --> https://bugs.winehq.org/attachment.cgi?id=71681 Arch PKGBUILD File for Wine 7.0 Release
I managed to get the stack overflow errors to go away but it still doesn't run clang builds. :/
https://bugs.winehq.org/show_bug.cgi?id=52420
nekoNexus@protonmail.ch changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Wine 7.0 Release Compiled |Wine 7.0 WoW64 Release |with Clang on Arch Produces |Compiled with Clang on Arch |a Broken Build |Produces a Broken Build
https://bugs.winehq.org/show_bug.cgi?id=52420
nekoNexus@protonmail.ch changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |source
https://bugs.winehq.org/show_bug.cgi?id=52420
nekoNexus@protonmail.ch changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #71681|0 |1 is obsolete| |
--- Comment #6 from nekoNexus@protonmail.ch --- Created attachment 71693 --> https://bugs.winehq.org/attachment.cgi?id=71693 Arch PKGBUILD File for Wine 7.0 Release
So, I managed to narrow it down a bit but not completely (I'm also updating the attachment with my findings for Arch makepkg repoduction):
- If the clang build is pure clang, it will compile, but won't run (tested by running winecfg)
- If the the clang build has mingw enabled, it will compile, but only if ld is used and lld isn't used
- If mingw is enabled with a clang build, relro can't be used because mingw's ld doesn't like the "-z" argument for whatever reason
- If the build succeeds with Clang and mingw (which it always will, provided the above two points are followed), the resulting WoW64 build will run but will throw one stack overflow error
- If certain CFLAGS are passed to clang, the resulting build will throw 3 stack overflow errors; an example would be something like this:
export CFLAGS="-O3 -pipe -fno-plt -minline-all-stringops -fexceptions -Wall \ -Wformat -Werror=format-security \ -fstack-clash-protection -fcf-protection"
-----
That said, as a reminder, even with the stack overflow errors Wine will still run but a few things are made clear:
- Pure clang builds have some kind of problem preventing use, even with simple flag setups like: "-O3 -pipe -std=gnu89"
- Clang + mingw builds run but I wouldn't trust a build spontaneously throwing overflow errors
and
- Clang + mingw builds require compromising relro
https://bugs.winehq.org/show_bug.cgi?id=52420
--- Comment #7 from nekoNexus@protonmail.ch ---
- If certain CFLAGS are passed to clang, the resulting build will throw 3
stack overflow errors; an example would be something like this:
export CFLAGS="-O3 -pipe -fno-plt -minline-all-stringops -fexceptions -Wall \ -Wformat -Werror=format-security \ -fstack-clash-protection -fcf-protection"
Sorry, I actually meant:
export CFLAGS="-O3 -pipe -fexceptions -Wall \ -Wformat -Werror=format-security \ -fstack-clash-protection -fcf-protection"
https://bugs.winehq.org/show_bug.cgi?id=52420
--- Comment #8 from Ken Sharp imwellcushtymelike@gmail.com --- Does this still occur in the latest version of Wine?