AndreRH / hangover

Hangover runs simple Win32 applications on arm64 Linux
GNU Lesser General Public License v2.1
1.24k stars 91 forks source link

Problems linking with libssp #119

Closed cwabbott0 closed 1 year ago

cwabbott0 commented 2 years ago

System Details

Fedora 33, compiling and running on aarch64.

Problems Description

I can almost build hangover without any patches, but I have one last annoying problem: fedora apparently decided to enable -fstack-protector when compiling some built-in static libs in the mingw toolchain, which results in libssp symbols polluting whatever you compile from those static lib and subsequent linker errors. This includes some pieces in libxml2, libxslt, and guest wine. Wine is especially annoying because it explicitly doesn't support stack protectors and passes -fno-stack-protector. I found someone pointing this out on this thread: https://www.spinics.net/lists/fedora-devel/msg275591.html ("Whatever changed in GCC 10 for mingw, appears to have made the stack-protector stuff mandatory, which feels quite wrong.") but no answer. This is less of a problem when building wine on x86 because mingw is considered the cross-compiler (CROSSCC) and -fno-stack-protector only gets added to the host compiler, so I think the fedora builds just pass -fstack-protector in CFLAGS and it doesn't get overridden for non-winelib DLL's.

Right now I added HANGOVER_MINGW_LDFLAGS env variable where I pass -lssp. That kinda works, I guess. But would it be possible instead to make the guest wine builds just use x86_64-linux-gnu-gcc as the "host" compiler on aarch64? That would additionally work around another issue I've seen where builds with a mingw "host" don't work.

AndreRH commented 1 year ago

irrelevant with new Hangover approach