Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 29958 - libcap emerge error: can't find a register in class `BREG' while reloading
Summary: libcap emerge error: can't find a register in class `BREG' while reloading
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High blocker (vote)
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-29 15:29 UTC by Arent Groebner
Modified: 2003-10-03 09:58 UTC (History)
1 user (show)

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


Attachments
Full log (out.txt,10.40 KB, text/plain)
2003-09-29 15:58 UTC, Arent Groebner
Details
Proprietary SuSE loop_fish2 encryption module (loop_fish2.c,17.44 KB, text/plain)
2003-09-30 01:08 UTC, Arent Groebner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arent Groebner 2003-09-29 15:29:53 UTC
Emerging of libcap fails. 

Reproducible: Always
Steps to Reproduce:
1. emerge -U libcap 
2. 
3. 
Actual Results:  
cap_sys.c:16: error: can't find a register in class `BREG' while reloading 
`asm' 
cap_sys.c: In function `capset': 
cap_sys.c:20: warning: traditional C rejects ISO C style function definitions 
make[1]: *** [cap_sys.o] Error 1 
make[1]: Leaving directory `/var/tmp/portage/libcap-1.10/work/libcap-1.10/
libcap                                                                                                   
' 
make: *** [all] Error 2 
 
!!! ERROR: sys-libs/libcap-1.10 failed. 
!!! Function src_compile, Line 43, Exitcode 2 
!!! (no error message) 

Expected Results:  
Clean install. 

Portage 2.0.49-r3 (default-x86-1.4, gcc-3.3.1, glibc-2.3.2-r1, 
2.4.20-gentoo-r7) 
================================================================= 
System uname: 2.4.20-gentoo-r7 i686 AMD Athlon(tm) XP 2500+ 
ACCEPT_KEYWORDS="x86" 
AUTOCLEAN="yes" 
CFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer -fPIC" 
CHOST="i686-pc-linux-gnu" 
COMPILER="gcc3" 
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/
share/config /usr/X11R6/lib/X11/xkb /opt/tomcat/conf /usr/kde/3.2/share/
config /usr/kde/3.1/share/config /usr/share/texmf/tex/generic/config/ /usr/
share/texmf/tex/platex/config/ /usr/share/config" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" 
CXXFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer -fPIC" 
DISTDIR="/usr/portage/distfiles" 
FEATURES="sandbox ccache autoaddcvs" 
GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/
Linux/distributions/gentoo" 
MAKEOPTS="-j2" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR="/usr/portage" 
PORTDIR_OVERLAY="" 
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" 
USE="oss apm encode foomaticdb libg++ mad mikmod ncurses nls quicktime spell 
xv gtkhtml gdbm berkdb slang readline tetex bonobo svga tcltk guile sdl gpm 
tcpd pam libwww ssl perl esd imlib motif opengl cdr scanner acpi alsa arts avi 
crypt cups dga doc emacs ethereal gif -gnome gphoto2 -gtk java jpeg kde mmx 
mpeg oggvorbis pdflib png python qt ruby sip tiff truetype usb X xml xml2 xmms 
zlib x86"
Comment 1 Arent Groebner 2003-09-29 15:58:06 UTC
Created attachment 18508 [details]
Full log
Comment 2 solar (RETIRED) gentoo-dev 2003-09-29 19:12:29 UTC
Yeah.. thats a tricky one really. all .so should be able to be compiled with
-fPIC, you will also notice this same exact thing happen on proftpd in sys_cap.c


The simple solution is to add
----------------------
inherit flag-o-matic
filter-flags -fPIC
----------------------
to the ebuild.

Ulrich Drepper <drepper@redhat.com> has written an interesting read on How
to Write Shared Libraries archived at http://linbsd.net/~solar/ukuug2002slides.pdf
which explain some techniques on coding -fPIC aware code.
Comment 3 solar (RETIRED) gentoo-dev 2003-09-29 19:32:02 UTC
-fPIC basicly reserves the EBX register to resolve text relocations.

This can eaisly be seen in this example
gcc -o ebx.c ebx ; should compile fine
gcc -o ebx.c ebx -fPIC ; will fail with standard BREG error

int main(int argc, char **argv) {
   int i = 0;
   __asm__ __volatile__("addl $1,%%ebx\n\t"::"b"(i));
   return i;
}
Comment 4 SpanKY gentoo-dev 2003-09-29 20:20:44 UTC
fpic is now filtered in latest stable while latest unstable utilizes the
debian patch to properly support PIC
Comment 5 solar (RETIRED) gentoo-dev 2003-09-30 00:21:30 UTC
Confirmed libcap with -fPIC works on x86 compile & runtime. Thanks so much
for finding that solution it's so desired over filtering. 

Now if we could only get util-linux -2.12 2.11z-r7 with the pic patch bumped
to stable.
Comment 6 Arent Groebner 2003-09-30 01:06:02 UTC
> Now if we could only get util-linux -2.12 2.11z-r7 
> with the pic patch bumped to stable.

Will r7 support non-gentoo encryption modules? I'm using a SuSE encryption
module (loop_fish2) and while this is running perfectly under current r6,
I got lots of problems with current *unstable*  util-linux:
"ioctl: LOOP_SET_STATUS : Invalid argument"

Steps to reproduce:
insmod /PATH_TO_SUSE_ENCRYPTION_MODULE/loop_fish2.o
mount /MY_ENCRYPTED_PARTITION

I will supply the source of the module so you can check if it will load with
util-linux -2.12 2.11z-r7.
Comment 7 Arent Groebner 2003-09-30 01:08:35 UTC
Created attachment 18522 [details]
Proprietary SuSE loop_fish2 encryption module
Comment 8 solar (RETIRED) gentoo-dev 2003-10-03 09:58:15 UTC
Arent, 
perhaps bug #25192 http://bugs.gentoo.org/show_bug.cgi?id=25192 would be
a better place for such things. 
This libcap bug is closed and the chances of it being found by any developer
working with encryption are slim.