Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 66630 - memtest86-3.1a - unable to build
Summary: memtest86-3.1a - unable to build
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 All
: High normal (vote)
Assignee: solar (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-07 03:36 UTC by barthek
Modified: 2004-12-07 07:13 UTC (History)
2 users (show)

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


Attachments
memtest86-3.1a.ebuild.diff (memtest86-3.1a.ebuild.diff,975 bytes, patch)
2004-11-12 04:57 UTC, solar (RETIRED)
Details | Diff
memtest86-3.1a-solar.patch (memtest86-3.1a-solar.patch,606 bytes, patch)
2004-11-12 04:59 UTC, solar (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description barthek 2004-10-07 03:36:28 UTC
i get following error during emerge:
...
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding test.c
test.c: In function `modtst':
test.c:812: error: can't find a register in class `BREG' while reloading `asm'
make: *** [test.o] Error 1

my emerge info:
Portage 2.0.51_rc7 (default-x86-1.4, gcc-3.4.2, glibc-2.3.4.20040808-r0, 2.4.27-gentoo-r1 i586)
=================================================================
System uname: 2.4.27-gentoo-r1 i586 Pentium MMX
Gentoo Base System version 1.5.3
distcc 2.17 i586-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.15.90.0.1.1-r3
Headers:  sys-kernel/linux-headers-2.4.22
Libtools: sys-devel/libtool-1.5.2-r5
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-pipe -march=pentium-mmx -O3 -fomit-frame-pointer -fstack-protector"
CHOST="i586-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /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="-pipe -march=pentium-mmx -O3 -fomit-frame-pointer -fstack-protector"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache distlocks sandbox sfperms strict userpriv usersandbox"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror http://trumpetti.atm.tut.fi/gentoo/"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/home/portagetmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://1g.compfort.com.pl/gentoo-portage"
USE="apm arts avi berkdb bitmap-fonts chroot crypt cups encode foomaticdb gif gpm gtk2 hardened imlib jpeg kde libg++ libwww mad mbox mikmod motif mpeg ncurses oggvorbis opengl oss pam pdflib perl png pwdb python qt quicktime readline sdl ssl svga tcpd threads x86 xml2 xmms xprint xv zlib"
Comment 1 steveb 2004-10-09 06:00:53 UTC
I have the same problem with sys-apps/memtest86-3.0-r2

mail / # FEATURES="-distcc" MAKEOPTS="-j2" emerge -v sys-apps/memtest86
Calculating dependencies ...done!
>>> emerge (1 of 1) sys-apps/memtest86-3.0-r2 to /
>>> md5 src_uri ;-) memtest86-3.0.tar.gz
>>> Unpacking source...
>>> Unpacking memtest86-3.0.tar.gz to /var/tmp/portage/memtest86-3.0-r2/work
 * Applying memtest86-3.0.patch...                                                                                                [ ok ]
>>> Source unpacked.
gcc -E -traditional head.S -o head.s
gcc -c -fPIC -Wall -g -O2 -fno-strict-aliasing reloc.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC main.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin test.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC init.c
test.c: In function `movinv1':
test.c:329: error: can't find a register in class `BREG' while reloading `asm'
test.c:395: error: can't find a register in class `BREG' while reloading `asm'
make: *** [test.o] Error 1
make: *** Waiting for unfinished jobs....

!!! ERROR: sys-apps/memtest86-3.0-r2 failed.
!!! Function src_compile, Line 31, Exitcode 2
!!! (no error message)

mail / #    
Comment 2 steveb 2004-10-10 09:37:11 UTC
If I look closer at the use flags, then I see that we both use the hardened setup. Maybe this is the problem?
Comment 3 barthek 2004-10-10 14:38:24 UTC
ive done some research and i found out something.
all the problems come from gcc 3.4.
memtest86 compiles cleanly at least with gcc 3.2 and 3.3.
Comment 4 steveb 2004-10-10 17:04:52 UTC
I can NOT conforme that:

steveb@gentoo ~ $ gcc -v
Reading specs from /usr/lib/gcc/i686-pc-linux-gnu/3.4.2/specs
Configured with: /var/tmp/portage/gcc-3.4.2-r2/work/gcc-3.4.2/configure --enable-version-specific-runtime-libs --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.4 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.2/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.2/include/g++-v3 --host=i686-pc-linux-gnu --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-shared --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --with-gnu-ld --enable-threads=posix --disable-multilib --disable-libgcj --enable-languages=c,c++
Thread model: posix
gcc version 3.4.2  (Gentoo Linux 3.4.2-r2, ssp-3.4.1-1, pie-8.7.6.5)
steveb@gentoo ~ $ qpkg -I -nc -v memtest86
sys-apps/memtest86-3.0-r2
steveb@gentoo ~ $ su -c "emerge -v memtest86"
Password:
Calculating dependencies ...done!
>>> emerge (1 of 1) sys-apps/memtest86-3.0-r2 to /
>>> md5 src_uri ;-) memtest86-3.0.tar.gz
>>> Unpacking source...
>>> Unpacking memtest86-3.0.tar.gz to /var/tmp/portage/memtest86-3.0-r2/work
 * Applying memtest86-3.0.patch...                                                                                                                                       [ ok ]
>>> Source unpacked.
gcc -E -traditional head.S -o head.s
gcc -c -fPIC -Wall -g -O2 -fno-strict-aliasing reloc.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC main.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin test.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC init.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC lib.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC patn.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC screen_buffer.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC config.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC linuxbios.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC memsize.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC pci.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC controller.c
gcc -E -traditional bootsect.S -o bootsect.s
gcc -E -traditional setup.S -o setup.s
as -o setup.o setup.s
as -o bootsect.o bootsect.s
as -o head.o head.s
ld --warn-constructors --warn-common -static -T memtest_shared.lds -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o linuxbios.o memsize.o pci.o controller.o && \
ld -shared -T memtest_shared.lds -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o linuxbios.o memsize.o pci.o controller.o
objcopy -O binary memtest_shared memtest_shared.bin
ld -T memtest.bin.lds bootsect.o setup.o -b binary memtest_shared.bin -o memtest.bin
ld -s -T memtest.lds -b binary memtest_shared.bin -o memtest

>>> Install memtest86-3.0-r2 into /var/tmp/portage/memtest86-3.0-r2/image/ category sys-apps
man:
prepallstrip:
strip:
strip:
>>> Completed installing into /var/tmp/portage/memtest86-3.0-r2/image/

./
./boot/
./boot/memtest86/
./boot/memtest86/memtest.bin
./usr/
./usr/share/
./usr/share/doc/
./usr/share/doc/memtest86-3.0-r2/
./usr/share/doc/memtest86-3.0-r2/README.gz
./usr/share/doc/memtest86-3.0-r2/README.build-process.gz
>>> Done.
>>> extracting info
>>> extracting memtest86-3.0-r2
>>> Merging sys-apps/memtest86-3.0-r2 to /
 *
 * Your boot partition was detected as being mounted as /boot.
 * Files will be installed there for memtest86 to function correctly.
 *
--- /boot/
--- /boot/memtest86/
>>> /boot/memtest86/memtest.bin
--- /usr/
--- /usr/share/
--- /usr/share/doc/
--- /usr/share/doc/memtest86-3.0-r2/
>>> /usr/share/doc/memtest86-3.0-r2/README.gz
>>> /usr/share/doc/memtest86-3.0-r2/README.build-process.gz
>>> Safely unmerging already-installed instance...
--- !mtime obj /usr/share/doc/memtest86-3.0-r2/README.gz
--- !mtime obj /usr/share/doc/memtest86-3.0-r2/README.build-process.gz
--- !mtime obj /boot/memtest86/memtest.bin
--- !empty dir /usr/share/doc/memtest86-3.0-r2
--- !empty dir /usr/share/doc
--- !empty dir /usr/share
--- !empty dir /usr
--- !empty dir /boot/memtest86
--- !empty dir /boot
>>> original instance of package unmerged safely.
 *
 * memtest.bin has been installed in /boot/memtest86/
 * You may wish to update your bootloader configs
 * by adding these lines:
 *  - For grub:
 *     > title=Memtest86
 *     > root (hd0,0)
 *     > kernel /boot/memtest86/memtest.bin
 *  - For lilo:
 *     > image  = /boot/memtest86/memtest.bin
 *     > label  = Memtest86
 *
 * Caching service dependencies...
>>> sys-apps/memtest86-3.0-r2 merged.

>>> clean: No packages selected for removal.

>>> Auto-cleaning packages ...

>>> No outdated packages were found on your system.


 * Regenerating GNU info directory index...
install-info: warning: no info dir entry in `/usr/share/info/libcdio.info.gz'
 * Processed 268 info files; 1 errors.

steveb@gentoo ~ $ su -c "emerge unmerge memtest86 && emerge -v memtest86"
Password:

 sys-apps/memtest86
    selected: 3.0-r2
   protected: none
     omitted: none

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

>>> Waiting 5 seconds before starting...
>>> (Control-C to abort)...
>>> Unmerging in: 5 4 3 2 1
>>> Unmerging sys-apps/memtest86-3.0-r2...
No package files given... Grabbing a set.
<<<        obj /usr/share/doc/memtest86-3.0-r2/README.gz
<<<        obj /usr/share/doc/memtest86-3.0-r2/README.build-process.gz
<<<        obj /boot/memtest86/memtest.bin
<<<        dir /usr/share/doc/memtest86-3.0-r2
<<<        dir /boot/memtest86
--- !empty dir /usr/share/doc
--- !empty dir /usr/share
--- !empty dir /usr
--- !empty dir /boot
>>> Regenerating /etc/ld.so.cache...
 * Caching service dependencies...

 * GNU info directory index is up-to-date.

Calculating dependencies ...done!
>>> emerge (1 of 1) sys-apps/memtest86-3.0-r2 to /
>>> md5 src_uri ;-) memtest86-3.0.tar.gz
>>> Unpacking source...
>>> Unpacking memtest86-3.0.tar.gz to /var/tmp/portage/memtest86-3.0-r2/work
 * Applying memtest86-3.0.patch...                                                                                                                                       [ ok ]
>>> Source unpacked.
gcc -E -traditional head.S -o head.s
gcc -c -fPIC -Wall -g -O2 -fno-strict-aliasing reloc.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC main.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin test.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC init.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC lib.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC patn.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC screen_buffer.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC config.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC linuxbios.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC memsize.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC pci.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC controller.c
gcc -E -traditional bootsect.S -o bootsect.s
gcc -E -traditional setup.S -o setup.s
as -o bootsect.o bootsect.s
as -o setup.o setup.s
as -o head.o head.s
ld --warn-constructors --warn-common -static -T memtest_shared.lds -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o linuxbios.o memsize.o pci.o controller.o && \
ld -shared -T memtest_shared.lds -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o linuxbios.o memsize.o pci.o controller.o
objcopy -O binary memtest_shared memtest_shared.bin
ld -T memtest.bin.lds bootsect.o setup.o -b binary memtest_shared.bin -o memtest.bin
ld -s -T memtest.lds -b binary memtest_shared.bin -o memtest

>>> Install memtest86-3.0-r2 into /var/tmp/portage/memtest86-3.0-r2/image/ category sys-apps
man:
prepallstrip:
strip:
strip:
>>> Completed installing into /var/tmp/portage/memtest86-3.0-r2/image/

./
./boot/
./boot/memtest86/
./boot/memtest86/memtest.bin
./usr/
./usr/share/
./usr/share/doc/
./usr/share/doc/memtest86-3.0-r2/
./usr/share/doc/memtest86-3.0-r2/README.gz
./usr/share/doc/memtest86-3.0-r2/README.build-process.gz
>>> Done.
>>> extracting info
>>> extracting memtest86-3.0-r2
>>> Merging sys-apps/memtest86-3.0-r2 to /
 *
 * Your boot partition was detected as being mounted as /boot.
 * Files will be installed there for memtest86 to function correctly.
 *
--- /boot/
>>> /boot/memtest86/
>>> /boot/memtest86/memtest.bin
--- /usr/
--- /usr/share/
--- /usr/share/doc/
>>> /usr/share/doc/memtest86-3.0-r2/
>>> /usr/share/doc/memtest86-3.0-r2/README.gz
>>> /usr/share/doc/memtest86-3.0-r2/README.build-process.gz
 *
 * memtest.bin has been installed in /boot/memtest86/
 * You may wish to update your bootloader configs
 * by adding these lines:
 *  - For grub:
 *     > title=Memtest86
 *     > root (hd0,0)
 *     > kernel /boot/memtest86/memtest.bin
 *  - For lilo:
 *     > image  = /boot/memtest86/memtest.bin
 *     > label  = Memtest86
 *
>>> Regenerating /etc/ld.so.cache...
 * Caching service dependencies...
>>> sys-apps/memtest86-3.0-r2 merged.
>>> Recording sys-apps/memtest86 in "world" favorites file...

>>> clean: No packages selected for removal.

>>> Auto-cleaning packages ...

>>> No outdated packages were found on your system.


 * GNU info directory index is up-to-date.

steveb@gentoo ~ $ cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 6
model           : 8
model name      : AMD Athlon(TM) XP 2400+
stepping        : 1
cpu MHz         : 2001.026
cache size      : 256 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow
bogomips        : 3964.92

steveb@gentoo ~ $ emerge info

*** You are not in the portage group. You may experience cache problems
*** due to permissions preventing the creation of the on-disk cache.
*** Please add this user to the portage group if you wish to use portage.

Portage 2.0.50-r11 (default-x86-2004.2, gcc-3.4.2, glibc-2.3.4.20040916-r0, 2.6.9-rc3-nitro2)
=================================================================
System uname: 2.6.9-rc3-nitro2 i686 AMD Athlon(TM) XP 2400+
Gentoo Base System version 1.4.16
distcc 2.17 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [disabled]
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -O2 -pipe -mmmx -m3dnow -msse -mfpmath=sse,387 -fomit-frame-pointer -funroll-loops -frerun-cse-after-loop -frerun-loop-opt -falign-functions=4 -maccumulate-outgoing-args -ffast-math -fprefetch-loop-arrays"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /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="-march=athlon-xp -O2 -pipe -mmmx -m3dnow -msse -mfpmath=sse,387 -fomit-frame-pointer -funroll-loops -frerun-cse-after-loop -frerun-loop-opt -falign-functions=4 -maccumulate-outgoing-args -ffast-math -fprefetch-loop-arrays"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs buildpkg sandbox userpriv"
GENTOO_MIRRORS="ftp://sunsite.cnlab-switch.ch/mirror/gentoo/ http://gentoo.oregonstate.edu/ http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j16"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/mnt/gentoo.overlay"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow GAPING_SECURITY_HOLE X aalib acl acpi alsa amd apm arts artswrappersuid audiofile avi berkdb bitmap-fonts bonobo bzlib cdparanoia cdr clamav crypt cups curl dga directfb divx4linux dv dvd dvdr encode erandom esd ethereal evo f77 fam fbcon fbdev fdftk ffmpeg fftw flac flash foomaticdb freetype ftp gb gd gdbm ggi gif gimp gimpprint gnome gphoto2 gpm gstreamer gtk gtk2 gtkhtml guile icc icc-pgo ieee1394 imagemagick imap imlib jack java javascript jikes jpeg junit kde kerberos krb4 lcms ldap lesstif libg++ libwww mad mcal md5sum mdb mikmod mmx monkey motif mozilla mpeg mpeg4 mplayer nas ncurses net nls nntp nptl nvidia oav oggvorbis opengl oss pam pda pdflib perl pic png ppds psyco pthreads python qt qtmt quicktime readline samba scanner sdl skey slang slp snmp socks5 sox speex spell sse ssl svga szip tcltk tcpd tetex tiff truetype usb wmf x86 xface xine xml xml2 xmms xosd xprint xv xvid zlib"

steveb@gentoo ~ $


Comment 5 steveb 2004-10-10 17:06:09 UTC
BOY!! I am to sleepy to see that I posted stuff with memtest86-3.0-r2!

sorry for that!
Comment 6 steveb 2004-10-10 17:10:39 UTC
Okay... there we go! This time with the right memtest86 version:

steveb@gentoo ~ $ su -c "emerge -v /usr/portage/sys-apps/memtest86/memtest86-3.1a.ebuild"
Password:
Calculating dependencies ...done!
>>> emerge (1 of 1) sys-apps/memtest86-3.1a to /
>>> Downloading ftp://sunsite.cnlab-switch.ch/mirror/gentoo/distfiles/memtest86-3.1a.tar.gz
--02:09:13--  ftp://sunsite.cnlab-switch.ch/mirror/gentoo/distfiles/memtest86-3.1a.tar.gz
           => `/usr/portage/distfiles/memtest86-3.1a.tar.gz'
Resolving sunsite.cnlab-switch.ch... 130.59.10.35, 2001:620:0:8:203:baff:fe52:38e5
Connecting to sunsite.cnlab-switch.ch[130.59.10.35]:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD /mirror/gentoo/distfiles ... done.
==> PASV ... done.    ==> RETR memtest86-3.1a.tar.gz ... done.
Length: 142,729 (unauthoritative)

100%[==================================================================================================================================> ] 142,729      246.70K/s

02:09:13 (245.99 KB/s) - `/usr/portage/distfiles/memtest86-3.1a.tar.gz' saved [142729]

>>> md5 src_uri ;-) memtest86-3.1a.tar.gz
>>> Unpacking source...
>>> Unpacking memtest86-3.1a.tar.gz to /var/tmp/portage/memtest86-3.1a/work
>>> Source unpacked.
gcc -E -traditional head.S -o head.s
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC reloc.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC main.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding test.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC init.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC lib.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC patn.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC screen_buffer.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC config.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC linuxbios.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC memsize.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC pci.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC controller.c
gcc -E -traditional bootsect.S -o bootsect.s
gcc -E -traditional setup.S -o setup.s
as -k -o bootsect.o bootsect.s
as -k -o setup.o setup.s
as -k -o head.o head.s
ld --warn-constructors --warn-common -static -T memtest_shared.lds -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o linuxbios.o memsize.o pci.o controller.o && \
ld -shared -Bsymbolic -T memtest_shared.lds -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o linuxbios.o memsize.o pci.o controller.o
objcopy -O binary memtest_shared memtest_shared.bin
ld -T memtest.bin.lds bootsect.o setup.o -b binary memtest_shared.bin -o memtest.bin
ld -s -T memtest.lds -b binary memtest_shared.bin -o memtest

>>> Install memtest86-3.1a into /var/tmp/portage/memtest86-3.1a/image/ category sys-apps
man:
prepallstrip:
strip:
>>> Completed installing into /var/tmp/portage/memtest86-3.1a/image/

./
./boot/
./boot/memtest86/
./boot/memtest86/memtest.bin
./usr/
./usr/share/
./usr/share/doc/
./usr/share/doc/memtest86-3.1a/
./usr/share/doc/memtest86-3.1a/README.gz
./usr/share/doc/memtest86-3.1a/README.build-process.gz
>>> Done.
>>> extracting info
>>> extracting memtest86-3.1a
>>> Merging sys-apps/memtest86-3.1a to /
 *
 * Your boot partition was detected as being mounted as /boot.
 * Files will be installed there for memtest86 to function correctly.
 *
--- /boot/
--- /boot/memtest86/
>>> /boot/memtest86/memtest.bin
--- /usr/
--- /usr/share/
--- /usr/share/doc/
>>> /usr/share/doc/memtest86-3.1a/
>>> /usr/share/doc/memtest86-3.1a/README.gz
>>> /usr/share/doc/memtest86-3.1a/README.build-process.gz
 *
 * memtest.bin has been installed in /boot/memtest86/
 * You may wish to update your bootloader configs
 * by adding these lines:
 *  - For grub:
 *     > title=Memtest86
 *     > root (hd0,0)
 *     > kernel /boot/memtest86/memtest.bin
 *  - For lilo:
 *     > image  = /boot/memtest86/memtest.bin
 *     > label  = Memtest86
 *
>>> Regenerating /etc/ld.so.cache...
 * Caching service dependencies...
>>> sys-apps/memtest86-3.1a merged.

 sys-apps/memtest86
    selected: 3.0-r2
   protected: 3.1a
     omitted: none

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

>>> Waiting 5 seconds before starting...
>>> (Control-C to abort)...
>>> Unmerging in: 5 4 3 2 1
>>> Unmerging sys-apps/memtest86-3.0-r2...
No package files given... Grabbing a set.
<<<        obj /usr/share/doc/memtest86-3.0-r2/README.gz
<<<        obj /usr/share/doc/memtest86-3.0-r2/README.build-process.gz
--- !mtime obj /boot/memtest86/memtest.bin
<<<        dir /usr/share/doc/memtest86-3.0-r2
--- !empty dir /usr/share/doc
--- !empty dir /usr/share
--- !empty dir /usr
--- !empty dir /boot/memtest86
--- !empty dir /boot
 * Caching service dependencies...
 * Caching service dependencies...
>>> Auto-cleaning packages ...

>>> No outdated packages were found on your system.


 * GNU info directory index is up-to-date.

steveb@gentoo ~ $ gcc -v
Reading specs from /usr/lib/gcc/i686-pc-linux-gnu/3.4.2/specs
Configured with: /var/tmp/portage/gcc-3.4.2-r2/work/gcc-3.4.2/configure --enable-version-specific-runtime-libs --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.4 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.2/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.2/include/g++-v3 --host=i686-pc-linux-gnu --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-shared --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --with-gnu-ld --enable-threads=posix --disable-multilib --disable-libgcj --enable-languages=c,c++
Thread model: posix
gcc version 3.4.2  (Gentoo Linux 3.4.2-r2, ssp-3.4.1-1, pie-8.7.6.5)
steveb@gentoo ~ $ su -c "emerge info"
Password:
Portage 2.0.50-r11 (default-x86-2004.2, gcc-3.4.2, glibc-2.3.4.20040916-r0, 2.6.9-rc3-nitro2)
=================================================================
System uname: 2.6.9-rc3-nitro2 i686 AMD Athlon(TM) XP 2400+
Gentoo Base System version 1.4.16
distcc[2238] (dcc_get_top_dir) Warning: HOME is not set; can't find distcc directory [disabled]
ccache version 2.3 [disabled]
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -O2 -pipe -mmmx -m3dnow -msse -mfpmath=sse,387 -fomit-frame-pointer -funroll-loops -frerun-cse-after-loop -frerun-loop-opt -falign-functions=4 -maccumulate-outgoing-args -ffast-math -fprefetch-loop-arrays"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /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="-march=athlon-xp -O2 -pipe -mmmx -m3dnow -msse -mfpmath=sse,387 -fomit-frame-pointer -funroll-loops -frerun-cse-after-loop -frerun-loop-opt -falign-functions=4 -maccumulate-outgoing-args -ffast-math -fprefetch-loop-arrays"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs buildpkg sandbox userpriv"
GENTOO_MIRRORS="ftp://sunsite.cnlab-switch.ch/mirror/gentoo/ http://gentoo.oregonstate.edu/ http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j16"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/mnt/gentoo.overlay"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow GAPING_SECURITY_HOLE X aalib acl acpi alsa amd apm arts artswrappersuid audiofile avi berkdb bitmap-fonts bonobo bzlib cdparanoia cdr clamav crypt cups curl dga directfb divx4linux dv dvd dvdr encode erandom esd ethereal evo f77 fam fbcon fbdev fdftk ffmpeg fftw flac flash foomaticdb freetype ftp gb gd gdbm ggi gif gimp gimpprint gnome gphoto2 gpm gstreamer gtk gtk2 gtkhtml guile icc icc-pgo ieee1394 imagemagick imap imlib jack java javascript jikes jpeg junit kde kerberos krb4 lcms ldap lesstif libg++ libwww mad mcal md5sum mdb mikmod mmx monkey motif mozilla mpeg mpeg4 mplayer nas ncurses net nls nntp nptl nvidia oav oggvorbis opengl oss pam pda pdflib perl pic png ppds psyco pthreads python qt qtmt quicktime readline samba scanner sdl skey slang slp snmp socks5 sox speex spell sse ssl svga szip tcltk tcpd tetex tiff truetype usb wmf x86 xface xine xml xml2 xmms xosd xprint xv xvid zlib"

steveb@gentoo ~ $
Comment 7 steveb 2004-10-10 17:12:56 UTC
and once again without the ugly emerge:

root@gentoo /home/steveb # echo =sys-apps/memtest86-3.1a ~x86>>/etc/portage/package.keywords
root@gentoo /home/steveb # echo =sys-apps/memtest86-3.1a>>/etc/portage/package.unmask
root@gentoo /home/steveb # emerge -pv memtest86

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] sys-apps/memtest86-3.1a  -serial  0 kB

Total size of downloads: 0 kB

root@gentoo /home/steveb # emerge -v memtest86
Calculating dependencies ...done!
>>> emerge (1 of 1) sys-apps/memtest86-3.1a to /
>>> md5 src_uri ;-) memtest86-3.1a.tar.gz
>>> Unpacking source...
>>> Unpacking memtest86-3.1a.tar.gz to /var/tmp/portage/memtest86-3.1a/work
>>> Source unpacked.
gcc -E -traditional head.S -o head.s
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC reloc.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC main.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding test.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC init.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC lib.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC patn.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC screen_buffer.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC config.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC linuxbios.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC memsize.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC pci.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC controller.c
gcc -E -traditional bootsect.S -o bootsect.s
gcc -E -traditional setup.S -o setup.s
as -k -o bootsect.o bootsect.s
as -k -o setup.o setup.s
as -k -o head.o head.s
ld --warn-constructors --warn-common -static -T memtest_shared.lds -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o linuxbios.o memsize.o pci.o controller.o && \
ld -shared -Bsymbolic -T memtest_shared.lds -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o linuxbios.o memsize.o pci.o controller.o
objcopy -O binary memtest_shared memtest_shared.bin
ld -T memtest.bin.lds bootsect.o setup.o -b binary memtest_shared.bin -o memtest.bin
ld -s -T memtest.lds -b binary memtest_shared.bin -o memtest

>>> Install memtest86-3.1a into /var/tmp/portage/memtest86-3.1a/image/ category sys-apps
man:
prepallstrip:
strip:
>>> Completed installing into /var/tmp/portage/memtest86-3.1a/image/

./
./boot/
./boot/memtest86/
./boot/memtest86/memtest.bin
./usr/
./usr/share/
./usr/share/doc/
./usr/share/doc/memtest86-3.1a/
./usr/share/doc/memtest86-3.1a/README.gz
./usr/share/doc/memtest86-3.1a/README.build-process.gz
>>> Done.
>>> extracting info
>>> extracting memtest86-3.1a
>>> Merging sys-apps/memtest86-3.1a to /
 *
 * Your boot partition was detected as being mounted as /boot.
 * Files will be installed there for memtest86 to function correctly.
 *
--- /boot/
--- /boot/memtest86/
>>> /boot/memtest86/memtest.bin
--- /usr/
--- /usr/share/
--- /usr/share/doc/
--- /usr/share/doc/memtest86-3.1a/
>>> /usr/share/doc/memtest86-3.1a/README.gz
>>> /usr/share/doc/memtest86-3.1a/README.build-process.gz
>>> Safely unmerging already-installed instance...
--- !mtime obj /usr/share/doc/memtest86-3.1a/README.gz
--- !mtime obj /usr/share/doc/memtest86-3.1a/README.build-process.gz
--- !mtime obj /boot/memtest86/memtest.bin
--- !empty dir /usr/share/doc/memtest86-3.1a
--- !empty dir /usr/share/doc
--- !empty dir /usr/share
--- !empty dir /usr
--- !empty dir /boot/memtest86
--- !empty dir /boot
>>> original instance of package unmerged safely.
 *
 * memtest.bin has been installed in /boot/memtest86/
 * You may wish to update your bootloader configs
 * by adding these lines:
 *  - For grub:
 *     > title=Memtest86
 *     > root (hd0,0)
 *     > kernel /boot/memtest86/memtest.bin
 *  - For lilo:
 *     > image  = /boot/memtest86/memtest.bin
 *     > label  = Memtest86
 *
 * Caching service dependencies...
>>> sys-apps/memtest86-3.1a merged.

>>> clean: No packages selected for removal.

>>> Auto-cleaning packages ...

>>> No outdated packages were found on your system.


 * GNU info directory index is up-to-date.

root@gentoo /home/steveb #
Comment 8 barthek 2004-10-11 01:23:33 UTC
UPDATE: IT DOES NOT COMPILE HERE WITH hardened GCC 3.3.4.

maybe it has something to do with CPU and optimisations gcc is trying to perform ? alhough i tried manually compiling memtest with -O0 with no effect.
i can confirm this problem on Intel Pentium III and 'regular' pentium mmx:

1g ~ # more /proc/cpuinfo 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 7
model name      : Pentium III (Katmai)
stepping        : 3
cpu MHz         : 504.024
cache size      : 512 KB
..
...
1g ~ # gcc -v
Reading specs from /usr/lib/gcc/i686-pc-linux-gnu/3.4.2/specs
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.4.2/specs
Configured with: /var/tmp/portage/gcc-3.4.2-r2/work/gcc-3.4.2/configure --enable-version-specific-runtime-libs --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.4 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.2/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.2/include/g++-v3 --host=i686-pc-linux-gnu --disable-nls --enable-__cxa_atexit --enable-clocale=gnu --enable-shared --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --with-gnu-ld --enable-threads=posix --disable-multilib --disable-libgcj --enable-languages=c,c++
Thread model: posix
gcc version 3.4.2  (Gentoo Hardened Linux 3.4.2-r2, ssp-3.4.1-1, pie-8.7.6.5)

1g ~ # emerge -v memtest86
...
test.c: In function `modtst':
test.c:812: error: can't find a register in class `BREG' while reloading `asm'
make: *** [test.o] Error 1
...


felix ~ # more /proc/cpuinfo 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 5
model           : 4
model name      : Pentium MMX
stepping        : 3
cpu MHz         : 200.456

felix ~ # gcc -v
Reading specs from /usr/lib/gcc/i586-pc-linux-gnu/3.4.2/specs
Reading specs from /usr/lib/gcc-lib/i586-pc-linux-gnu/3.4.2/specs
Configured with: /home/portagetmp/portage/gcc-3.4.2-r2/work/gcc-3.4.2/configure --enable-version-specific-runtime-libs --prefix=/usr --bindir=/usr/i586-pc-linux-gnu/gcc-bin/3.4 --includedir=/usr/lib/gcc/i586-pc-linux-gnu/3.4.2/include --datadir=/usr/share/gcc-data/i586-pc-linux-gnu/3.4 --mandir=/usr/share/gcc-data/i586-pc-linux-gnu/3.4/man --infodir=/usr/share/gcc-data/i586-pc-linux-gnu/3.4/info --with-gxx-include-dir=/usr/lib/gcc/i586-pc-linux-gnu/3.4.2/include/g++-v3 --host=i586-pc-linux-gnu --disable-nls --enable-__cxa_atexit --enable-clocale=gnu --enable-shared --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --with-gnu-ld --enable-threads=posix --disable-multilib --disable-libgcj --enable-languages=c,c++
Thread model: posix
gcc version 3.4.2  (Gentoo Hardened Linux 3.4.2-r2, ssp-3.4.1-1, pie-8.7.6.5)

felix ~ # emerge -v memtest86
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding test.c
test.c: In function `modtst':
test.c:812: error: can't find a register in class `BREG' while reloading `asm'
make: *** [test.o] Error 1
Comment 9 Mark Waterreus 2004-11-10 16:01:43 UTC
Have the same results here with a gcc-hardened-3.3.4-r2 setup with minimal use-flags enabled.

seraph ~ $> emerge memtest86
Calculating dependencies ...done!
>>> emerge (1 of 1) sys-apps/memtest86-3.0-r2 to /
>>> md5 src_uri ;-) memtest86-3.0.tar.gz
>>> Unpacking source...
>>> Unpacking memtest86-3.0.tar.gz to /var/tmp/portage/memtest86-3.0-r2/work
 * Applying memtest86-3.0.patch ...                                                                              [ ok ]
>>> Source unpacked.
gcc -E -traditional head.S -o head.s
gcc -c -fPIC -Wall -g -O2 -fno-strict-aliasing reloc.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC main.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin test.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC init.c
gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC lib.c
test.c: In function `movinv1':
test.c:329: error: can't find a register in class `BREG' while reloading `asm'
test.c:395: error: can't find a register in class `BREG' while reloading `asm'
make: *** [test.o] Error 1
make: *** Waiting for unfinished jobs....

!!! ERROR: sys-apps/memtest86-3.0-r2 failed.
!!! Function src_compile, Line 31, Exitcode 2
!!! (no error message)
!!! If you need support, post the topmost build error, NOT this status message.


seraph ~ $> emerge --info
Portage 2.0.51-r3 (default-linux/x86/2004.0, gcc-3.3.4, glibc-2.3.4.20040808-r1, 2.6.7-hardened-r10 i686)
=================================================================
System uname: 2.6.7-hardened-r10 i686 Pentium III (Coppermine)
Gentoo Base System version 1.4.16
distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.14.90.0.8-r1
Headers:  sys-kernel/linux26-headers-2.6.8.1
Libtools: sys-devel/libtool-1.5.2-r5
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium3"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /opt/glftpd/etc /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="-march=pentium3"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="ftp://mirror.switch.ch/mirror/gentoo ftp://ftp.snt.utwente.nl/pub/linux/gentoo http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/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="apache2 apm arts avi berkdb bitmap-fonts crypt encode f77 foomaticdb fortran gdbm gif gpm hardened imap imlib innodb ipv6 jpeg libg++ libwww mad maildir mikmod motif mpeg mysql ncurses nls oggvorbis opengl pam pdflib perl png pythonquicktime readline samba sdl slang snmp spell ssl svga tcpd tiff truetype usagi vhosts x86 xml2 xmms xv zlib"


Comment 10 Sascha Wuestemann 2004-11-11 08:38:16 UTC
Hi, I have the same error and give you my information for further investigation:

---emerge.info start---
Gentoo Base System version 1.6.6
Portage 2.0.51-r3 (default-linux/x86/2004.0, gcc-3.4.3, glibc-2.3.4.20041102-r0, 2.6.7 i586)
=================================================================
System uname: 2.6.7 i586 AMD-K6(tm) 3D processor
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.15.92.0.2-r1
Headers:  sys-kernel/linux-headers-2.4.19-r1,sys-kernel/linux-headers-2.4.22
Libtools: sys-devel/libtool-1.5.2-r5
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=k6-3 -O3 -pipe -fomit-frame-pointer"
CHOST="i586-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.3/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /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/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=k6-3 -O3 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="http://gentoo.osuosl.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/usr/tmp2"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow X X509 Xaw3d aalib acpi alsa apache2 apm arts audiofile avi berkdb bindist bitmap-fonts cdr chroot crypt cscope curl curlwrappers dedicated doc dvd dvdr encode esd ethereal f77 fam fastcgi flac flash foomaticdb fortran freetds gd gdbm ggi gif gmp gphoto2 gpm gstreamer gtk gtk2 guile hardened icc imagemagick imap imlib innodb java jikes jpeg kde lcms ldap lesstif libg++ libwww mad maildir mbox mcal memlimit mikmod mmx motif mozilla mpeg mpi mysql nas ncurses nhc98 nls nocd odbc offensive oggvorbis opengl oss pam pda pdflib perl png postgres prelude python qt quicktime readline samba sasl sdl serial skey slang snmp socks5 speex spell ssl svga tcltk tcpd tetex theora tiff truetype unicode videos wmf wxwindows x86 xml xml2 xmms xosd xv zlib"
---emerge.info stop---

---emerge.build.snippet start---
[ebuild  N    ] sys-apps/memtest86-3.1a  +serial 139 kB 
[ebuild  N    ] sys-apps/memtest86+-1.30  +serial 132 kB 
[ebuild  N    ] sys-apps/memtester-4.0.3  15 kB
...
http://gentoo.osuosl.org/distfiles/memtest86-3.1a.tar.gz
--15:54:17--  http://gentoo.osuosl.org/distfiles/memtest86-3.1a.tar.gz
           => `/usr/portage/distfiles/memtest86-3.1a.tar.gz'
Resolving gentoo.osuosl.org... 140.211.166.134
Connecting to gentoo.osuosl.org[140.211.166.134]:80... connected.

>>> Unpacking source...
>>> Unpacking memtest86-3.1a.tar.gz to /usr/tmp2/portage/memtest86-3.1a/work
serial
>>> Source unpacked.
gcc -E -traditional head.S -o head.s
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC reloc.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC main.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding test.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC init.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC lib.c
test.c: In function `modtst':
test.c:812: error: can't find a register in class `BREG' while reloading `asm'
make: *** [test.o] Error 1
make: *** Waiting for unfinished jobs....

!!! ERROR: sys-apps/memtest86-3.1a failed.
!!! Function src_compile, Line 35, Exitcode 2
---emerge.build.snippet stop---

---gcc.version start---
gcc (GCC) 3.4.3  (Gentoo Hardened Linux 3.4.3, ssp-3.4.3-0, pie-8.7.6.6)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
---gcc.version stop---

greetings,
Sascha Wuestemann
Comment 11 solar (RETIRED) gentoo-dev 2004-11-12 04:40:55 UTC
The problem here.

As you can see your using a hardened toolchain (thats fine) but the program forces  -fPIC for everything but the test.c and that's the one you have the problem with becaouse behind the scene the hardened compiler enables PIC by default.

The proper solution is to make test.c compile with -fno-pic while using a hardened  compiler. (well just outright) 

I'll merge it and wait to fail. Assuming it does for me I'll add a patch here.
Comment 12 solar (RETIRED) gentoo-dev 2004-11-12 04:57:15 UTC
Created attachment 43776 [details, diff]
memtest86-3.1a.ebuild.diff

patch for the ebuild
Comment 13 solar (RETIRED) gentoo-dev 2004-11-12 04:59:16 UTC
Created attachment 43777 [details, diff]
memtest86-3.1a-solar.patch

memtest is like a bootloader it also needs -fstack-protector disabled when
using a hardened toolchain. This patch adds -fno-pic for test.c and
-fno-stack-protector to CCFLAGS
Comment 14 steveb 2004-11-12 05:18:17 UTC
Okay. The patch and the change in the ebuild fixes the problem:
Calculating dependencies ...done!
>>> emerge (1 of 1) sys-apps/memtest86-3.1a to /
>>> md5 src_uri ;-) memtest86-3.1a.tar.gz
>>> Unpacking source...
>>> Unpacking memtest86-3.1a.tar.gz to /var/tmp/portage/memtest86-3.1a/work
 * Applying memtest86-3.1a-solar.patch ...                                                                                                           [ ok ]
>>> Source unpacked.
gcc -E -traditional head.S -o head.s
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fno-stack-protector -fPIC reloc.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fno-stack-protector -fPIC main.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fno-stack-protector -fno-PIC test.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fno-stack-protector -fPIC init.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fno-stack-protector -fPIC lib.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fno-stack-protector -fPIC patn.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fno-stack-protector -fPIC screen_buffer.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fno-stack-protector -fPIC config.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fno-stack-protector -fPIC linuxbios.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fno-stack-protector -fPIC memsize.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fno-stack-protector -fPIC pci.c
gcc -c -Wall -march=i486 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fno-stack-protector -fPIC controller.c
gcc -E -traditional bootsect.S -o bootsect.s
gcc -E -traditional setup.S -o setup.s
as -k -o head.o head.s
as -k -o bootsect.o bootsect.s
as -k -o setup.o setup.s
ld --warn-constructors --warn-common -static -T memtest_shared.lds -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o linuxbios.o memsize.o pci.o controller.o && \
ld -shared -Bsymbolic -T memtest_shared.lds -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o linuxbios.o memsize.o pci.o controller.o
objcopy -O binary memtest_shared memtest_shared.bin
ld -T memtest.bin.lds bootsect.o setup.o -b binary memtest_shared.bin -o memtest.bin
ld -s -T memtest.lds -b binary memtest_shared.bin -o memtest
>>> Test phase [not enabled]: sys-apps/memtest86-3.1a

>>> Install memtest86-3.1a into /var/tmp/portage/memtest86-3.1a/image/ category sys-apps
man:
prepallstrip:
strip:
>>> Completed installing into /var/tmp/portage/memtest86-3.1a/image/

./
./boot/
./boot/memtest86/
./boot/memtest86/memtest.bin
./usr/
./usr/share/
./usr/share/doc/
./usr/share/doc/memtest86-3.1a/
./usr/share/doc/memtest86-3.1a/README.gz
./usr/share/doc/memtest86-3.1a/README.build-process.gz
>>> Done.
>>> extracting info
>>> extracting memtest86-3.1a
>>> Merging sys-apps/memtest86-3.1a to /
 *
 * Your boot partition was not mounted as /boot, but portage
 * was able to mount it without additional intervention.
 * Files will be installed there for memtest86 to function correctly.
 *
--- /boot/
--- /boot/memtest86/
>>> /boot/memtest86/memtest.bin
--- /usr/
--- /usr/share/
--- /usr/share/doc/
>>> /usr/share/doc/memtest86-3.1a/
>>> /usr/share/doc/memtest86-3.1a/README.gz
>>> /usr/share/doc/memtest86-3.1a/README.build-process.gz
 *
 * memtest.bin has been installed in /boot/memtest86/
 * You may wish to update your bootloader configs
 * by adding these lines:
 *  - For grub:
 *     > title=Memtest86
 *     > root (hd0,0)
 *     > kernel /memtest86/memtest.bin
 *  - For lilo:
 *     > image  = /boot/memtest86/memtest.bin
 *     > label  = Memtest86
 *
>>> Regenerating /etc/ld.so.cache...
 * Caching service dependencies...
>>> sys-apps/memtest86-3.1a merged.
>>> Recording sys-apps/memtest86 in "world" favorites file...

>>> clean: No packages selected for removal.

>>> Auto-cleaning packages ...

>>> No outdated packages were found on your system.


 * GNU info directory index is up-to-date.


Thanks! Cheers

SteveB
Comment 15 solar (RETIRED) gentoo-dev 2004-12-07 03:06:24 UTC
Note to self check and see if you added patches to the portage tree or just left it here on the bug.
Comment 16 SpanKY gentoo-dev 2004-12-07 06:43:30 UTC
i havent touched it and by the sounds of it you havent touched it and i highly doubt anyone else on base-system touched it ... ;)
Comment 17 solar (RETIRED) gentoo-dev 2004-12-07 07:13:47 UTC
Thanks self :)
Patched in ~arch
Feel free to mark stable when ready was put into ~arch (24 Sep 2004) bug #49002

--------------------------------------------------------------------------------
  07 Dec 2004; <solar@gentoo.org> +files/memtest86-3.1a-test-pic.patch,
  memtest86-3.1a.ebuild:
  - patched memtest86-3.1a to disable pic on test.c which was causing BREG
  errors when building. x86 asm guru needed to make the test pic aware someday
--------------------------------------------------------------------------------