Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 336020 - sys-libs/glibc-2.12.1-r1 crashes on Via C3-2 and AMD Geode LX cpus
Summary: sys-libs/glibc-2.12.1-r1 crashes on Via C3-2 and AMD Geode LX cpus
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High major with 2 votes (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 340643 368181 377257 380935 (view as bug list)
Depends on: 378485
Blocks:
  Show dependency tree
 
Reported: 2010-09-04 20:11 UTC by François MASSON
Modified: 2012-01-14 08:01 UTC (History)
8 users (show)

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


Attachments
environment (environment,144.69 KB, text/plain)
2010-09-04 20:21 UTC, François MASSON
Details
build.log (compressed with 7z) (build.7z,161.22 KB, text/plain)
2010-09-04 20:33 UTC, François MASSON
Details
build.log (gzip compressed, with FEATURES="-sandbox") (build.log.gz,242.54 KB, application/gzip)
2010-09-08 22:02 UTC, François MASSON
Details
environment (with FEATURES="-sandbox") (environment,145.09 KB, text/plain)
2010-09-08 22:03 UTC, François MASSON
Details

Note You need to log in before you can comment on or make changes to this bug.
Description François MASSON 2010-09-04 20:11:00 UTC
compilation error for sys-libs/glibc-2.12.1(-r1) on /sunrpc/xbootparam_prot.stmp

Reproducible: Always

Steps to Reproduce:
1. emerge -u glibc
2.
3.

Actual Results:  
 * ERROR: sys-libs/glibc-2.12.1-r1 failed:
 *   make for default failed
 *
 * Call stack:
 *           ebuild.sh, line   54:  Called src_compile
 *         environment, line 3745:  Called eblit-run 'src_compile'
 *         environment, line 1178:  Called eblit-glibc-src_compile
 *   src_compile.eblit, line  207:  Called toolchain-glibc_src_compile
 *   src_compile.eblit, line  123:  Called die
 * The specific snippet of code:
 *              emake || die "make for ${ABI} failed"
 *
 * If you need support, post the output of 'emerge --info =sys-libs/glibc-2.12.1-r1',
 * the complete build log and the output of 'emerge -pqv =sys-libs/glibc-2.12.1-r1'.
 * The complete build log is located at '/var/tmp/portage/sys-libs/glibc-2.12.1-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-libs/glibc-2.12.1-r1/temp/environment'.
 * S: '/var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/glibc-2.12.1'



Portage 2.1.8.3 (default/linux/x86/10.0, gcc-4.4.4, glibc-2.11.2-r0, 2.6.35-gentoo-r5 i686)
=================================================================
System uname: Linux-2.6.35-gentoo-r5-i686-VIA_Nehemiah-with-gentoo-2.0.1
Timestamp of tree: Sat, 04 Sep 2010 14:15:02 +0000
app-shells/bash:     4.1_p7
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.5-r3, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.2
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.9.6-r2, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.35
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA dlj-1.1"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Os -march=c3-2 -pipe -fomit-frame-pointer -finline-functions -mfpmath=sse,387"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-Os -march=c3-2 -pipe -fomit-frame-pointer -finline-functions -mfpmath=sse,387"
DISTDIR="/var/distfiles"
FEATURES="assume-digests distlocks fixpackages news paralell-fetch parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ http://mirror.ovh.net/gentoo-distfiles/ http://gentoo.mirror.sdv.fr/"
LANG="fr_FR.UTF-8"
LC_ALL="fr_FR.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="fr"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
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="/var/lib/layman/java-overlay /usr/local/portage"
SYNC="rsync://192.168.70.41/gentoo-portage"
USE="X509 a52 aac acl acpi alsa amr ao apache2 apm audacious audiofile bittorrent bzip2 cdr cgi clamav clamd cli cracklib crypt css cups curl curlwrappers cxx dbus dri dts dvbplayer dvd encode exif fam fame fastcgi fasttrack fat ffmpeg fftw firefox flac fltk force-cgi-redirect ftp fuse gd gdbm glut gnome gnutls gpm gps gs gtk gzip h323 httpd iconv ieee1394 imagemagick innodb iproute2 ipv6 irc javascript jpeg jpeg2k json lame libnotify lighttpd lm_sensors logrotate lzo matroska mime mimencode mjpeg mmap mmx mmxext mng modules motif mozdevelop mp3 mp4 mpeg mplayer mudflap mysql mysqli nas nat nautilus ncurses network network-cron nfs nls nptl nptlonly ntfs nuv nvram offensive ogg openal opengl openmp pam pcntl pcre pdf pdo perl php png ppds pppd python rar readline reflection reiserfs rpc rrdtool rtc rtsp sasl screen sdl secure-delete sensord session sharedext sharedmem shout speex spell spl sql srt sse ssl stream suexec suhosin svg sysfs syslog sysvipc szip t1lib tcpd theora threads tidy tiff transcode truetype udev unicode unzip upnp usb utils v4l2 vcd vdr vhosts vidix vlm vorbis win32codecs wma wmf x264 x86 xanim xattr xcb xcomposite xext xine xml xmlrpc xmlwriter xorg xosd xpm xrandr xscreensaver xterm xulrunner xv xvid xvmc yv12 zip zlib zvbi" 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 auth_digest authn_anon authn_dbd 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 dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="via" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 François MASSON 2010-09-04 20:17:10 UTC
 ~ # emerge -pqv =sys-libs/glibc-2.12.1-r1
[ebuild     U ] sys-libs/glibc-2.12.1-r1 [2.11.2] USE="gd nls -debug -glibc-omitfp (-hardened) (-multilib) -profile (-selinux) -vanilla"

I have 2 hardware identical computer which exibits the same problem.
I tried various CFLAGS including simple CFLAGS="-Os -march=c3-2" whitout changes.
I also tried with MAKEOPTS="-j1" succesless.
Comment 2 François MASSON 2010-09-04 20:21:20 UTC
Created attachment 246031 [details]
environment
Comment 3 François MASSON 2010-09-04 20:33:56 UTC
Created attachment 246034 [details]
build.log (compressed with 7z)
Comment 4 hubertstar 2010-09-06 08:45:42 UTC
same problem here.
change cflags, use -sandbox features, use makeopts with -j1 ...
always failed.

Comment 5 François MASSON 2010-09-07 12:41:56 UTC
I tried with -O2 no succes, nor with -O1, neither with -march=i686
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2010-09-07 16:41:40 UTC
(In reply to comment #4)
> same problem here.

It's not the same problem until you've attached a build log that exhibits the exact same error message.
Comment 7 Ryan Hill (RETIRED) gentoo-dev 2010-09-08 00:09:45 UTC
Yeah, I'm not sure why we'd need another build log, but another emerge --info would be useful.
Comment 8 Ryan Hill (RETIRED) gentoo-dev 2010-09-08 00:23:23 UTC
Scratch that.

*** This bug has been marked as a duplicate of bug 334387 ***
Comment 9 François MASSON 2010-09-08 21:58:38 UTC
Tried to emerge on one of my box that neved had any fancy CFLAGS, with sandbox _not_ in FEATURES and this does not work.

What is surprising in build.log is :
checking for SSE4 support... yes

C3-2 aka via Nehemiah never had support for SSE4 !!

~ # cat /proc/cpuinfo 
processor       : 0
vendor_id       : CentaurHauls
cpu family      : 6
model           : 9
model name      : VIA Nehemiah
stepping        : 8
cpu MHz         : 532.000
cache size      : 64 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 cx8 sep mtrr pge cmov pat mmx fxsr sse rng rng_en ace ace_en
bogomips        : 1066.50
clflush size    : 32
cache_alignment : 32
address sizes   : 32 bits physical, 32 bits virtual
power management:
Comment 10 François MASSON 2010-09-08 22:02:14 UTC
Created attachment 246501 [details]
build.log (gzip compressed, with FEATURES="-sandbox")
Comment 11 François MASSON 2010-09-08 22:03:54 UTC
Created attachment 246503 [details]
environment (with FEATURES="-sandbox")
Comment 12 Ryan Hill (RETIRED) gentoo-dev 2010-09-09 00:49:47 UTC
It wasn't sandbox that I was looking at...

"also, drop the -mfpmath=sse cruft from your CFLAGS and rebuild important
packages"
Comment 13 François MASSON 2010-09-09 21:07:14 UTC
I did re-emerge gcc, binutils and linux-headers before glibc and no success.
(neither on my box that once had fancy CFLAGS nor on the box that never had anything but CFLAGS="-Os -march=c3-2 -pipe -fomit-frame-pointer")

Did you mean something more by "important packages" beside those ?

Comment 14 François MASSON 2010-09-14 14:28:50 UTC
I tried to debug the problem with gdb;
epia1 ~ #  cd /var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/
epia1 build-default-i686-pc-linux-gnu-nptl # cd sunrpc/
epia1 sunrpc # CPP="i686-pc-linux-gnu-gcc -E -x c-header"  gdb --args /var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/elf/ld-linux.so.2 --library-path /var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl:/var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/math:/var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/elf:/var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/dlfcn:/var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/nss:/var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/nis:/var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/rt:/var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/resolv:/var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/crypt:/var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/nptl /var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/sunrpc/rpcgen -Y ../scripts -c rpcsvc/bootparam_prot.x -o /var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/sunrpc/xbootparam_prot.T
GNU gdb (Gentoo 7.1 p1) 7.1
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/elf/ld-linux.so.2...done.
(gdb) run
Starting program: /var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/elf/ld-linux.so.2 --library-path /var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl:/var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/math:/var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/elf:/var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/dlfcn:/var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/nss:/var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/nis:/var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/rt:/var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/resolv:/var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/crypt:/var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/nptl /var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/sunrpc/rpcgen -Y ../scripts -c rpcsvc/bootparam_prot.x -o /var/tmp/portage/sys-libs/glibc-2.12.1-r1/work/build-default-i686-pc-linux-gnu-nptl/sunrpc/xbootparam_prot.T

Program received signal SIGILL, Illegal instruction.
0xb7fe34e1 in elf_dynamic_do_rel (arg=<value optimized out>) at do-rel.h:104
104               for (; relative < r; ++relative)
(gdb) bt
#0  0xb7fe34e1 in elf_dynamic_do_rel (arg=<value optimized out>) at do-rel.h:104
#1  _dl_start (arg=<value optimized out>) at rtld.c:544
#2  0xb7fe28f7 in _start ()
(gdb) disas
Dump of assembler code for function _dl_start:
   0xb7fe31a0 <+0>:     push   %ebp
   0xb7fe31a1 <+1>:     mov    %esp,%ebp
   0xb7fe31a3 <+3>:     push   %edi
   0xb7fe31a4 <+4>:     push   %esi
   0xb7fe31a5 <+5>:     push   %ebx
   0xb7fe31a6 <+6>:     sub    $0x34,%esp
   0xb7fe31a9 <+9>:     call   0xb7ffb8fb <__i686.get_pc_thunk.bx>
   0xb7fe31ae <+14>:    add    $0x1ee16,%ebx
   0xb7fe31b4 <+20>:    mov    %eax,-0x30(%ebp)
   0xb7fe31b7 <+23>:    rdtsc
   0xb7fe31b9 <+25>:    mov    %edx,-0x118(%ebx)
   0xb7fe31bf <+31>:    mov    0x0(%ebx),%edx
   0xb7fe31c5 <+37>:    lea    -0xc8(%ebx),%ecx
   0xb7fe31cb <+43>:    mov    %eax,-0x11c(%ebx)
   0xb7fe31d1 <+49>:    sub    %edx,%ecx
   0xb7fe31d3 <+51>:    lea    (%ecx,%edx,1),%edx
   0xb7fe31d6 <+54>:    mov    %ecx,0x558(%ebx)
   0xb7fe31dc <+60>:    mov    %edx,0x560(%ebx)
   0xb7fe31e2 <+66>:    mov    (%edx),%eax
   0xb7fe31e4 <+68>:    test   %eax,%eax
   0xb7fe31e6 <+70>:    je     0xb7fe322e <_dl_start+142>
   0xb7fe31e8 <+72>:    lea    0x48(%ebx),%esi
   0xb7fe31ee <+78>:    jmp    0xb7fe3200 <_dl_start+96>
   0xb7fe31f0 <+80>:    mov    %edx,0x530(%esi,%eax,4)
   0xb7fe31f7 <+87>:    add    $0x8,%edx
   0xb7fe31fa <+90>:    mov    (%edx),%eax
   0xb7fe31fc <+92>:    test   %eax,%eax
   0xb7fe31fe <+94>:    je     0xb7fe3228 <_dl_start+136>
   0xb7fe3200 <+96>:    cmp    $0x21,%eax
   0xb7fe3203 <+99>:    jbe    0xb7fe31f0 <_dl_start+80>
   0xb7fe3205 <+101>:   mov    $0x6fffffff,%ecx
   0xb7fe320a <+106>:   sub    %eax,%ecx
   0xb7fe320c <+108>:   cmp    $0xf,%ecx
   0xb7fe320f <+111>:   ja     0xb7fe3390 <_dl_start+496>
   0xb7fe3215 <+117>:   mov    $0x7000016d,%ecx
   0xb7fe321a <+122>:   sub    %eax,%ecx
   0xb7fe321c <+124>:   mov    %edx,(%esi,%ecx,4)
   0xb7fe321f <+127>:   add    $0x8,%edx
   0xb7fe3222 <+130>:   mov    (%edx),%eax
   0xb7fe3224 <+132>:   test   %eax,%eax
   0xb7fe3226 <+134>:   jne    0xb7fe3200 <_dl_start+96>
   0xb7fe3228 <+136>:   mov    0x558(%ebx),%ecx
   0xb7fe322e <+142>:   test   %ecx,%ecx
   0xb7fe3230 <+144>:   je     0xb7fe329a <_dl_start+250>
   0xb7fe3232 <+146>:   mov    0x588(%ebx),%eax
   0xb7fe3238 <+152>:   test   %eax,%eax
   0xb7fe323a <+154>:   je     0xb7fe323f <_dl_start+159>
   0xb7fe323c <+156>:   add    %ecx,0x4(%eax)
   0xb7fe323f <+159>:   mov    0x584(%ebx),%eax
   0xb7fe3245 <+165>:   test   %eax,%eax
   0xb7fe3247 <+167>:   je     0xb7fe324c <_dl_start+172>
   0xb7fe3249 <+169>:   add    %ecx,0x4(%eax)
   0xb7fe324c <+172>:   mov    0x58c(%ebx),%eax
   0xb7fe3252 <+178>:   test   %eax,%eax
   0xb7fe3254 <+180>:   je     0xb7fe3259 <_dl_start+185>
   0xb7fe3256 <+182>:   add    %ecx,0x4(%eax)
   0xb7fe3259 <+185>:   mov    0x590(%ebx),%eax
   0xb7fe325f <+191>:   test   %eax,%eax
   0xb7fe3261 <+193>:   je     0xb7fe3266 <_dl_start+198>
   0xb7fe3263 <+195>:   add    %ecx,0x4(%eax)
   0xb7fe3266 <+198>:   mov    0x5bc(%ebx),%eax
   0xb7fe326c <+204>:   test   %eax,%eax
   0xb7fe326e <+206>:   je     0xb7fe3273 <_dl_start+211>
   0xb7fe3270 <+208>:   add    %ecx,0x4(%eax)
   0xb7fe3273 <+211>:   mov    0x5d4(%ebx),%eax
   0xb7fe3279 <+217>:   test   %eax,%eax
   0xb7fe327b <+219>:   je     0xb7fe3280 <_dl_start+224>
   0xb7fe327d <+221>:   add    %ecx,0x4(%eax)
   0xb7fe3280 <+224>:   mov    0x63c(%ebx),%eax
   0xb7fe3286 <+230>:   test   %eax,%eax
   0xb7fe3288 <+232>:   je     0xb7fe328d <_dl_start+237>
   0xb7fe328a <+234>:   add    %ecx,0x4(%eax)
   0xb7fe328d <+237>:   mov    0x6a4(%ebx),%eax
   0xb7fe3293 <+243>:   test   %eax,%eax
   0xb7fe3295 <+245>:   je     0xb7fe329a <_dl_start+250>
   0xb7fe3297 <+247>:   add    %ecx,0x4(%eax)
   0xb7fe329a <+250>:   mov    0x5c8(%ebx),%edx
   0xb7fe32a0 <+256>:   test   %edx,%edx
   0xb7fe32a2 <+258>:   je     0xb7fe32ae <_dl_start+270>
   0xb7fe32a4 <+260>:   cmpl   $0x11,0x4(%edx)
   0xb7fe32a8 <+264>:   jne    0xb7fe3660 <_dl_start+1216>
   0xb7fe32ae <+270>:   mov    0x5bc(%ebx),%eax
   0xb7fe32b4 <+276>:   test   %eax,%eax
   0xb7fe32b6 <+278>:   je     0xb7fe32c8 <_dl_start+296>
   0xb7fe32b8 <+280>:   mov    0x5c4(%ebx),%ecx
   0xb7fe32be <+286>:   cmpl   $0x8,0x4(%ecx)
   0xb7fe32c2 <+290>:   jne    0xb7fe3732 <_dl_start+1426>
   0xb7fe32c8 <+296>:   mov    0x610(%ebx),%ecx
   0xb7fe32ce <+302>:   test   %ecx,%ecx
   0xb7fe32d0 <+304>:   je     0xb7fe32dc <_dl_start+316>
   0xb7fe32d2 <+306>:   cmpl   $0x1,0x4(%ecx)
   0xb7fe32d6 <+310>:   jne    0xb7fe3708 <_dl_start+1384>
   0xb7fe32dc <+316>:   mov    0x5f0(%ebx),%ecx
   0xb7fe32e2 <+322>:   test   %ecx,%ecx
   0xb7fe32e4 <+324>:   je     0xb7fe32f0 <_dl_start+336>
   0xb7fe32e6 <+326>:   cmpl   $0x8,0x4(%ecx)
   0xb7fe32ea <+330>:   jne    0xb7fe36de <_dl_start+1342>
   0xb7fe32f0 <+336>:   mov    0x5ec(%ebx),%ecx
   0xb7fe32f6 <+342>:   test   %ecx,%ecx
   0xb7fe32f8 <+344>:   jne    0xb7fe36b4 <_dl_start+1300>
   0xb7fe32fe <+350>:   mov    0x5b4(%ebx),%edi
   0xb7fe3304 <+356>:   test   %edi,%edi
   0xb7fe3306 <+358>:   jne    0xb7fe3636 <_dl_start+1174>
   0xb7fe330c <+364>:   mov    0x558(%ebx),%edi
   0xb7fe3312 <+370>:   test   %edi,%edi
   0xb7fe3314 <+372>:   jne    0xb7fe3478 <_dl_start+728>
   0xb7fe331a <+378>:   mov    0x674(%ebx),%esi
   0xb7fe3320 <+384>:   test   %esi,%esi
   0xb7fe3322 <+386>:   je     0xb7fe3478 <_dl_start+728>
   0xb7fe3328 <+392>:   mov    -0x1c0(%ebx),%eax
   0xb7fe332e <+398>:   orb    $0x4,0x6ec(%ebx)
   0xb7fe3335 <+405>:   or     -0x1c4(%ebx),%eax
   0xb7fe333b <+411>:   jne    0xb7fe33dc <_dl_start+572>
   0xb7fe3341 <+417>:   mov    $0xffffffff,%esi
   0xb7fe3346 <+422>:   mov    $0xffffffff,%edi
   0xb7fe334b <+427>:   movl   $0xffffffff,-0x1c(%ebp)
   0xb7fe3352 <+434>:   mov    $0x5,%ecx
   0xb7fe3357 <+439>:   movl   $0xffffffff,-0x18(%ebp)
   0xb7fe335e <+446>:   rdtsc
   0xb7fe3360 <+448>:   mov    %eax,-0x24(%ebp)
   0xb7fe3363 <+451>:   mov    %edx,-0x20(%ebp)
   0xb7fe3366 <+454>:   rdtsc
   0xb7fe3368 <+456>:   sub    -0x24(%ebp),%eax
   0xb7fe336b <+459>:   sbb    -0x20(%ebp),%edx
   0xb7fe336e <+462>:   cmp    %edx,-0x18(%ebp)
   0xb7fe3371 <+465>:   ja     0xb7fe337e <_dl_start+478>
   0xb7fe3373 <+467>:   jb     0xb7fe337a <_dl_start+474>
   0xb7fe3375 <+469>:   cmp    %eax,-0x1c(%ebp)
   0xb7fe3378 <+472>:   ja     0xb7fe337e <_dl_start+478>
   0xb7fe337a <+474>:   mov    %esi,%eax
   0xb7fe337c <+476>:   mov    %edi,%edx
   0xb7fe337e <+478>:   dec    %ecx
   0xb7fe337f <+479>:   nop
   0xb7fe3380 <+480>:   je     0xb7fe33d0 <_dl_start+560>
   0xb7fe3382 <+482>:   mov    %eax,%esi
   0xb7fe3384 <+484>:   mov    %edx,%edi
   0xb7fe3386 <+486>:   mov    %eax,-0x1c(%ebp)
   0xb7fe3389 <+489>:   mov    %edx,-0x18(%ebp)
   0xb7fe338c <+492>:   jmp    0xb7fe335e <_dl_start+446>
   0xb7fe338e <+494>:   xchg   %ax,%ax
   0xb7fe3390 <+496>:   lea    (%eax,%eax,1),%ecx
   0xb7fe3393 <+499>:   sar    %ecx
   0xb7fe3395 <+501>:   cmp    $0xfffffffc,%ecx
   0xb7fe3398 <+504>:   jbe    0xb7fe33b0 <_dl_start+528>
   0xb7fe339a <+506>:   not    %ecx
   0xb7fe339c <+508>:   mov    %edx,0x5f8(%esi,%ecx,4)
   0xb7fe33a3 <+515>:   jmp    0xb7fe31f7 <_dl_start+87>
   0xb7fe33a8 <+520>:   nopl   0x0(%eax,%eax,1)
   0xb7fe33b0 <+528>:   mov    $0x6ffffdff,%ecx
   0xb7fe33b5 <+533>:   sub    %eax,%ecx
   0xb7fe33b7 <+535>:   cmp    $0xb,%ecx
   0xb7fe33ba <+538>:   ja     0xb7fe3580 <_dl_start+992>
   0xb7fe33c0 <+544>:   mov    $0x6fffff80,%ecx
   0xb7fe33c5 <+549>:   sub    %eax,%ecx
   0xb7fe33c7 <+551>:   mov    %edx,(%esi,%ecx,4)
   0xb7fe33ca <+554>:   jmp    0xb7fe31f7 <_dl_start+87>
   0xb7fe33cf <+559>:   nop
   0xb7fe33d0 <+560>:   mov    %eax,-0x1c4(%ebx)
   0xb7fe33d6 <+566>:   mov    %edx,-0x1c0(%ebx)
   0xb7fe33dc <+572>:   lea    0x558(%ebx),%eax
   0xb7fe33e2 <+578>:   call   0xb7feb950 <_dl_setup_hash>
   0xb7fe33e7 <+583>:   lea    0x558(%ebx),%eax
   0xb7fe33ed <+589>:   mov    %eax,0x56c(%ebx)
   0xb7fe33f3 <+595>:   lea    -0x1ffc4(%ebx),%eax
   0xb7fe33f9 <+601>:   mov    %eax,0x704(%ebx)
   0xb7fe33ff <+607>:   lea    0x934(%ebx),%eax
   0xb7fe3405 <+613>:   mov    %eax,0x708(%ebx)
   0xb7fe340b <+619>:   lea    -0x6593(%ebx),%eax
   0xb7fe3411 <+625>:   mov    %eax,0x70c(%ebx)
   0xb7fe3417 <+631>:   rdtsc
   0xb7fe3419 <+633>:   mov    %edx,0x540(%ebx)
   0xb7fe341f <+639>:   mov    -0x30(%ebp),%edx
   0xb7fe3422 <+642>:   mov    %eax,0x53c(%ebx)
   0xb7fe3428 <+648>:   lea    -0x1d894(%ebx),%eax
   0xb7fe342e <+654>:   mov    %ebp,-0xd4(%ebx)
   0xb7fe3434 <+660>:   mov    %eax,0x4(%esp)
   0xb7fe3438 <+664>:   mov    %edx,(%esp)
   0xb7fe343b <+667>:   call   0xb7ff8bc0 <_dl_sysdep_start>
   0xb7fe3440 <+672>:   mov    %eax,%esi
   0xb7fe3442 <+674>:   rdtsc
   0xb7fe3444 <+676>:   mov    %edx,-0x18(%ebp)
   0xb7fe3447 <+679>:   mov    -0x118(%ebx),%ecx
   0xb7fe344d <+685>:   mov    -0x11c(%ebx),%edx
   0xb7fe3453 <+691>:   cmpb   $0x0,-0x344(%ebx)
   0xb7fe345a <+698>:   mov    %eax,-0x1c(%ebp)
   0xb7fe345d <+701>:   mov    %ecx,-0x20(%ebp)
   0xb7fe3460 <+704>:   mov    %edx,-0x24(%ebp)
   0xb7fe3463 <+707>:   js     0xb7fe3617 <_dl_start+1143>
   0xb7fe3469 <+713>:   add    $0x34,%esp
   0xb7fe346c <+716>:   mov    %esi,%eax
   0xb7fe346e <+718>:   pop    %ebx
   0xb7fe346f <+719>:   pop    %esi
   0xb7fe3470 <+720>:   pop    %edi
   0xb7fe3471 <+721>:   pop    %ebp
   0xb7fe3472 <+722>:   ret
   0xb7fe3473 <+723>:   nopl   0x0(%eax,%eax,1)
   0xb7fe3478 <+728>:   test   %eax,%eax
   0xb7fe347a <+730>:   je     0xb7fe359f <_dl_start+1023>
   0xb7fe3480 <+736>:   mov    0x4(%eax),%esi
   0xb7fe3483 <+739>:   mov    0x5c0(%ebx),%eax
   0xb7fe3489 <+745>:   mov    0x4(%eax),%eax
   0xb7fe348c <+748>:   lea    (%eax,%esi,1),%ecx
   0xb7fe348f <+751>:   mov    %ecx,-0x24(%ebp)
   0xb7fe3492 <+754>:   test   %edx,%edx
   0xb7fe3494 <+756>:   je     0xb7fe34b9 <_dl_start+793>
   0xb7fe3496 <+758>:   mov    0x5d4(%ebx),%edx
   0xb7fe349c <+764>:   mov    -0x24(%ebp),%ecx
   0xb7fe349f <+767>:   cmp    %ecx,0x4(%edx)
   0xb7fe34a2 <+770>:   jne    0xb7fe368a <_dl_start+1258>
   0xb7fe34a8 <+776>:   mov    0x580(%ebx),%edx
   0xb7fe34ae <+782>:   mov    0x4(%edx),%ecx
   0xb7fe34b1 <+785>:   add    %ecx,%eax
   0xb7fe34b3 <+787>:   lea    (%eax,%esi,1),%edx
   0xb7fe34b6 <+790>:   mov    %edx,-0x24(%ebp)
   0xb7fe34b9 <+793>:   mov    0x590(%ebx),%edx
   0xb7fe34bf <+799>:   mov    0x4(%edx),%edx
   0xb7fe34c2 <+802>:   mov    %edx,-0x28(%ebp)
   0xb7fe34c5 <+805>:   mov    0x614(%ebx),%edx
   0xb7fe34cb <+811>:   test   %edx,%edx
   0xb7fe34cd <+813>:   je     0xb7fe3509 <_dl_start+873>
   0xb7fe34cf <+815>:   mov    0x4(%edx),%edx
   0xb7fe34d2 <+818>:   shr    $0x3,%eax
   0xb7fe34d5 <+821>:   cmp    %edx,%eax
   0xb7fe34d7 <+823>:   cmova  %edx,%eax
   0xb7fe34da <+826>:   lea    (%esi,%eax,8),%edx
   0xb7fe34dd <+829>:   cmp    %edx,%esi
   0xb7fe34df <+831>:   jae    0xb7fe3507 <_dl_start+871>
=> 0xb7fe34e1 <+833>:   data32 data32 data32 data32 data32 cs nopw %cs:0x0(%eax,%eax,1)
   0xb7fe34f0 <+848>:   cmpb   $0x8,0x4(%esi)
   0xb7fe34f4 <+852>:   mov    (%esi),%eax
   0xb7fe34f6 <+854>:   jne    0xb7fe35ad <_dl_start+1037>
   0xb7fe34fc <+860>:   add    %edi,%eax
   0xb7fe34fe <+862>:   add    $0x8,%esi
   0xb7fe3501 <+865>:   add    %edi,(%eax)
   0xb7fe3503 <+867>:   cmp    %esi,%edx
   0xb7fe3505 <+869>:   ja     0xb7fe34f0 <_dl_start+848>
   0xb7fe3507 <+871>:   mov    %edx,%esi
   0xb7fe3509 <+873>:   mov    0x63c(%ebx),%edx
   0xb7fe350f <+879>:   test   %edx,%edx
   0xb7fe3511 <+881>:   je     0xb7fe35ed <_dl_start+1101>
   0xb7fe3517 <+887>:   cmp    %esi,-0x24(%ebp)
   0xb7fe351a <+890>:   jbe    0xb7fe3328 <_dl_start+392>
   0xb7fe3520 <+896>:   mov    %edi,-0x2c(%ebp)
   0xb7fe3523 <+899>:   data32 data32 data32 cs nopw %cs:0x0(%eax,%eax,1)
   0xb7fe3530 <+912>:   mov    (%esi),%ecx
   0xb7fe3532 <+914>:   mov    -0x28(%ebp),%eax
   0xb7fe3535 <+917>:   mov    0x558(%ebx),%edx
   0xb7fe353b <+923>:   mov    %ecx,-0x1c(%ebp)
   0xb7fe353e <+926>:   mov    0x4(%esi),%edi
   0xb7fe3541 <+929>:   mov    %edi,%ecx
   0xb7fe3543 <+931>:   shr    $0x8,%ecx
   0xb7fe3546 <+934>:   shl    $0x4,%ecx
   0xb7fe3549 <+937>:   add    %eax,%ecx
   0xb7fe354b <+939>:   mov    0x4(%ecx),%eax
   0xb7fe354e <+942>:   add    %edx,%eax
Comment 15 François MASSON 2010-09-14 22:46:19 UTC
After et litle googling, I think this bug is not specific to gentoo.

Fedora seem to have similar reports :
https://bugzilla.redhat.com/show_bug.cgi?id=579838

see this link too:
http://sourceware.org/bugzilla/show_bug.cgi?id=6957
Comment 16 SpanKY gentoo-dev 2010-09-29 23:01:14 UTC
looks to me like it's going to take a crap ton of patches to "fix" this properly as it affects multiple toolchain packages
Comment 17 SpanKY gentoo-dev 2010-09-29 23:03:24 UTC
which is to say, i dont plan on looking into this.  instead, i'll just wait for the normal "trickle down" of versions.

if, however, you located the patches required to fix this now, i'd be happy to include them sooner.
Comment 18 François MASSON 2010-09-30 23:27:00 UTC
I tried various patchs but without succes for now.
I'm still trying, but compiling toolchain+glibc on this rather old hardware take a long time.
If/When I manage to compile glibc, I'll gladly share the patch here. 
Comment 19 François MASSON 2010-10-05 12:40:02 UTC
The patch from redhat ( https://bugzilla.redhat.com/attachment.cgi?id=425520&action=diff ) work. This patch simply disable i686 optimisation in as (gnu assembler).

glibc use runtime detection for i686 optional instruction set (as mmx, sse, avx, fam...) so reducing allowed instruction by as does work. (i.e. -Wa,-march=i686 fail on optimised function as strcmp-sse4.S)

Fix could be runtime detection/alternate path for nopl... but I don't think an op that does nothing value the cost of another path.


>=sys-devel/binutils-2.20.51.0.11 doesn't allow nopl for plain i686 arch so it should be possible to compile glibc, optimised for i686 without nopl.
It managed to compile glibc with CFLAGS='-march=c3-2 -Wa,-march=i686+mmx+sse+sse4+fma' (i686+mmx+sse describes a c3-2 while sse4 and fma are needed to compile optimised alternate path) but ended with a non fonctional glibc.

I'll try a more specific patch to glibc to enable optimised instruction set (sse4 and fma) only in relevant part.

Note: even with redhat patch, parts of glibc written in C are optimised for requested march (i.e. do use cmov*, etc.), only some asm parts are suboptimised.
Comment 20 SpanKY gentoo-dev 2010-10-05 20:11:49 UTC
please dont revert the summary

you can place the patch in question in your /etc/portage/patches/ tree to have it applied automatically.  but i wont be including that in our glibc patchset.  i'm interested in correct fixes, not temporary hacks.
Comment 21 Stefan de Konink 2010-10-13 14:38:44 UTC
*** Bug 340643 has been marked as a duplicate of this bug. ***
Comment 22 Stefan de Konink 2010-10-13 16:25:36 UTC
Confirmed for Epia c3-2 :)
Comment 23 Marcin Mirosław 2010-10-26 08:10:45 UTC
(In reply to comment #20)
> you can place the patch in question in your /etc/portage/patches/ tree to have
> it applied automatically.

Could somebody give me link to handbook/doc/man where this functionality is mentioned? And please forgive me little OT.
Comment 24 SpanKY gentoo-dev 2010-10-26 09:22:51 UTC
read epatch_user in eutils.eclass
Comment 25 François MASSON 2011-02-12 14:43:17 UTC
Hello,
I juste wanted to let you know that with this upstream patch for binutils, AS doesn't generate nopl when not instructed to.
http://sourceware.org/ml/binutils/2011-02/txt00005.txt

sys-libs/glic-2.13 compile and work with sys-devel/binutils-2.21.51.0.6 and sys-devel/binutils-2.21 on C3-2.

Comment 26 SpanKY gentoo-dev 2011-02-12 19:43:11 UTC
is that the only patch you needed then ?  including that into binutils-2.21 is fine by me as it's nice and small and is upstream already ;).
Comment 27 François MASSON 2011-02-14 13:32:14 UTC
Yes,
This is the only patch needed.

You will have to adjust the patch against those 2 files as they won't match :
gas/ChangeLog
gas/testsuite/ChangeLog
Comment 28 SpanKY gentoo-dev 2011-05-24 02:38:24 UTC
*** Bug 368181 has been marked as a duplicate of this bug. ***
Comment 29 Jeroen Roovers (RETIRED) gentoo-dev 2011-05-24 13:07:52 UTC
As I was going to note on bug #368181, upgrading to binutils-2.21 didn't do it to get glibc-2.12.2 built.
Comment 30 cilly 2011-05-24 13:12:02 UTC
(In reply to comment #29)
> As I was going to note on bug #368181, upgrading to binutils-2.21 didn't do it
> to get glibc-2.12.2 built.

which binutils version did you use?

As I recall, the patch was included in binutils >= 2.20.51.0.11.
Comment 31 Jeroen Roovers (RETIRED) gentoo-dev 2011-05-24 13:19:28 UTC
(In reply to comment #30)
> (In reply to comment #29)
> > As I was going to note on bug #368181, upgrading to binutils-2.21 didn't do it
> > to get glibc-2.12.2 built.
> 
> which binutils version did you use?

I just said, didn't I?

> As I recall, the patch was included in binutils >= 2.20.51.0.11.

2.21 > 2.20.51.0.11 (I should think.)
Comment 32 cilly 2011-05-24 17:18:03 UTC
Probably this is a hardened only problem, since I got:

May 20 18:27:30 pluto kernel: [101175.493571] grsec: From 172.16.17.10: denied resource overstep by requesting 4096 for RLIMIT_CORE against limit 0 for /var/tmp/portage/sys-libs/glibc-2.12.2/work/build-default-i686-pc-linux-gnu-nptl/elf/ld.so[ld-linux.so.2:26919] uid/euid:0/0 gid/egid:0/0, parent /bin/bash[sh:26918] uid/euid:0/0 gid/egid:0/0

while compiling glibc-2.12.2.

?
Comment 33 Al Johnson 2011-05-29 11:14:45 UTC
For reference the upstream bug is here:
http://sourceware.org/bugzilla/show_bug.cgi?id=6957

Apparently the changes in 2.20.51.0.11 didn't actually fix it, but 2.21.5.0.6 is supposed to.
Comment 34 Patrick Hieber 2011-06-07 14:46:49 UTC
confirmed!
same probs here with sys-libs/glibc-2.12.2 and Nehemiah
Comment 35 Steven Peckins 2011-06-09 12:05:00 UTC
> Apparently the changes in 2.20.51.0.11 didn't actually fix it, but 2.21.5.0.6
> is supposed to.

Upgrading binutils to 2.21.5.0.6 didn't work for building glibc-2.12.2 for me.  It still crashes at the same point ("...sunrpc/xbootparam_prot.stmp] Error 132").  Neither did 2.21.5.0.7, 2.21.5.0.8, or 2.21.5.0.9.  glibc-2.13-r2 wouldn't work either.  I'm on a VIA C3-2.
Comment 36 Rene Hertell 2011-06-12 07:58:27 UTC
(In reply to comment #34)
> confirmed!
> same probs here with sys-libs/glibc-2.12.2 and Nehemiah
Comment 37 Rene Hertell 2011-06-12 08:01:06 UTC
(In reply to comment #34)
> confirmed!
> same probs here with sys-libs/glibc-2.12.2 and Nehemiah

One more confirmation from a Via Epia Nehemiah-user
Comment 38 Jeroen Roovers (RETIRED) gentoo-dev 2011-07-16 04:19:08 UTC
No progress with =sys-devel/binutils-2.21.1
Comment 39 SpanKY gentoo-dev 2011-07-21 03:50:27 UTC
sorry, but what does that mean exactly ?  binutils-2.21.1 doesnt fix the issue ?
Comment 40 Jeroen Roovers (RETIRED) gentoo-dev 2011-07-21 13:17:45 UTC
binutils-2.21.1 doesnt fix the issue
Comment 41 Jeroen Roovers (RETIRED) gentoo-dev 2011-08-01 21:03:24 UTC
*** Bug 377257 has been marked as a duplicate of this bug. ***
Comment 42 Radoslaw Madej (radegand) 2011-08-07 09:47:23 UTC
(In reply to comment #40)
> binutils-2.21.1 doesnt fix the issue

ditto the above. :(
Comment 43 cilly 2011-08-08 10:26:06 UTC
(In reply to comment #42)
> (In reply to comment #40)
> > binutils-2.21.1 doesnt fix the issue
> 
> ditto the above. :(

What are your flags?

As reported in http://sourceware.org/bugzilla/show_bug.cgi?id=6957 it should be fixed in binutils 2.21 branch...
Comment 44 cilly 2011-08-08 10:36:22 UTC
Source of binutils 2.21.1 reads in tc-i386.c:


  /* We need to decide which NOP sequence to use for 32bit and
     64bit. When -mtune= is used:

     1. For PROCESSOR_I386, PROCESSOR_I486, PROCESSOR_PENTIUM and
     PROCESSOR_GENERIC32, f32_patt will be used.
     2. For PROCESSOR_PENTIUMPRO, PROCESSOR_PENTIUM4, PROCESSOR_NOCONA,
     PROCESSOR_CORE, PROCESSOR_CORE2, PROCESSOR_COREI7, and
     PROCESSOR_GENERIC64, alt_long_patt will be used.
     3. For PROCESSOR_ATHLON, PROCESSOR_K6, PROCESSOR_K8 and
     PROCESSOR_AMDFAM10, and PROCESSOR_BDVER1, alt_short_patt
     will be used.

     When -mtune= isn't used, alt_long_patt will be used if
     cpu_arch_isa_flags has CpuNop.  Otherwise, f32_patt will
     be used.

     When -march= or .arch is used, we can't use anything beyond
     cpu_arch_isa_flags.   */
Comment 45 cilly 2011-08-08 11:50:35 UTC
May be this link is of any help:

https://bugzilla.redhat.com/show_bug.cgi?id=579838
Comment 46 cilly 2011-08-08 12:29:38 UTC
HINTS:

You must use -mtune=i686!

In binutils-2.21.1 nopl was removed from i686.

Working glibc must be compiled against newly upgraded binutils-2.21.1 BEFORE upgrading to glibc >2.12.
Comment 47 cilly 2011-08-09 11:59:59 UTC
binutils-2.21.1 solves this bug, confirmed!

For compiling, see previous comment.

Pls, close bug and mark as resolved (in binutils-2.21.1) by upstream.

Portage 2.1.10.3 (hardened/linux/x86, gcc-4.4.5, glibc-2.12.2-r0, 2.6.32.43-r3 i686)
=================================================================
System uname: Linux-2.6.32.43-r3-i686-VIA_Nehemiah-with-gentoo-2.0.3
Timestamp of tree: Tue, 09 Aug 2011 00:45:01 +0000
app-shells/bash:          4.1_p9
dev-lang/python:          2.7.1-r1, 3.1.3-r1
dev-util/cmake:           2.8.4-r1
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.8.3-r1
sys-apps/sandbox:         2.4
sys-devel/autoconf:       2.68
sys-devel/automake:       1.11.1
sys-devel/binutils:       2.21.1
sys-devel/gcc:            4.4.5
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82
sys-kernel/linux-headers: 2.6.36.1 (virtual/os-headers)
sys-libs/glibc:           2.12.2
Repositories: gentoo local
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=i686 -mtune=i686 -mmmx -msse -mfpmath=sse -Os -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
Comment 48 Jeroen Roovers (RETIRED) gentoo-dev 2011-08-09 16:11:15 UTC
(In reply to comment #46)
> HINTS:
> 
> You must use -mtune=i686!
> 
> In binutils-2.21.1 nopl was removed from i686.
> 
> Working glibc must be compiled against newly upgraded binutils-2.21.1 BEFORE
> upgrading to glibc >2.12.

So the complete recipe appears to be:

1) Add -mtune=i686 to CFLAGS
2) Emerge =sys-devel/binutils-2.21.1
3) Re-emerge <=sys-libs/glibc-2.12
4) Emerge =sys-libs/glibc-2.12*

Can you confirm that?
Comment 49 cilly 2011-08-09 17:25:55 UTC
(In reply to comment #48)

> 
> 1) Add -mtune=i686 to CFLAGS
> 2) Emerge =sys-devel/binutils-2.21.1
> 3) Re-emerge <=sys-libs/glibc-2.12
> 4) Emerge =sys-libs/glibc-2.12*
> 
> Can you confirm that?

That may work.

What I did:

Your steps 1-3 (don't forget to source profile after step2), but then I first compiled the toolchain completely with the old glibc compiled against binutils-2.21.1. So my step 4 was:

4) re-emerge gcc
5) re-emerge binutils
6) re-emerge glibc
7) upgrade glibc (2.12*)

Fur sure according to docs of binutils "-mtune=i686" limits instruction set to i686 only, meaning the i686 specs which is now fixed in binutils-2.21.1. Earlier versions did add nopl which is not part of the i686 specs. For the history, all Intel cpus meeting the i686 specs have nopl, this might be why devs of binutils thought hopl is in i686 specs. Other cpus like AMD or VIA which meet the i686 specs might or might not have nopl.

To maintainers:

This is not a glibc bug.

This bug is related to <sys-devel/binutils-2.21.1.

So for the record the title of the bugreport should be:

<sys-devel/binutils-2.21.1: nopl in i686 instruction set results in glibc build crash on some i686 cpus (VIA,AMD)
Comment 50 cilly 2011-08-09 18:41:33 UTC
additional info:

If mtune is left blank, it defaults to march, so -march=i686 sets -mtune to i686, if mtune is not defined.

thx to Flameeyes @ #gentoo-hardened
Comment 51 Radoslaw Madej (radegand) 2011-08-10 06:38:12 UTC
(In reply to comment #47)
> binutils-2.21.1 solves this bug, confirmed!
> 
> CFLAGS="-march=i686 -mtune=i686 -mmmx -msse -mfpmath=sse -Os -pipe
> -fomit-frame-pointer"

cilly,

Are you using -march=i686 insttead of -march=c3-2 then?

I still can't get the newer glibc compiled but I'm using -march=c3-2. My CFLAGS are taken from running:
gcc -march=native -Q --help=target
and using the options set as enabled. The -march is shown as c3-2 and the -mtune is set to generic. I've replaced -mtune with i686 so my cflags looks like this:

CFLAGS="-O2 -march=c3-2 -mtune=i686 -pipe -m32 -m80387 -m96bit-long-double -malign-stringops -mfancy-math-387 -mfp-ret-in-387 -mfused-madd -mglibc -mhard-float -mieee-fp -mno-sse4 -mpush-args -mred-zone -mstackrealign -mtls-direct-seg-refs"

I've tried steps suggested in comment #46 and glibc still fails to compile. I'll try now with the additional step of rebuilding the whole toolchain again and report here.

Maybe it's the -march=i686 as well as the -mtune=i686 that does the trick then?

Thanks cilly for your help.
Comment 52 cilly 2011-08-10 08:01:15 UTC
(In reply to comment #51)

> Are you using -march=i686 insttead of -march=c3-2 then?

As you can see in comment #47, yes.

> gcc -march=native -Q --help=target

diff marchi686.txt marchnative.txt 
17c17
<   -march=                                     i686
---
>   -march=                                     pentium3
74c74
<   -mtune=                     
---
>   -mtune=                                     generic

There is not much difference. Except one thing: -mtune-generic and this is the key issue. According to distcc native shouldn't be used at all. So I use i686.

> CFLAGS="-O2 -march=c3-2 -mtune=i686 -pipe -m32 -m80387 -m96bit-long-double
> -malign-stringops -mfancy-math-387 -mfp-ret-in-387 -mfused-madd -mglibc
> -mhard-float -mieee-fp -mno-sse4 -mpush-args -mred-zone -mstackrealign
> -mtls-direct-seg-refs"

No surprise, that your compile doesn't work. The CFLAGS you use seem a little crowded in my opinion. You are welcomed to use my CFLAGS. :)
Comment 53 Radoslaw Madej (radegand) 2011-08-10 09:17:08 UTC
> diff marchi686.txt marchnative.txt 
> 17c17
> <   -march=                                     i686
> ---
> >   -march=                                     pentium3
> 74c74
> <   -mtune=                     
> ---
> >   -mtune=                                     generic
> 
> There is not much difference. Except one thing: -mtune-generic and this is the
> key issue. 

Yup seems like that's the case, so the cflags I use should work (they would be used with -march=native). There could be a further issues with them or maybe distcc. I'll try a smaller subset of them and/or disable distcc.

>According to distcc native shouldn't be used at all. So I use i686.

Yes, it shouldn't be used with distcc. That's exactly why I expanded the cflags by hand and added these that would be used with the -march=native option.

> 
> > CFLAGS="-O2 -march=c3-2 -mtune=i686 -pipe -m32 -m80387 -m96bit-long-double
> > -malign-stringops -mfancy-math-387 -mfp-ret-in-387 -mfused-madd -mglibc
> > -mhard-float -mieee-fp -mno-sse4 -mpush-args -mred-zone -mstackrealign
> > -mtls-direct-seg-refs"
> 
> No surprise, that your compile doesn't work. The CFLAGS you use seem a little
> crowded in my opinion. You are welcomed to use my CFLAGS. :)

See my above comment. They should work as they are implied by -march=native which is supposed to work.
Comment 54 Radoslaw Madej (radegand) 2011-08-11 11:52:09 UTC
Right, the -mtune=i686 does the trick and allows glibc 2.12.2 to compile on C3-2. 

It turned out to be that my flags were correct as well, I was just using wrong version of glibc (2.13) in my crossdev environment for distcc (I use distcc for C3-2 and compile everything using crossdev on x86_64).

The steps to fix it were (after adding the -mtune=i686 flag to cflags of course! ):

1. create crossdev environment to match with the target:
binutils-2.21.1
glibc-2.11.2
gcc-4.5.3

2. on the target create toolchain with the exactly same versions.
3. update the target to glibc-2.12.2 (using distcc)
4. upgrade the crossdev environment to glibc-2.12.2

Works! :)
Comment 55 Patrick Hieber 2011-08-11 12:01:51 UTC
The following commands fixed the issue on my machine:

$ emerge =sys-devel/binutils-2.21.1
$ source /etc/profile
$ emerge '<=sys-libs/glibc-2.12'
$ emerge gcc
$ emerge binutils
$ source /etc/profile
$ emerge glibc
$ emerge -uDNav world
Comment 56 Jeroen Roovers (RETIRED) gentoo-dev 2011-08-12 16:54:25 UTC
I still cannot reproduce the "fix" to this problem. But then maybe this system has all kinds of complicating factors, like having been around for six years (with who knows what kind of cruft left over from older toolchains), having distcc initially running (as you would on one of these systems), USE=multislot. I am running `CFLAGS="... -march=i686 -mtune=i686" emerge -e system' now to see if that helps.
Comment 57 Jeroen Roovers (RETIRED) gentoo-dev 2011-08-22 09:39:22 UTC
As I said before, this isn't fixed until a clear upgrade path is found - I still get the same build failure (as attached above).

Mon Aug 22 11:38:28 CEST 2011
Portage 2.1.10.11 (default/linux/x86/10.0, gcc-4.4.5, glibc-2.11.3-r0, 3.0.1-JeR i686)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.0.1-JeR-i686-VIA_Nehemiah-with-gentoo-2.0.3
Timestamp of tree: Mon, 22 Aug 2011 03:15:01 +0000
distcc 3.1 i686-pc-linux-gnu [enabled]
app-shells/bash:          4.1_p9
dev-lang/python:          2.7.1-r1
dev-util/cmake:           2.8.4-r1
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.8.3-r1
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:       2.20.1-r1, 2.21, 2.21.1-r1
sys-devel/gcc:            4.4.5
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82
sys-kernel/linux-headers: 2.6.36.1 (virtual/os-headers)
sys-libs/glibc:           2.11.3
Repositories: gentoo JeR
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Os -march=i686 -mtune=i686"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib/distcc/bin /usr/share/X11/app-defaults/XTerm /usr/share/X11/app-defaults/XTerm-color /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-Os -march=i686 -mtune=i686"
DISTDIR="/world/distfiles"
FEATURES="assume-digests binpkg-logs buildpkg distcc distlocks ebuild-locks fixlafiles fixpackages metadata-transfer news notitles parallel-fetch protect-owned sandbox sfperms strict test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://gentoo.tiscali.nl/ http://mirror.muntinternet.net/pub/gentoo/ "
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_GB nl"
MAKEOPTS="-j4"
PKGDIR="/keeps/gentoo/packages/epia"
PORTAGE_CONFIGROOT="/"
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="/keeps/gentoo/portage"
PORTDIR_OVERLAY="/keeps/gentoo/local"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="256-color X a52 aac aalib acpi alsa ao artist-screen asf audiofile bash-completion berkdb bl bzip2 cairo caps cdda cddb cdio cdparanoia cdr chroot cle266 cli colors cpath cracklib crypt cscope css cups curl cxx dbus dga dillo dri dv dvd dvdr dvdread edl elf encode fam fame fbcon ffmpeg flac flash foomaticdb freetype gdbm ggi gif gimpprint glibc-omitfp glut gmedia gnutls gpm graphite gs gtk gtk2 help-screen iconv id3tag idn imlib inkjar ipv6 jpeg ladspa lcms libcaca libsamplerate live lm_sensors logrotate lyrics-screen lzo mad matroska midi mikmod mjpeg mmx mng modplug modules mozilla mozsvg mozxmlterm mp3 mpeg mplayer mudflap multislot musepack nas ncurses network network-cron nls nptl nptlonly nsplugin offensive ogg opengl openmp optimisememory pam pcre pda pdf perl physfs pic plotutils png pppd python qt qt3 qt3support qt4 quicktime readline realmedia rtc rtsp ruby samba sasl screenshot sdl server session sftplogging shout skins smux sndfile snmp song-screen speex spell sse ssl stream svg sysfs syslog tcl tcpd tetex tga theora threads tiff tk truetype unicode upnp usb userlocales v4l v4l2 vcd vidix vlm vorbis wavpack win32codecs winbind x86 xanim xcomposite xml xml2 xorg xosd xterm-color xv xvid xvmc 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 cgi cgid 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" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump active" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev keyboard mouse wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_GB nl" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="via" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 58 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-09-14 13:34:43 UTC
*** Bug 380935 has been marked as a duplicate of this bug. ***
Comment 59 Jeroen Roovers (RETIRED) gentoo-dev 2011-11-03 14:50:57 UTC
*** Bug 380935 has been marked as a duplicate of this bug. ***
Comment 60 Jeroen Roovers (RETIRED) gentoo-dev 2011-11-04 16:13:56 UTC
for i in =sys-devel/binutils-2.21.1-r1 \
  =sys-libs/glibc-2.11.3 \
  =sys-devel/gcc-4.5.3-r1 \
  =sys-devel/binutils-2.21.1-r1 \
  =sys-libs/glibc-2.11.3 \
  =sys-libs/glibc-2.12.2
do \
  FEATURES=-distcc emerge --nodeps -v1 $i || break
  . /etc/profile
done

Actually that worked this time. So it's dance twice around the tree, and then upgrade. Anything short of that will make the upgrade fail.
Comment 61 SpanKY gentoo-dev 2011-11-20 05:41:02 UTC
sounds the like the latest toolchain versions are fixed
Comment 62 Jeroen Roovers (RETIRED) gentoo-dev 2011-12-04 07:18:44 UTC
epia /world/bugs/336020 # chroot stage3-i686-20111129/ /bin/bash
bash: /dev/null: File exists
epia / # /lib/libc.so.6 
GNU C Library stable release version 2.12.2, by Roland McGrath et al.
Copyright (C) 2010 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.
Compiled by GNU CC version 4.5.3.
Compiled on a Linux 2.6.39 system on 2011-11-29.
Available extensions:
        C stubs add-on version 2.1.2
        crypt add-on version 2.1 by Michael Glad and others
        Gentoo patchset 3
        GNU Libidn by Simon Josefsson
        Native POSIX Threads Library by Ulrich Drepper et al
        Support for some architectures added on, not maintained in glibc core.
        BIND-8.2.3-T5B
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
epia / # ld -v
GNU ld (GNU Binutils) 2.21.1

Seems to have been fixed in stage3-i686-20111129.tar.bz2.