Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 239179 - x11-drivers/xf86-{input,video}-virtualbox-2.0.2 - error: can't find a register in class `BREG' while reloading `asm'
Summary: x11-drivers/xf86-{input,video}-virtualbox-2.0.2 - error: can't find a registe...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Markus Ullmann (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-30 18:49 UTC by Kristoffer
Modified: 2009-11-10 01:41 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kristoffer 2008-09-30 18:49:39 UTC
In fact it seems this is a problem for all versions >xf86-{video,input}-virtualbox-1.5.6 (note that 1.5.6 does compile). BTW, virtualbox-ose-additions-2.0.2 compiles just fine.

This is the error for xf86-input-virtualbox-2.0.2 (it's the same for the video driver):
<snip>
  CXX     RuntimeR3 - {C}/common/log/log.cpp
/var/tmp/portage/x11-drivers/xf86-input-virtualbox-2.0.2/work/VirtualBox-2.0.2/include/iprt/asm.h: In function `size_t rtLogOutputPrefixed(void*, const char*, size_t)':
/var/tmp/portage/x11-drivers/xf86-input-virtualbox-2.0.2/work/VirtualBox-2.0.2/include/iprt/asm.h:924: error: can't find a register in class `BREG' while reloading `asm'
kmk[2]: *** [/var/tmp/portage/x11-drivers/xf86-input-virtualbox-2.0.2/work/VirtualBox-2.0.2/out/linux.x86/release/obj/RuntimeR3/common/log/log.o] Error 1
The failing command:
        @g++ -c -O2 -g -Wall -pedantic -Wno-long-long -Wno-trigraphs  -pipe -O2  -fno-omit-frame-pointer -fno-strict-aliasing   -m32 -I/var/tmp/portage/x11-drivers/xf86-input-virtualbox-2.0.2/work/VirtualBox-2.0.2/src/VBox/Runtime/include -I/var/tmp/portage/x11-drivers/xf86-input-virtualbox-2.0.2/work/VirtualBox-2.0.2/src/libs/liblzf-1.51 -I/var/tmp/portage/x11-drivers/xf86-input-virtualbox-2.0.2/work/VirtualBox-2.0.2/include -I/var/tmp/portage/x11-drivers/xf86-input-virtualbox-2.0.2/work/VirtualBox-2.0.2/out/linux.x86/release -DVBOX -DVBOX_OSE -DVBOX_WITH_HARDENING -DVBOX_WITH_INTERNAL_NETWORKING -DRT_OS_LINUX -D_FILE_OFFSET_BITS=64 -DRT_ARCH_X86 -D__X86__ -DIN_RING3 -DHC_ARCH_BITS=32 -DGC_ARCH_BITS=32 -DIN_RT_R3 -DIN_SUP_R3 -DLDR_WITH_NATIVE -DLDR_WITH_ELF32 -DLDR_WITH_PE -DRT_WITH_VBOX -Wp,-MD,/var/tmp/portage/x11-drivers/xf86-input-virtualbox-2.0.2/work/VirtualBox-2.0.2/out/linux.x86/release/obj/RuntimeR3/common/log/log.o.dep -Wp,-MT,/var/tmp/portage/x11-drivers/xf86-input-virtualbox-2.0.2/work/VirtualBox-2.0.2/out/linux.x86/release/obj/RuntimeR3/common/log/log.o -Wp,-MP -o /var/tmp/portage/x11-drivers/xf86-input-virtualbox-2.0.2/work/VirtualBox-2.0.2/out/linux.x86/release/obj/RuntimeR3/common/log/log.o /var/tmp/portage/x11-drivers/xf86-input-virtualbox-2.0.2/work/VirtualBox-2.0.2/src/VBox/Runtime/common/log/log.cpp
kmk[2]: Leaving directory `/var/tmp/portage/x11-drivers/xf86-input-virtualbox-2.0.2/work/VirtualBox-2.0.2/src/VBox/Runtime'
kmk[1]: *** [pass_libraries_before] Error 2
kmk[1]: Leaving directory `/var/tmp/portage/x11-drivers/xf86-input-virtualbox-2.0.2/work/VirtualBox-2.0.2/src'
kmk: *** [pass_libraries_before] Error 2

The BREG register have been bothering me for some other ebuilds too, but I've been able to work around them by changing the CFLAGS (adding -fno-PIE/PIC) for those specific ebuild, but it doesn't work with these packages. I'm not familiar with kbuild, so maybe it's not as simple as redefining CFLAGS to whatever is desired in order for kbuild to actually change the way it builds stuff?

Also, during build this message appears: 

  +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++
  Hardening is enabled which means that the VBox binaries will not run from
  the binary directory. The binaries have to be installed suid root and some
  more prerequisites have to be fulfilled which is normally done by installing
  the final package. For development, the hardening feature can be disabled
  by specifying the --disable-hardening parameter. Please never disable that
  feature for the final distribution!
  +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++

I've tried adding --disable-hardening to configure, but the BREG register compile error appears nonetheless. I guess this configure option doesn't _really_ disable hardening.

I guess this is an upstream bug, but perhaps there is some way to work around it that can be activated when the hardened USE flag is set?

It should be mentioned that the error occured when building a catalyst project, so the following emerge --info was produced by chrooting into the project's catalyst tmp dir and running "linux32 emerge --info" (my main system is amd64, but the catalyst target is i686), so I'm not sure how accurate this is:

Portage 2.1.4.4 (hardened/linux/x86/2008.0, gcc-3.4.6, glibc-2.6.1-r0,
2.6.25-gentoo-r7 i686)
=================================================================
System uname: 2.6.25-gentoo-r7 i686 AMD Athlon(tm) 64 Processor 3200+
Timestamp of tree: Mon, 22 Sep 2008 08:19:01 +0000
ccache version 2.4 [disabled]
app-shells/bash:     3.2_p33
dev-lang/python:     2.5.2-r7
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r2
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=i686 -Os -pipe -fomit-frame-pointer -fforce-addr"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config
/usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/
/etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/splash /etc/terminfo
/etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=i686 -Os -pipe -fomit-frame-pointer -fforce-addr"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans
userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="el fr en zh pt ru de it sv fa ar ja es he"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress
--force --whole-file --delete --stats --timeout=180 --exclude=/distfiles
--exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl acpi alias atm autoreplace berkdb bindist branding bzip2 cjk cli
contactnotes cracklib crypt cups curl dbus dri gdbm glibc-omitfp gpm gtk
hardened highlight iconv icu irc isdnlog jpeg2k kdehiddenvisibility krb4 livecd
lucene midi multicall ncurses nls no-old-linux nptl nptlonly opengl openmp pam
pcre perl pic png pppd python qt3 qt3support qt4 readline reflection session
sms socks5 spl ssl sysfs tcpd texteffect tordns translator unicode urandom vram
x86 xorg yahoo zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x
ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel
intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci"
ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file
hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug
rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic
authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm
authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache
dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache
filter headers include info log_config logio mem_cache mime mime_magic
negotiation rewrite setenvif speling status unique_id userdir usertrack
vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux"
LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses
text" LINGUAS="el fr en zh pt ru de it sv fa ar ja es he" USERLAND="GNU"
VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 i810 imstt
mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage
siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL,
MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


Reproducible: Always

Steps to Reproduce:
1. Emerge xf86-{input,video}-virtualbox-2.0.2 on hardened system
2. Weep when it fails
Comment 1 Alessio Cassibba (X-Drum) 2008-11-26 22:40:49 UTC
Hi,

> Also, during build this message appears: 
> 
>   +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++
>   Hardening is enabled which means that the VBox binaries will not run from
>   the binary directory. The binaries have to be installed suid root and some
>   more prerequisites have to be fulfilled which is normally done by installing
>   the final package. For development, the hardening feature can be disabled
>   by specifying the --disable-hardening parameter. Please never disable that
>   feature for the final distribution!
>   +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++
>
You can safely ignore these warnings there are relative to the virtualbox
distribution not to the drivers or additions.

> I've tried adding --disable-hardening to configure, but the BREG register
> compile error appears nonetheless. I guess this configure option doesn't
> _really_ disable hardening.
That "hardened" implementation in virtualbox it's a different
thing compared to a linux system or a gentoo hardened profile, 
it's a set of additional checks enabled on VirtualBox's components and libraries.

> I guess this is an upstream bug, but perhaps there is some way to work around
> it that can be activated when the hardened USE flag is set?
yes it is an upstream bug, anyway you can temporarily switch your gcc profile to a vanilla one, eg:
hardened-box ~ # gcc-config -l
 [1] i686-pc-linux-gnu-3.4.6 *
 [2] i686-pc-linux-gnu-3.4.6-hardenednopie
 [3] i686-pc-linux-gnu-3.4.6-hardenednopiessp
 [4] i686-pc-linux-gnu-3.4.6-hardenednossp
 [5] i686-pc-linux-gnu-3.4.6-vanilla

hardened-box ~ # gcc-config 5
 * Switching native-compiler to i686-pc-linux-gnu-3.4.6-vanilla ..

> It should be mentioned that the error occured when building a catalyst project,
> so the following emerge --info was produced by chrooting into the project's
> catalyst tmp dir and running "linux32 emerge --info" (my main system is amd64,
> but the catalyst target is i686), so I'm not sure how accurate this is:
> 

Comment 2 Kristoffer 2008-11-27 17:48:31 UTC
(In reply to comment #1)
> > I guess this is an upstream bug, but perhaps there is some way to work around
> > it that can be activated when the hardened USE flag is set?
> yes it is an upstream bug, anyway you can temporarily switch your gcc profile
> to a vanilla one, eg:

Sure, but as far as I know that's not possible to do in catalyst. Any way, I worked around this by changing the CFLAGS in the call to make in the ebuild as follows:

MAKE="kmk" emake TOOL_YASM_AS=yasm \
CFLAGS="${CFLAGS/-fPIE/} -fno-PIE" \  # added by me
KBUILD_PATH="${S}/kBuild" \
|| die "kmk failed"
Comment 3 Patrick Lauer gentoo-dev 2009-11-10 01:41:38 UTC
Is  this a problem? If it is, is it still a problem with 3.0 ?