-fstack-protector-strong breaks build of wine mainline with wine-tkg
How to reproduce:
git clone https://github.com/Tk-Glitch/PKGBUILDS.git
cd PKGBUILDS/wine-tkg-git/
# Newer commits force known sane flags as a workaround
git checkout f5ae929
# Set _LOCAL_PRESET in customization.cfg (line 22) to "mainline" at this point
makepkg -si
Results in error such as
/usr/lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld: usrmarshal.cross.o:usrmarshal.c:(.text+0x79): undefined reference to `__stack_chk_fail'
/usr/lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld: usrmarshal.cross.o:usrmarshal.c:(.text+0x116): undefined reference to `__stack_chk_fail'
/usr/lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld: usrmarshal.cross.o:usrmarshal.c:(.text+0x9b6): undefined reference to `__stack_chk_fail'
/usr/lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld: usrmarshal.cross.o:usrmarshal.c:(.rdata$.refptr.__stack_chk_guard[.refptr.__stack_chk_guard]+0x0): undefined reference to `__stack_chk_guard'
/usr/lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld: actxprxy_activscp_p.cross.o:actxprxy_activscp_p.c:(.text+0x635): undefined reference to `__stack_chk_fail'
/usr/lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld: actxprxy_activscp_p.cross.o:actxprxy_activscp_p.c:(.text+0x9a9): undefined reference to `__stack_chk_fail'
/usr/lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld: actxprxy_activscp_p.cross.o:actxprxy_activscp_p.c:(.text+0xc6e): undefined reference to `__stack_chk_fail'
/usr/lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld: actxprxy_activscp_p.cross.o:actxprxy_activscp_p.c:(.text+0xed8): undefined reference to `__stack_chk_fail'
/usr/lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld: actxprxy_activscp_p.cross.o:actxprxy_activscp_p.c:(.text+0x1148): undefined reference to `__stack_chk_fail'
/usr/lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld: actxprxy_activscp_p.cross.o:actxprxy_activscp_p.c:(.text+0x1411): more undefined references to `__stack_chk_fail' follow
collect2: error: ld returned 1 exit status
winegcc: x86_64-w64-mingw32-gcc failed
make[1]: *** [Makefile:1046: actxprxy.dll] Error 2
make[1]: Leaving directory '/home/username/git/tkg2/PKGBUILDS/wine-tkg-git/src/wine-tkg-git-clean-mainline-64-build/dlls/actxprxy'
make: *** [Makefile:9323: dlls/actxprxy] Error 2
==> ERROR: A failure occurred in build().
Aborting...
-> Removed BIG_UGLY_FROGMINER - Ribbit
-> Removed Proton-tkg token - Valve Ribbit
-> exit cleanup done
-> Compilation time for 64-bit wine:
real 1m9,933s
user 2m22,447s
sys 0m37,887s
After TkG could not reproduce on his Arch install we found that -fstack-protector-strong
was set on my machine but not on his. Further digging revealed that Arch dropped this flag back in January 2019 with c81d35.
Attached are three patches that mirror changes from upstream currently missing from makepkg.conf. The first two are just minor differences I saw while diffing. The third one fixes the problem this issue is about. Remaining differences are the dropping of CARCHFLAGS (is that still needed for Manjaro x32?), setting MAKEFLAGS as well as a comment fix. The later two might be candidates for upstreaming.
I'd have made this a pull request instead of an issue, but it doesn't look like my account has the permissions needed to create them.
0001-makepkg.conf-Add-shebang-to-indicate-bash-content.patch