Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 129605

Summary: emerge with distcc fails with "can't find a register in class `BREG' while reloading `asm'"
Product: Gentoo Linux Reporter: Yang Zhao <yang>
Component: Current packagesAssignee: Lisa Seelye (RETIRED) <lisa>
Status: VERIFIED NEEDINFO    
Severity: minor CC: base-system, trey
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Yang Zhao 2006-04-11 10:19:36 UTC
*snip*

gpt.c: In function `is_gpt_valid':
gpt.c:306: warning: integer constant is too large for "long" type
partx.c: In function `getblock':
partx.c:343: error: can't find a register in class `BREG' while reloading `asm'
distcc[8126] ERROR: compile partx.c on sui/1 failed
make: *** [partx.o] Error 1

!!! ERROR: sys-apps/util-linux-2.12r-r3 failed.
!!! Function src_compile, Line 139, Exitcode 2
!!! make partx failed
!!! If you need support, post the topmost build error, NOT this status message.


Host with error is a pentium-M, while participating distcc client is a i586 P3.

The problem does not occur for util-linux compiled on the P3.


emerge --info for host experiencing problem:
Gentoo Base System version 1.6.14
Portage 2.0.54 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r2, 2.6.15-gentoo-r1 i686)
=================================================================
System uname: 2.6.15-gentoo-r1 i686 Intel(R) Pentium(R) M processor 1700MHz
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium-m -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium-m -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distcc distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://sui/portage/ http://gentoo.mirrored.ca http://modzer0.cs.uaf.edu/public/gentoo/ "
LANG="en_CA.UTF-8"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://sui/gentoo-portage"
USE="x86 X aalib acl acpi alsa apache2 apm audiofile avi bash-completion berkdb bitmap-fonts bonobo bzip2 c++ cairo cdr cjk crypt cups curl dbus dvd dvi eds emboss encode exif expat fam flac foomaticdb fortran gdbm gif gimpprint glut gnome gpm gtk gtk2 gtkhtml guile imagemagick imlib ipv6 java joystick jpeg junit latex lcms libcaca libg++ libwww mad matroska mikmod mmx mng motif mozsvg mp3 mpeg mysql nautilus ncurses nls nptl nptlonly nsplugin ogg oggvorbis opengl pam pcmcia pdflib perl png ppds python quicktime readline real samba sdl slang spell sse sse2 ssl svg svga tcpd tetex tiff truetype truetype-fonts type1-fonts udev unicode usb utf8 vorbis wmf xml xml2 xmms xosd xprint xv xvid zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LC_ALL, LDFLAGS, LINGUAS


emerge --info for distcc participating host:
Gentoo Base System version 1.6.14
Portage 2.0.54 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r2, 2.6.14-hardened-r1 i686)
=================================================================
System uname: 2.6.14-hardened-r1 i686 Pentium III (Coppermine)
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -mtune=pentium3 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -mtune=pentium3 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distcc distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://modzer0.cs.uaf.edu/public/gentoo/ http://gentoo.asgn.ca/"
LANG="en_CA.UTF-8"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X aalib acpi apache2 apm audiofile avi bash-completion berkdb bitmap-fonts bzip2 cairo cjk crypt cups curl eds emboss encode expat foomaticdb fortran gdbm gif gpm gstreamer gtk gtk2 hardened hardenedphp imlib ipv6 java jpeg lcms libcaca libg++ libwww mad mhash mikmod ming mmx mng motif mozilla mp3 mpeg mysql ncurses nls nptl nptlonly ogg oggvorbis opengl pam pcre pdflib perl php png ppds python quicktime readline samba sdl slang spell sse sse2 ssl svga tcpd tetex tiff truetype truetype-fonts type1-fonts udev unicode usb vorbis xml xml2 xmms xprint xv zip zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 1 Trey Boudreau 2006-04-24 12:00:52 UTC
This fails because 'distcc-config --install' creates symlinks which don't give enough information for cross-compiled tool chains.  http://www.gentoo.org/doc/en/cross-compiling-distcc.xml describes a work-around which probably ought to replace the creation of the non-CHOST symlinks in distcc-config.
Comment 2 Yang Zhao 2006-04-24 17:12:06 UTC
(In reply to comment #1)
> http://www.gentoo.org/doc/en/cross-compiling-distcc.xml describes a work-around

Thanks for that.


However, I should note that I screwed up a little in the original summary: both systems are i686, but one is pentium-m and the other pentium3. So, there doesn't seem to be any actual "cross compiling", but the distcc client is choking on unknown assembly optimizations.
Comment 3 Trey Boudreau 2006-04-24 18:23:56 UTC
It seems you have some other problem, then.  Perhaps the register allocation changes for non-hardened vs. hardened platforms.  The 'equery uses gcc' output for both systems might prove useful.  As far as I can tell, distcc and CHOST don't have any way to show the hardened status, or to choose a compiler based upon it.
Comment 4 Yang Zhao 2006-04-29 15:25:59 UTC
Occurs with glibc also.

I'm changing bug summary to a more generic one.

*snip*
gconv_cache.c: In function `__gconv_load_cache':
gconv_cache.c:75: error: can't find a register in class `BREG' while reloading `asm'
gconv_cache.c:112: error: can't find a register in class `BREG' while reloading `asm'
distcc[14790] ERROR: compile gconv_cache.c on sui/1 failed
make[2]: *** [/var/tmp/portage/glibc-2.3.6-r3/work/build-default-i686-pc-linux-gnu-nptl/iconv/gconv_cache.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/var/tmp/portage/glibc-2.3.6-r3/work/glibc-2.3.6/iconv'
make[1]: *** [iconv/subdir_lib] Error 2
make[1]: Leaving directory `/var/tmp/portage/glibc-2.3.6-r3/work/glibc-2.3.6'
make: *** [all] Error 2

!!! ERROR: sys-libs/glibc-2.3.6-r3 failed.
!!! Function toolchain-glibc_src_compile, Line 258, Exitcode 2
!!! make for default failed
!!! If you need support, post the topmost build error, NOT this status message.
Comment 5 Lisa Seelye (RETIRED) gentoo-dev 2006-05-06 07:53:48 UTC
Please disable --fomit-frame-pointer and try again:

       -fomit-frame-pointer
           Don't keep the frame pointer in a register for functions that don't
           need one.  This avoids the instructions to save, set up and restore
           frame pointers; it also makes an extra register available in many
           functions.  It also makes debugging impossible on some machines.

You may also want to disable sse2 USE flag since P3s don't offer that.
Comment 6 Yang Zhao 2006-05-07 22:59:35 UTC
Curious: is this clearly a deficiency of distcc or is there an actual bug that's happening?

The pentium-m system has had everything in it compiled using distcc, and the problem only occurs in a few select packages. It's trivial to work around, so I'm not worried too much about it, but it would be nice to see it fixed.

As for the --fomit-frame-pointer test, I'll try doing that on one of the smaller affected packages later this week.
Comment 7 Lisa Seelye (RETIRED) gentoo-dev 2006-05-08 08:54:57 UTC
I've had this BREG thing come up before even when not using distcc. It leeds me to believe there's something funky going on somewhere. See bug 43964 for this showing up without distcc being used.  It could be that on your volunteer it may be using the hardened-gcc?
Comment 8 Lisa Seelye (RETIRED) gentoo-dev 2006-09-04 04:20:29 UTC
nothing heard since last comment
Comment 9 Yang Zhao 2007-04-06 22:04:33 UTC
Sorry for the lack of updates on this.

I actually no longer have the hardware to try and reproduce problem on (laptop powersupply fried), so I'm going to go ahead and close it.