emerge wine-20040716.ebuild: preloader.c:237: error: can't find a register in class `BREG' while reloading `asm' Reproducible: Always Steps to Reproduce: 1. cd /usr/portage/app-emulation/wine 2. emerge wine-20040716.ebuild Actual Results: make[1]: Entering directory `/var/tmp/portage/wine-20040716/work/wine-20040716/ loader' gcc -c -I. -I. -I../include -I../include -Wall -pipe -mpreferred-stack- boundary=2 -fno-strict-aliasing -gstabs+ -Wpointer- gcc -o wine-glibc glibc.o -L../libs/wine -lwine -L../libs/port -lwine_port - lpthread gcc -c -I. -I. -I../include -I../include -Wall -pipe -mpreferred-stack- boundary=2 -fno-strict-aliasing -gstabs+ -Wpointer- gcc -c -I. -I. -I../include -I../include -Wall -pipe -mpreferred-stack- boundary=2 -fno-strict-aliasing -gstabs+ -Wpointer- gcc -o wine-kthread -Wl,--export-dynamic -Wl,--section-start,.interp=0x77f00400 kthread.o main.o -L../libs/wine -lwine -L../l gcc -c -I. -I. -I../include -I../include -Wall -pipe -mpreferred-stack- boundary=2 -fno-strict-aliasing -gstabs+ -Wpointer- gcc -o wine-pthread -Wl,--export-dynamic -Wl,--section-start,.interp=0x77f00400 pthread.o main.o -L../libs/wine -lwine -L../l gcc -c -I. -I. -I../include -I../include -Wall -pipe -mpreferred-stack- boundary=2 -fno-strict-aliasing -gstabs+ -Wpointer- preloader.c: In function `wld_mmap': preloader.c:237: error: can't find a register in class `BREG' while reloading `asm' make[1]: *** [preloader.o] Error 1 make[1]: Leaving directory `/var/tmp/portage/wine-20040716/work/wine-20040716/ loader' make: *** [loader] Error 2 !!! ERROR: app-emulation/wine-20040716 failed. !!! Function src_compile, Line 61, Exitcode 2 !!! (no error message) Portage 2.0.50-r11 (default-x86-2004.0, gcc-3.3.4, glibc-2.3.3.20040420-r0, 2.4. 25-gentoo) ================================================================= System uname: 2.4.25-gentoo i686 Intel(R) Celeron(R) CPU 2.60GHz Gentoo Base System version 1.4.16 Autoconf: sys-devel/autoconf-2.59-r4 Automake: sys-devel/automake-1.8.5-r1 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-mcpu=pentium4 -O3 -pipe -fomit-frame-pointer -funroll-loops - mfpmath=sse -mmmx -msse" CHOST="i686-pc-linux-gnu" COMPILER="" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3/ share/config /usr/share/config /var/bind /var/ qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-mcpu=pentium4 -O3 -pipe -fomit-frame-pointer -funroll-loops - mfpmath=sse -mmmx -msse" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox" GENTOO_MIRRORS="<your_mirror_here> http://gentoo.osuosl.org http://gentoo. oregonstate.edu http://www.ibiblio.org/pub/Linux/di stributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="acpi alsa avi berkdb bitmap-fonts cdr crypt cups encode f77 gdbm gif hardened jpeg ldap mbox milter mmx mpeg ncurses nls oav oggvorbis pam perl png posix quicktime readline sasl sdl slang sse ssl svga tcpd tiff usb wmf x86 xprint zlib"
Hi Gentoo Wine Maintainers, I got this as well. Can you please add the patch to the Configure.in file to stop configure building the preloaded with -fstack-protector (which is enabled by default with hardened gentoo's gcc). cheers, Luke Taken from an upstream bug report: http://bugs.winehq.org/show_bug.cgi?id=2490 Summary: preloader.c does not compile with -fpie/-fstack- protector Product: Wine Version: CVS Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: wine-loader AssignedTo: wine-bugs <at> winehq.org ReportedBy: basic <at> mozdev.org preloader.c does not compile with -fpie/-fstack-protector since a June checkin with this comment: "Do direct Linux system calls in the preloader to avoid trouble with some broken static libcs." I get the following error: preloader.c: In function `wld_mmap': preloader.c:237: error: can't find a register in class `BREG' while reloading `asm' I suppose the assembly code in that file does not work with pie/stack-protector. My gcc compiles with stack-protector by default. If I edit the Makefile and add preloader.o: $(CC) -c -fno-pic -fno-stack-protector $(ALLCFLAGS) -o $ <at> preloader.c it will compile and run correctly.
upstream bug
*** Bug 69183 has been marked as a duplicate of this bug. ***
added proposed patch for preloader.o to 20041019, thanks
That patch doesn't seem to carry over into the Makefile. Furthermore, shouldn't -fno-stack-protector be after $(ALLCFLAGS), as -fstack-protector would otherwise take precedence?
Created attachment 42856 [details, diff] Patch based on winehq bug #2490 This one works for me.
this patch makes it impossible to build wine with gcc-3.4.4
Any gcc-3.4 actually.
There is a patch (wine-gentoo-no-ssp.patch) in Wine which points to this bug report but the patch is not attached here and this is shown as resolved upstream anyway. Is this actually fixed upstream and if so, why hasn't the patch already been removed from the ebuild?
the answer is obvious to people who understand how SSP works, but ive added a blurb to the top of the patch for everyone else