Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 66002 - emerge wine-20040716.ebuild: preloader.c:237: error: can't find a register in class `BREG' while reloading `asm'
Summary: emerge wine-20040716.ebuild: preloader.c:237: error: can't find a register in...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Wine Maintainers
URL: http://bugs.winehq.org/show_bug.cgi?i...
Whiteboard:
Keywords:
: 69183 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-10-01 02:42 UTC by vyp08
Modified: 2008-12-25 21:15 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch based on winehq bug #2490 (20041019-no-stack.patch,406 bytes, patch)
2004-10-29 10:04 UTC, Anders Hellgren
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description vyp08 2004-10-01 02:42:19 UTC
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"
Comment 1 Luke McKinlay 2004-10-04 05:51:41 UTC
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.
Comment 2 SpanKY gentoo-dev 2004-10-27 05:50:58 UTC
upstream bug
Comment 3 SpanKY gentoo-dev 2004-10-27 18:24:52 UTC
*** Bug 69183 has been marked as a duplicate of this bug. ***
Comment 4 SpanKY gentoo-dev 2004-10-27 18:34:52 UTC
added proposed patch for preloader.o to 20041019, thanks
Comment 5 Anders Hellgren gentoo-dev 2004-10-29 10:00:23 UTC
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?
Comment 6 Anders Hellgren gentoo-dev 2004-10-29 10:04:31 UTC
Created attachment 42856 [details, diff]
Patch based on winehq bug #2490

This one works for me.
Comment 7 Grzegorz Artur Daszuta 2005-07-12 08:11:03 UTC
this patch makes it impossible to build wine with gcc-3.4.4
Comment 8 FieldySnuts 2005-10-16 07:43:40 UTC
Any gcc-3.4 actually.
Comment 9 Seppo Yli-Olli 2008-12-21 12:53:21 UTC
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?
Comment 10 SpanKY gentoo-dev 2008-12-25 21:15:24 UTC
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