Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 185404 - sys-libs/glibc-2.6 fails with undefined ref to __sync_fetch_and_add_4 on x86 when built with -march=i386
Summary: sys-libs/glibc-2.6 fails with undefined ref to __sync_fetch_and_add_4 on x86 ...
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 185521 192142 199471 199904 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-07-15 12:27 UTC by ShadowHawkBV
Modified: 2015-05-30 03:58 UTC (History)
17 users (show)

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


Attachments
glibc- failure build log (some content clipped with <<CLIP>> marking it) (build.log,149.61 KB, text/plain)
2007-07-15 12:39 UTC, ShadowHawkBV
Details
glibc-2.6.1_build-log.bz2 (glibc-2.6.1_build-log.bz2,86.34 KB, text/plain)
2007-10-07 14:18 UTC, Marijn Schouten (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ShadowHawkBV 2007-07-15 12:27:40 UTC
During a normal update, glibc tries to build and fails with the following less then understandable error: 

collect2: ld returned 1 exit status
make[2]: *** [/home/tmp/portage/sys-libs/glibc-2.6/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/ld.so] Error 1
make[2]: Leaving directory `/home/tmp/portage/sys-libs/glibc-2.6/work/glibc-2.6/elf'
make[1]: *** [elf/subdir_lib] Error 2
make[1]: Leaving directory `/home/tmp/portage/sys-libs/glibc-2.6/work/glibc-2.6'
make: *** [all] Error 2
 * 
 * ERROR: sys-libs/glibc-2.6 failed.
 * Call stack:
 *   ebuild.sh, line 1647:   Called dyn_compile
 *   ebuild.sh, line 988:   Called qa_call 'src_compile'
 *   ebuild.sh, line 44:   Called src_compile
 *   glibc-2.6.ebuild, line 1168:   Called src_compile
 *   glibc-2.6.ebuild, line 1179:   Called toolchain-glibc_src_compile
 *   glibc-2.6.ebuild, line 275:   Called die
 * 
 * make for x86 failed
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/home/tmp/portage/sys-libs/glibc-2.6/temp/build.log'.


 Here's my emerge --info
Portage 2.1.3_rc8 (default-linux/amd64/2007.0/desktop, gcc-4.1.2, glibc-2.5-r4, 2.6.20-gentoo-r8 x86_64)
=================================================================
System uname: 2.6.20-gentoo-r8 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4200+
Gentoo Base System release 1.12.9
Timestamp of tree: Sun, 15 Jul 2007 09:00:01 +0000
ccache version 2.4 [enabled]
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.3.5-r3, 2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r7
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.23b
virtual/os-headers:  2.6.21
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -mtune=k8 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -mtune=k8 -pipe"
DISTDIR="/home/bvance/mnt/LKSERVER/shared_drive/distfiles"
FEATURES="buildpkg ccache distlocks fixpackages metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans"
GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://gentoo.mirrored.ca/ ftp://gentoo.mirrored.ca/ http://gentoo.osuosl.org/ ftp://sunsite.ualberta.ca/pub/unix/Linux/gentoo/"
MAKEOPTS="-j4"
PKGDIR="/home/bvance/mnt/LKSERVER/shared_drive/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/home/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 berkdb bidi bitmap-fonts cairo cdda cdio cdparanoia cdr cli cracklib crypt cups dbus divx4linux doc dri dts dvd dvdr dvdread eds emboss encode esd evo exif fam ffmpeg firefox flac foomanticdb fortran freetype gdbm gif glitz glut gnome gnutls gpm gstreamer gtk gtkhtml hal httpd iconv ipv6 isdnlog java jbig jpeg kde kerberos ldap libg++ live mad matroska midi mikmod mmx mp3 mpeg mudflap ncurses nls nocd nptl nptlonly nvidia offensive ogg opengl openmp oss pam pcre pdf perl png ppds pppd python qt3 qt3support qt4 quicktime readline reflection samba sdl session spell spl sse sse2 ssl stream svg tcpd theora tiff truetype truetype-fonts type1-fonts unicode usb userlocales utf-8 vcd vlm vorbis wxwindows xine xinerama xml xorg xv xvid zlib" ALSA_CARDS="via82xx" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="mouse keyboard evdev joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="nvidia"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY


Reproducible: Always

Steps to Reproduce:
1. emerge -uDv glibc
2. glibc-2.6 emerge dies with the above error
3.

Actual Results:  
Got the error message

Expected Results:  
glibc should build
Comment 1 Christoph Mende (RETIRED) gentoo-dev 2007-07-15 12:31:14 UTC
(In reply to comment #0)
>  * If you need support, post the topmost build error, and the call stack if
> relevant.
>  * A complete build log is located at
> '/home/tmp/portage/sys-libs/glibc-2.6/temp/build.log'.

Please do that, there's no relevant information in the output you posted
Comment 2 ShadowHawkBV 2007-07-15 12:39:05 UTC
Created attachment 124921 [details]
glibc- failure build log (some content clipped with <<CLIP>> marking it)

The build log for the error.  It appears to think I'm building for an x86.  I'm not sure if that means it's ignoring the make.conf saying it's x86_64 or if it's the generic x86 chipset.  DUe to the size, I clipped out as small a chunk of the compiling as I could to get it small enough to be posted.
Comment 3 Marijn Schouten (RETIRED) gentoo-dev 2007-07-15 14:19:36 UTC
reopening as log is now there.
Comment 4 Radoslaw Szkodzinski 2007-07-15 16:16:07 UTC
Confirming the bug with gcc 4.2.0 and binutils 2.17.50.0.17.
Comment 5 Michael Biebl 2007-07-15 22:27:41 UTC
I can also confirm this bug. I'm having a x86 system though.

emerge --info
Portage 2.1.3_rc8 (default-linux/x86/2007.0/desktop, gcc-4.1.2, glibc-2.5-r4, 2.6.22.1 i686)
=================================================================
System uname: 2.6.22.1 i686 Intel(R) Pentium(R) M processor 1600MHz
Gentoo Base System release 1.12.10
Timestamp of tree: Sun, 15 Jul 2007 20:30:09 +0000
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -mtune=pentium-m -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -mtune=pentium-m -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="de_DE.UTF-8"
LC_ALL="de_DE.UTF-8"
LINGUAS="de"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aac acl acpi alsa apache2 arts audiofile avahi bash-completion berkdb bitmap-fonts bluetooth branding bzip2 cairo cddb cdparanoia cdr cli cracklib crypt cups curl dbus dga dri dvd dvdr dvdread eds emboss encode esd evo exif expat fam ffmpeg firefox flac fortran gd gdbm gif gnome gnutls gphoto2 gpm gstreamer gtk hal iconv idn imagemagick imap ipv6 isdnlog java jpeg kde lcms ldap libg++ libnotify mad mcal midi mikmod mng mono mp3 mpeg mudflap mysql ncurses nls nptl nptlonly ogg openexr opengl openmp oss pam pcmcia pcre pdf perl pic png postgres pppd python qt3 qt3support qt4 quicktime readline reflection ruby samba sasl sdl session smime spell spl sqlite sse sse2 ssl svg tcpd tetex theora threads tiff truetype truetype-fonts type1-fonts udev unicode usb vorbis w32codecs win32codecs x264 x86 xcb xine xml xml2 xorg xv xvid 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 mulaw multi null plug rate route share shm softvol" CAMERAS="canon ptp2" ELIBC="glibc" FRITZCAPI_CARDS="fcusb2" INPUT_DEVICES="keyboard mouse synaptics evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de" USERLAND="GNU" VIDEO_CARDS="radeon ati vesa fbdev"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 6 René Marten 2007-07-15 22:35:22 UTC
Same here:

Portage 2.1.3_rc8 (default-linux/x86/2007.0, gcc-4.1.2, glibc-2.5-r4, 2.6.21-gentoo-r3 i686)
=================================================================
System uname: 2.6.21-gentoo-r3 i686 AMD Athlon(tm) XP 3200+
Gentoo Base System release 1.12.10
Timestamp of tree: Sun, 15 Jul 2007 22:20:01 +0000
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Os -mtune=athlon-xp -fomit-frame-pointer -funroll-loops -fexpensive-optimizations -falign-functions=16 -falign-jumps=16 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/splash /etc/terminfo"
CXXFLAGS="-Os -mtune=athlon-xp -fomit-frame-pointer -funroll-loops -fexpensive-optimizations -falign-functions=16 -falign-jumps=16 -pipe"
DISTDIR="/var/portage/distfiles"
EMERGE_DEFAULT_OPTS="--alphabetical"
FEATURES="buildpkg ccache distlocks metadata-transfer sfperms strict unmerge-orphans"
GENTOO_MIRRORS="ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo "
LC_ALL="de_DE@Euro"
LINGUAS="de"
MAKEOPTS="-j2"
PKGDIR="/var/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/var/portage"
PORTDIR_OVERLAY="/usr/local/portage2 /usr/local/portage"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext 7zip S3TC X X509 Xaw3d a52 aac aalib ace acl acpi adns adplug aiglx aim aimextras aio akode alisp alsa amarok amazon amr animgif ao aoss aotuv apache2 artworkextra asf async audacious audiofile automount binfilter bl buttons bzip2 bzlib cairo calendar cdda cddb cdinstall cdparanoia cdr cdrom chardet chipcard chipcard2 cjk clamav clamd cli cracklib crypt css csv ctype cups curl curlwrappers cursors custom-cflags cvs cvsgraph dbus de_tvtoday depth32 dga directfb dmi dmx dnotify dri dts dvbplayer dvd dvdnav dvdr dvdread dvi emf emoticon emovix encode erandom evo exif expat extrafilters fame fat fbcon ffmpeg fftw firefox flac flash fltk fluidsynth fmod font-server fontconfig foomaticdb fpx ftp fuse gb gdbm german gif gimp glitz glsa glut glw gmedia gmp gnokii gnome gnome-print gnomecanvas gnomedb gpac gpgme gphoto2 gpm graphviz gs gsf gsm gssapi gstreamer gtk gtkhtml gzip h323 hal hbci hddtemp howl html http hwmixer icons iconv icq icu id3 image imagemagick imap imlib iproute2 ipv6 jabber jack jack-tmpfs java java-external java5 jpeg jpeg2k kde kdeenablefinal kdehiddenvisibility kdepim kdexdeltas kmid ladcca ladspa lame largefile lcms libburn libcaca libclamav libg++ libgda libnotify libsamplerate libvisual live lm_sensors logrotate lzo lzw lzw-tiff mad matroska md5sum mdb midi mikmod mime mixer mjpeg mmap mmx mmxext mng mod modplug mouse mozilla moznocompose moznoirc moznomail mozsha1 mp2 mp3 mp4 mp4live mpd mpeg mpeg2 mpi mplayer mpm-prefork msdav msn msnextras mudflap musepack music musicbrainz mysql ncurses net network nextaw nls nptl nptlonly nsplugin nspr ntfs oav objc odbc office ofx ogg openal openexr opengl openmp openntpd openssl opensslcrypt optimisememory oscar oss pam pam_console pango pcre pda pdf perl php physfs plugins pmount png posix povray pppd print pwdb python q32 qt3 qt3support qt4 quicktime radeon radio rar readline real realmedia reflection rtc rtsp samba sasl scanner sdl sdl-image sdl-sound sdlaudio seamonkey session shared sid silc silverxp skins slang slp smime sms sndfile sound sounds sox spamassassin speex spell spl sse sse-filters ssl stream subtitles svg svga svgz sysfs syslog t1lib taglib tagwriting tcpd tga themes theora tidy tiff timidity tomsfastmath toolbar transcode truetype tta twolame type1 type1-fonts unicode unzip urandom usb v4l v4l2 vcd videos vidix visualization vnc voice vorbis vorbis-psy wav wavpack webdav win32codecs winbind winpopup wma wmf wmp wxwindows x264 x86 xanim xcomposite xext xforms xfs xft xim xine xml xmlreader xmlrpc xmlwriter xorg xosd xpm xprint xrandr xscreensaver xsl xslt xterm xv xvid yahoo yv12 zip zlib zvbi" ALSA_CARDS="emu10k1 usb-audio" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de" USERLAND="GNU" VIDEO_CARDS="ati radeon fbdev v4l"
Unset:  CTARGET, INSTALL_MASK, LANG, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Comment 7 René Marten 2007-07-15 22:52:43 UTC
After serching around a bit I noticed that There is a problem compiling glibc 2.6 with gcc 4.2 but all here It seems to be the same thing as mentiioned here.
Now I know that I'm not alone with this.

Comment 8 SpanKY gentoo-dev 2007-07-16 02:03:00 UTC
also post the output of `gcc -v` please
Comment 9 René Marten 2007-07-16 03:33:53 UTC
What about the nptl and nptlonly use flags?
Is that now use internally or something like that?

here my gcc -v output:

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.2 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-libunwind-exceptions --disable-multilib --enable-libmudflap --disable-libssp --disable-libgcj --enable-languages=c,c++,objc --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.1.2 (Gentoo 4.1.2)
Comment 10 SpanKY gentoo-dev 2007-07-16 07:46:54 UTC
hrm, this looks like i may have to accelerate some plans ... adding --with-cpu support to gcc and setting -march based on CHOST in glibc ...

everyone here is using -mtune instead of -march ... that means your default arch is set to "i386" instead of something nicer ... so in general if i were you guys, i'd change your make.conf to read -march= instead of -mtune= in CFLAGS/CXXFLAGS, and this problem will magically disappear for you
Comment 11 ShadowHawkBV 2007-07-16 10:07:04 UTC
Here you go.

Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with: /home/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.1.2 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.2 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.2/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.2/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-libunwind-exceptions --enable-multilib --enable-libmudflap --disable-libssp --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.1.2 (Gentoo 4.1.2)

I've changed from -mtune=k8 to -march=k8, and it's compiling away.  I hope that change pushes it past the error.
Comment 12 Radoslaw Szkodzinski 2007-07-16 12:25:14 UTC
Sorry, I cannot switch on any -march, the code will slow down on Intel Core 2 Duo processor. (e.g. with -march=nocona or -march=native)
I'm using -mtune=generic, which according to my limited tests across multiple packages is the fastest for this CPU.
Comment 13 Radoslaw Szkodzinski 2007-07-16 14:07:31 UTC
The topic is incorrect - it is also relevant for amd64.
Please fix.
Comment 14 Jakub Moc (RETIRED) gentoo-dev 2007-07-16 14:20:05 UTC
*** Bug 185521 has been marked as a duplicate of this bug. ***
Comment 15 Ahmed Ammar (RETIRED) gentoo-dev 2007-07-16 14:33:32 UTC
please disable ccache and try again
Comment 16 René Marten 2007-07-16 14:42:12 UTC
@ Spanky: I use -mtune not -march
Comment 17 René Marten 2007-07-16 15:13:00 UTC
Changing -mtune to -march seems to fix the compile error for me
Comment 18 James Johnson 2007-07-16 16:34:12 UTC
Running ~amd64, gcc 4.1.2, binutils 2.17.50.0.16 and it's not working for me.
Comment 19 ShadowHawkBV 2007-07-16 20:43:59 UTC
Changing from -mtune=k8 to -march=k8 appears to have done the trick for me.
Comment 20 SpanKY gentoo-dev 2007-07-16 23:33:35 UTC
Radoslaw: i find it *very* hard to swallow your claims that:
-march=i386 -mtune=pentium-m
generates better code than:
-march=pentium-m

also, the subject is correct so dont touch it ... when it fails on amd64, it fails while cross-compiling the x86 version of glibc
Comment 21 Radoslaw Szkodzinski 2007-07-16 23:52:41 UTC
SpanKY: Check before you talk. Normal x86_64 compiler does not use -march=i386 as the default. It's the glibc ebuild or build system that adds one.
I'm talking that _the absence_ of any -march is faster than on Intel Core 2 Duo (at least w/ GCC up to and including 4.2).

If you want to talk about it some more, I recommend #gentoo instead of Bugzilla.
Comment 22 SpanKY gentoo-dev 2007-07-17 01:39:35 UTC
if you wish to be a prick, go somewhere else ... your input is not needed in any way to have this issue resolved and frankly it isnt wanted either if you insist on being offensive

if you read my comment it's obvious i thought you were the x86 user who had -mtune=pentium-m in his CFLAGS
Comment 23 John SJ Anderson 2007-07-18 02:09:03 UTC
I'm affected by this bug, and I can't switch from mtune to march, because I'm running in a Xen-based VPS environment. At some point in the future, my Gentoo installation may be moved to from its current AMD64-based arch to a 64bit Intel one. I've built with mtune so that if that happens, things will at least still run to the point where I can rebuild with a different mtune setting; if I use march and the CPU architecture gets switched out from under me, I'm hosed. 

So while the s/mtune/march/ change may fix this for some people, it's not a universal fix. 
Comment 24 SpanKY gentoo-dev 2007-07-18 02:17:02 UTC
the s/-mtune/-march/ is a workaround until the real fix is implemented, no one suggested that as a permanent solution

the 64bit code path is unaffected by any changes that will go in to address this issue
Comment 25 Marijn Schouten (RETIRED) gentoo-dev 2007-07-18 14:52:37 UTC
same error here, but there is no -mtune or -march in my CFLAGS

ld-x86-x86_64-pc-linux-gnu-nptl/ld.map          \
                  -Wl,-soname=ld-linux.so.2 -T /var/tmp/portage/sys-libs/glibc-2.6/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/ld.so.lds
/var/tmp/portage/sys-libs/glibc-2.6/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/librtld.os: In function `add_dependency':
/var/tmp/portage/sys-libs/glibc-2.6/work/glibc-2.6/elf/dl-lookup.c:106: undefined reference to `__sync_fetch_and_add_4'
/var/tmp/portage/sys-libs/glibc-2.6/work/glibc-2.6/elf/dl-lookup.c:110: undefined reference to `__sync_val_compare_and_swap_4'
/var/tmp/portage/sys-libs/glibc-2.6/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/librtld.os: In function `_dl_profile_fixup':
/var/tmp/portage/sys-libs/glibc-2.6/work/glibc-2.6/elf/dl-runtime.c:196: undefined reference to `__sync_val_compare_and_swap_4'
/var/tmp/portage/sys-libs/glibc-2.6/work/glibc-2.6/elf/dl-runtime.c:205: undefined reference to `__sync_fetch_and_add_4'
/var/tmp/portage/sys-libs/glibc-2.6/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/librtld.os: In function `_dl_fixup':
/var/tmp/portage/sys-libs/glibc-2.6/work/glibc-2.6/elf/dl-runtime.c:102: undefined reference to `__sync_val_compare_and_swap_4'
/var/tmp/portage/sys-libs/glibc-2.6/work/glibc-2.6/elf/dl-runtime.c:110: undefined reference to `__sync_fetch_and_add_4'
/var/tmp/portage/sys-libs/glibc-2.6/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/librtld.os: In function `dl_open_worker':
/var/tmp/portage/sys-libs/glibc-2.6/work/glibc-2.6/elf/dl-open.c:425: undefined reference to `__sync_val_compare_and_swap_4'
/var/tmp/portage/sys-libs/glibc-2.6/work/glibc-2.6/elf/dl-open.c:427: undefined reference to `__sync_fetch_and_add_4'
/var/tmp/portage/sys-libs/glibc-2.6/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/librtld.os: In function `_dl_close_worker':
/var/tmp/portage/sys-libs/glibc-2.6/work/glibc-2.6/elf/dl-close.c:407: undefined reference to `__sync_val_compare_and_swap_4'
/var/tmp/portage/sys-libs/glibc-2.6/work/glibc-2.6/elf/dl-close.c:409: undefined reference to `__sync_fetch_and_add_4'
collect2: ld returned 1 exit status

Portage 2.1.3_rc8 (default-linux/amd64/2006.1/desktop, gcc-4.1.2, glibc-2.5-r4, 2.6.22-gentoo-r1 x86_64)
=================================================================
System uname: 2.6.22-gentoo-r1 x86_64 Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz
Gentoo Base System release 1.12.10
Timestamp of tree: Wed, 18 Jul 2007 14:00:10 +0000
dev-java/java-config: 1.3.7, 2.0.31-r3
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -ggdb"
DISTDIR="/usr/portage/distfiles"
FEATURES="collision-protect cvs distlocks metadata-transfer parallel-fetch sandbox sfperms splitdebug strict unmerge-orphans"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_US.UTF-8"
LINGUAS="en nl"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/home/marijn/git/gentoo-lisp-overlay /home/marijn/overlay"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acpi alsa amd64 berkdb bitmap-fonts cairo cdr cli cracklib crypt cups dbus dri dts dvd dvdr dvdread eds emacs emboss encode esd fam firefox fortran gdbm gif gmp gnome gpm gstreamer gtk gtk2 hal iconv ipv6 isdnlog jpeg kde kdeenablefinal ldap libg++ lm_sensors mad midi mikmod mng mp3 mpeg mudflap ncurses nls nptl nptlonly nvidia offensive ogg opengl openmp pam pcre pdf perl png ppds pppd python qt3 qt4 quicktime readline reflection sdl session smp spell spl ssl svg tcpd theora threads truetype truetype-fonts type1-fonts unicode vorbis xinerama xml xorg xpm xv zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en nl" USERLAND="GNU" VIDEO_CARDS="fbdev nv nvidia"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.1.2 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.2 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.2/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.2/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-libunwind-exceptions --enable-multilib --disable-libmudflap --disable-libssp --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.1.2 (Gentoo 4.1.2)
Comment 26 Dmitrij D. Czarkoff 2007-07-24 09:34:46 UTC
same here

ddclpc ~ # emerge --info
Portage 2.1.3_rc9 (default-linux/amd64/2007.0, gcc-4.2.0, glibc-2.5-r4, 2.6.22-gentoo-r1 x86_64)
=================================================================
System uname: 2.6.22-gentoo-r1 x86_64 AMD Turion(tm) 64 Mobile Technology MT-28
Gentoo Base System release 1.12.10
Timestamp of tree: Mon, 23 Jul 2007 19:30:01 +0000
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r6
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer parallel-fetch sfperms strict unmerge-orphans"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="ru_RU.utf8"
LC_ALL="ru_RU.utf8"
LINGUAS="ru"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac aalib acl acpi alsa amd64 amr amrnb amrwb async bash-completion bashlogger berkdb bitmap-fonts bl bzip2 cddb cdparanoia cli crypt cscope cups dbus device-mapper dga disk-partition djvu dri dts dvd dvdnav editor enca encode expat finger flac ftp gif glep glibc-omitfp glitz gmp gpm graphviz gs gtk hal iconv imlib ipv6 isdnlog iso14755 ithreads java javascript jpeg jpeg2k justify libcaca libg++ lyrics mad mailwrapper md5sum midi mikmod mmx mmxext mng mozdevelop mp2 mp3 mpeg mudflap multislot musepack ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam paste64 pcmcia pcre pdf perl perlsuid pic png pnm ppds pppd python q32 q8 quicktime rar readline reflection rle samba sdl session speex spell spl srt sse sse2 ssl suid svg symlink taglib tcl tcpd theora threads tiff tk toolbar tools truetype truetype-fonts type1-fonts unicode vim-pager vim-syntax vim-with-x vorbis vorbis-psy wmf x264 xanim xattr xml xorg xpm xprint xv xvid" ALSA_CARDS="atiixp atiixp-modem" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" CAMERAS="ptp2" ELIBC="glibc" INPUT_DEVICES="mouse keyboard synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru" USERLAND="GNU" VIDEO_CARDS="radeon"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 27 James Johnson 2007-07-29 03:26:02 UTC
I tried emerge -e1v system with no luck.  After adding "-march=athlon64" to my CFLAGS glibc-2.6 compiled without issue.
Comment 28 Pierrot Rey 2007-08-02 04:16:43 UTC
I have the same problem.

pierrot@Ulysse ~/Compilation/Temp $ emerge --info
Portage 2.1.3.1 (default-linux/amd64/2007.0, gcc-4.2.0/amd64-vanilla, glibc-2.5-r4, 2.6.22-gentoo-r2 x86_64)
=================================================================
System uname: 2.6.22-gentoo-r2 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 6000+
Gentoo Base System release 1.12.10
Timestamp of tree: Thu, 02 Aug 2007 02:20:01 +0000
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r6
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17.50.0.16
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22-r2
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe -fomit-frame-pointer -ftree-vectorize -fno-ident"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-march=athlon64 -O2 -pipe -fomit-frame-pointer -ftree-vectorize -fno-ident"
DISTDIR="/mnt/Data/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FEATURES="assume-digests digest distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="fr_CH.UTF8"
LC_ALL="fr_CH.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,now -Wl,--hash-style=gnu"
LINGUAS="fr_CH fr"
MAKEOPTS="-j5"
PKGDIR="/mnt/Data/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/mnt/Data/portage/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/xwing /usr/portage/local/layman/sunrise /usr/portage/local/layman/xeffects /usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X acl alsa amd64 berkdb bitmap-fonts cli cracklib crypt cups dri fortran gdbm gif gpm iconv isdnlog jpeg kde kdeenablefinal kdehiddenvisibility libg++ madwifi midi mmx mpeg mudflap ncurses nls nptl nptlonly opengl openmp pam pcre perl png pppd python qt3 readline reflection session spl sse sse2 ssl tcpd tiff truetype truetype-fonts type1-fonts unicode usb userlocales xorg zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" CAMERAS="canon" DVB_CARDS="dibusb-usb2 usb-dib0700" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr_CH fr" USERLAND="GNU" VIDEO_CARDS="fglrx vesa"
Unset:  CTARGET, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


 

Comment 29 SpanKY gentoo-dev 2007-08-06 09:45:29 UTC
should be fixed in cvs now
Comment 30 Marijn Schouten (RETIRED) gentoo-dev 2007-08-13 14:06:09 UTC
problem is back with glibc-2.6.1

Portage 2.1.3.5 (default-linux/amd64/2006.1/desktop, gcc-4.1.2, glibc-2.6-r0, 2.6.22-gentoo-r1 x86_64)
=================================================================
System uname: 2.6.22-gentoo-r1 x86_64 Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz
Gentoo Base System release 1.12.10
Timestamp of tree: Mon, 13 Aug 2007 11:00:10 +0000
dev-java/java-config: 1.3.7, 2.0.31-r3
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r6
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17-r1
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22-r2
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -ggdb"
DISTDIR="/usr/portage/distfiles"
FEATURES="collision-protect cvs distlocks metadata-transfer parallel-fetch sandbox sfperms splitdebug strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_US.UTF-8"
LINGUAS="en nl"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/home/marijn/git/gentoo-lisp-overlay /home/marijn/overlay"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acpi alsa amd64 berkdb bitmap-fonts cairo cdr cli cracklib crypt cups dbus dri dts dvd dvdr dvdread eds emacs emboss encode esd fam firefox fortran gdbm gif gmp gnome gpm gstreamer gtk gtk2 hal iconv ipv6 isdnlog jpeg kde kdeenablefinal ldap lm_sensors mad midi mikmod mng mp3 mpeg mudflap ncurses nls nptl nptlonly nvidia offensive ogg opengl openmp pam pcre pdf perl png ppds pppd python qt3 qt4 quicktime readline reflection sdl session smp spell spl ssl svg tcpd theora threads truetype truetype-fonts type1-fonts unicode vorbis xinerama xml xorg xpm xv zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en nl" USERLAND="GNU" VIDEO_CARDS="fbdev nv nvidia"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 31 SpanKY gentoo-dev 2007-08-13 14:15:28 UTC
i doubt glibc-2.6 works for you but glibc-2.6.1 does not ... please confirm this
Comment 32 Marijn Schouten (RETIRED) gentoo-dev 2007-08-13 16:29:12 UTC
(In reply to comment #31)
> i doubt glibc-2.6 works for you but glibc-2.6.1 does not ... please confirm
> this

No, as my attached info shows, 2.6 merges fine now, but 2.6.1 fails as 2.6 used to before but doesn't anymore. I re-emerged 2.6 and it went fine.
Comment 33 SpanKY gentoo-dev 2007-08-13 17:00:02 UTC
emerge info is irrelevant ... it's a snapshot in time (when you ran `emerge --info`), it does not reflect the state of your machine when glibc-2.6 was actually built (when you ran `emerge glibc`)

this is probably an eblit/env issue, not the same issue reported here ... it just manifests itself the same
Comment 34 Akshay Shah 2007-08-13 18:08:27 UTC
Should it be changing the -march if it's already set?


>>> Compiling source in /var/tmp/portage/sys-libs/glibc-2.6.1/work/glibc-2.6.1 ...

 *             ABI:   default
 *          CBUILD:   i686-pc-linux-gnu
 *           CHOST:   i686-pc-linux-gnu
 *         CTARGET:   i686-pc-linux-gnu
 *      CBUILD_OPT:   
 *     CTARGET_OPT:   
 *              CC:   
 *          CFLAGS:   -march=i686 -march=nocona -pipe -O2 -fno-strict-aliasing
Comment 35 SpanKY gentoo-dev 2007-08-13 19:55:40 UTC
no, that's the point of inserting it ... no need to parse flags and it just works
Comment 36 Peter B 2007-08-14 21:23:51 UTC
hmm the -march flag I set isn't used...


output (here the order between -march=i686 and -march=athlon-xp is fine):

 *             ABI:   default
 *          CBUILD:   i686-pc-linux-gnu
 *           CHOST:   i686-pc-linux-gnu
 *         CTARGET:   i686-pc-linux-gnu
 *      CBUILD_OPT:   
 *     CTARGET_OPT:   
 *              CC:   
 *          CFLAGS:   -march=i686 -march=athlon-xp -mfpmath=sse -mmmx -m3dnow -msse -fomit-frame-pointer -fno-stack-protector -fgnu89-inline -freorder-blocks -pipe -D_FORTIFY_SOURCE=0 -O2 -fno-strict-aliasing


example output from compile (but now the order is reversed):

i686-pc-linux-gnu-gcc ../sysdeps/unix/sysv/linux/init-first.c -c -std=gnu99 -fgnu89-inline -D_FORTIFY_SOURCE=0 -O2 -Wall -Winline -Wwrite-strings -fgnu89-inline -fmerge-all-constants -fno-stack-protector -fno-strict-aliasing -freorder-blocks -m3dnow  ***-march=athlon-xp -march=i686***  -mfpmath=sse -mmmx -msse -mtune=athlon-xp -pipe -Wstrict-prototypes -mpreferred-stack-boundary=4 -fomit-frame-pointer -g0 -O99 -fomit-frame-pointer -D__USE_STRING_INLINES ...

Comment 37 Peter B 2007-08-14 21:40:36 UTC
>  *          CFLAGS:   -march=i686 -march=athlon-xp -mfpmath=sse -mmmx -m3dnow
> -msse -fomit-frame-pointer -fno-stack-protector -fgnu89-inline -freorder-blocks
> -pipe -D_FORTIFY_SOURCE=0 -O2 -fno-strict-aliasing

should be: 
CFLAGS:   -march=i686 -march=athlon-xp -mtune=athlon-xp -mfpmath=sse -mmmx -m3dnow -msse -fomit-frame-pointer -fno-stack-protector -fgnu89-inline -freorder-blocks -pipe -D_FORTIFY_SOURCE=0 -O2 -fno-strict-aliasing


I had to add -mtune=athlon-xp to get some optimization for my cpu.
Comment 38 Greg Fitzgerald 2007-08-24 03:33:39 UTC
I am just now upgrading to 2.6.1 and have hit this problem. Heres the output and my emerge --info.


glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/csu/abi-note.o /var/tmp/port
age/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/soinit.os /
var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/lib
c_pic.os /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gn
u-nptl/elf/sofini.os /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64
-pc-linux-gnu-nptl/elf/interp.os /var/tmp/portage/sys-libs/glibc-2.6.1/work/buil
d-x86-x86_64-pc-linux-gnu-nptl/elf/ld.so -lgcc
/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/li
bc_pic.os: In function `__fork':
(.text+0x78e6f): undefined reference to `__sync_bool_compare_and_swap_4'
/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/li
bc_pic.os: In function `nscd_getpw_r':
nscd_getpw_r.c:(.text+0xda747): undefined reference to `__sync_fetch_and_add_4'
nscd_getpw_r.c:(.text+0xda78b): undefined reference to `__sync_fetch_and_add_4'
/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/li
bc_pic.os: In function `nscd_getgr_r':
nscd_getgr_r.c:(.text+0xdab8b): undefined reference to `__sync_fetch_and_add_4'
nscd_getgr_r.c:(.text+0xdabd0): undefined reference to `__sync_fetch_and_add_4'
/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/li
bc_pic.os: In function `nscd_gethst_r':
nscd_gethst_r.c:(.text+0xdb22d): undefined reference to `__sync_fetch_and_add_4'
/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/li
bc_pic.os:nscd_gethst_r.c:(.text+0xdb274): more undefined references to `__sync_
fetch_and_add_4' follow
/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/li
bc_pic.os: In function `__nscd_get_map_ref':
(.text+0xdd200): undefined reference to `__sync_val_compare_and_swap_4'
/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/li
bc_pic.os: In function `__GI___libc_freeres':
(__libc_freeres_fn+0x87e): undefined reference to `__sync_bool_compare_and_swap_
4'
collect2: ld returned 1 exit status
make[1]: *** [/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-lin
ux-gnu-nptl/libc.so] Error 1
make[1]: Leaving directory `/var/tmp/portage/sys-libs/glibc-2.6.1/work/glibc-2.6
.1'
make: *** [all] Error 2

Portage 2.1.3.6 (default-linux/amd64/2007.0/desktop, gcc-4.2.0, glibc-2.5-r4, 2.
6.22.5 x86_64)
=================================================================
System uname: 2.6.22.5 x86_64 Intel(R) Pentium(R) D CPU 3.00GHz
Gentoo Base System release 2.0.0_rc3
Timestamp of tree: Thu, 23 Aug 2007 21:00:09 +0000
ccache version 2.4 [disabled]
dev-lang/python:     2.4.4-r4, 2.5.1-r2
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17.50.0.18
sys-devel/gcc-config: 1.4.0
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22-r2
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shu
tdown /usr/share/X11/xkb /usr/share/config /var/bind"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo /et
c/texmf/web2c"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans use
rfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/
distributions/gentoo"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress 
--force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/di
stfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl acpi alsa amd64 arts berkdb bitmap-fonts cairo cdr cli cracklib crypt
 cups dbus dri dvd dvdr dvdread eds emboss encode esd evo fam firefox fortran gd
bm gif gnome gpm gstreamer gtk hal iconv ipv6 isdnlog jpeg kde kerberos ldap mad
 midi mikmod mmx mp3 mpeg mudflap ncurses nls nptl nptlonly ogg opengl openmp os
s pam pcre pdf perl png pppd python qt3 qt3support qt4 quicktime readline reflec
tion sdl session spell spl sse sse2 ssl svg tcpd tiff truetype truetype-fonts ty
pe1-fonts unicode vorbis xml xorg xv zlib" ALSA_CARDS="ali5451 als4000 atiixp at
iixp-modem bt87x ca0106 cmipci 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 h
ooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route s
hare shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="lin
ux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurse
s text" USERLAND="GNU" VIDEO_CARDS="nvidia"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGU
AS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPT
Comment 39 Greg Fitzgerald 2007-08-24 04:39:04 UTC
Well i was bored, and was reading through the posts again. I read  SpanKY's comment #10 mention setting -march instead of -mtune. I already had -march set, and had not even touched -mtune. Out of boredem I left -march how it was and also set -mtune to match my settings. Recompiled and it went just fine. I noticed in my old build log that -march was never passed through in my build.log with -march set. Once I set -mtune it was passed through. Not real sure if that has anything to do with it. I manage a few stage4 tarballs that I compile with just "-02 -pipe". It will also fail to compile there with the same error. Wondering why that may happen?
Comment 40 Aakash 2007-08-30 17:06:15 UTC
I'm running into the same problem regardless of the fact that -march and -mtune are set (in /etc/make.conf) while trying to emerge glibc-2.6.1 

Portage 2.1.3.7 (default-linux/amd64/2007.0/desktop, gcc-4.2.0, glibc-2.6-r0, 2.6.22-gentoo-r1 x86_64)
=================================================================
System uname: 2.6.22-gentoo-r1 x86_64 AMD Athlon(tm) 64 FX-53 Processor
Gentoo Base System release 1.12.10
Timestamp of tree: Wed, 29 Aug 2007 16:30:01 +0000
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.3.6-r2, 2.4.4-r4, 2.5.1-r2
dev-python/pycrypto: 2.0.1-r5
sys-apps/baselayout: 1.12.10-r4
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18
sys-devel/gcc-config: 1.4.0-r1
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22-r2
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=amd64 -mtune=amd64 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-march=amd64 -mtune=amd64 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirror.mcs.anl.gov/pub/gentoo/ http://prometheus.cs.wmich.edu/gentoo http://gentoo.mirrors.tds.net/gentoo http://mirror.datapipe.net/gentoo"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow X acl acpi alsa amd64 apache2 apm arts ati berkdb bitmap-fonts bzip2 cairo cdr cjk cli cracklib crypt cups dbus dri dvd dvdr dvdread eds emboss encode esd evo fam fglrx firefox fortran gdbm gensplash gif gnome gpm gstreamer gtk hal iconv ieee1394 ipv6 isdnlog java jpeg kde kerberos ldap mad midi mikmod mmx mp3 mpeg mudflap mysql ncurses nls nptl nptlonly ogg opengl openmp oss pam pcre pdf perl png postgres pppd python qt3 qt3support qt4 quicktime readline reflection samba sdl server session snmp spell spl sse sse2 ssl svg swat tcpd tidy tiff transcode truetype truetype-fonts type1-fonts unicode usb v4l vorbis xine xinerama xml xml2 xorg xv xvid zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci 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 mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="ati vesa fbdev"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 41 Aakash 2007-09-01 04:13:42 UTC
(In reply to comment #40)
> I'm running into the same problem regardless of the fact that -march and -mtune
> are set (in /etc/make.conf) while trying to emerge glibc-2.6.1 
> 
> Portage 2.1.3.7 (default-linux/amd64/2007.0/desktop, gcc-4.2.0, glibc-2.6-r0,
> 2.6.22-gentoo-r1 x86_64)
> =================================================================
> System uname: 2.6.22-gentoo-r1 x86_64 AMD Athlon(tm) 64 FX-53 Processor
> Gentoo Base System release 1.12.10
> Timestamp of tree: Wed, 29 Aug 2007 16:30:01 +0000
> app-shells/bash:     3.2_p17-r1
> .
> .
> CFLAGS="-march=amd64 -mtune=amd64 -pipe"
> CHOST="x86_64-pc-linux-gnu"
> CONFIG_PROTECT="/etc /usr/kde/3.2/share/config /usr/kde/3.4/env
> .
> .

One combination that works is as follows:
  For the amd64 architecture, CFLAGS has to include:

  "-march=athlon64 -mtune=athlon64"

On the Gentoo forums there is information to suggest that 

amd64 == athlon64 == k8 

apparently in this case the equality does not hold true.
Comment 42 Sudarshan Wadkar 2007-09-04 06:53:00 UTC
same problem here, just installed gentoo base system and did emerge -uavDN world
only glibc 2.6.1 gave the same error others have reported
i am using core 2 duo 64 bit system and have CFLAGS as -march=nocona in make.conf
but emerge --info doesnt show this flag
is it like this or some bug/problem??
here is my emerge --info
Portage 2.1.3.7 (default-linux/amd64/2007.0, gcc-4.1.1, glibc-2.5-r0, 2.6.18.2-34-default x86_64)
=================================================================
System uname: 2.6.18.2-34-default x86_64 Intel(R) Core(TM)2 CPU 6420 @ 2.13GHz
Gentoo Base System release 1.12.10
Timestamp of tree: Mon, 03 Sep 2007 23:00:01 +0000
app-shells/bash:     3.2_p17-r1
dev-lang/python:     2.4.3-r4, 2.5.1-r2
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.10-r4
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.61-r1
sys-devel/automake:  1.9.6-r2, 1.10
sys-devel/binutils:  2.18
sys-devel/gcc-config: 1.4.0-r2
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22-r2
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks metadata-transfer sandbox sfperms unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.iitb.ac.in/os/gentoo http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="en_US.UTF-8"
LINGUAS="en"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://ftp.iitb.ac.in/gentoo-portage"
USE="X acl alsa amd64 berkdb bitmap-fonts cd cdr cli cracklib crypt cups dri dvd dvdr fortran gdbm gpm iconv ipv6 isdnlog kde midi mmx mudflap ncurses nls nptl nptlonly openmp pam pcre perl pppd python qt3 qt4 readline reflection session spl sse sse2 ssl tcpd truetype-fonts type1-fonts unicode xorg zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="evdev mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="nvidia"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 43 Jakub Moc (RETIRED) gentoo-dev 2007-09-11 13:03:08 UTC
*** Bug 192142 has been marked as a duplicate of this bug. ***
Comment 44 J 2007-10-05 22:16:14 UTC
I'm running into this too.
http://sourceware.org/ml/libc-alpha/2007-02/msg00009.html

IF I understand correctly, in order to build the 32-bit compatibility library for x86_64-pc-linux-gnu, the target is set at i386?  Can't that be changed to target i486?

What controls the target for the 32-bit libs?
Comment 45 SpanKY gentoo-dev 2007-10-07 02:50:57 UTC
the target is not the problem for x86_64 users ... the CHOST is being set to i686-* for them
Comment 46 SpanKY gentoo-dev 2007-10-07 03:18:36 UTC
glibc's build system sorts CFLAGS which causes other -march flags to maybe take precedence

glibc-2.6.1 now deletes -march from cflags before adding -march=i686
Comment 47 Marijn Schouten (RETIRED) gentoo-dev 2007-10-07 14:11:13 UTC
Still fails in the same way.

Portage 2.1.3.12 (default-linux/amd64/2006.1/desktop, gcc-4.1.2, glibc-2.6-r0, 2.6.22-gentoo-r8 x86_64)
=================================================================
System uname: 2.6.22-gentoo-r8 x86_64 Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz
Timestamp of tree: Sun, 07 Oct 2007 11:00:01 +0000
app-shells/bash:     3.2_p17-r1
dev-lang/python:     2.4.4-r4, 2.5.1-r2
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.10-r5
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r3
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22-r2
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -pipe -ggdb"
DISTDIR="/usr/portage/distfiles"
FEATURES="collision-protect cvs distlocks metadata-transfer parallel-fetch sandbox sfperms splitdebug strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_US.UTF-8"
LINGUAS="en nl"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/nouveau /home/marijn/git/gentoo-lisp-overlay /home/marijn/overlay"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acpi alsa amd64 berkdb bitmap-fonts cairo cdr cli cracklib crypt cups dbus dri dts dvd dvdr dvdread eds emacs emboss encode esd fam firefox fortran gdbm gif gmp gnome gpm gstreamer gtk gtk2 hal iconv ipv6 isdnlog jpeg kde kdeenablefinal ldap lm_sensors mad midi mikmod mng mp3 mpeg mudflap ncurses nls nptl nptlonly nvidia offensive ogg opengl openmp pam pcre pdf perl png ppds pppd python qt3 qt4 quicktime readline reflection sdl session smp spell spl ssl svg tcpd theora threads tiff truetype truetype-fonts type1-fonts unicode vorbis xinerama xml xorg xpm xv zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en nl" USERLAND="GNU" VIDEO_CARDS="fbdev nouveau nv nvidia"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 48 Marijn Schouten (RETIRED) gentoo-dev 2007-10-07 14:18:09 UTC
Created attachment 132827 [details]
glibc-2.6.1_build-log.bz2
Comment 49 Tais P. Hansen 2007-10-07 14:28:20 UTC
I had to add "-march=opteron" to CFLAGS to get glibc-2.6.1 to build on amd64.
Comment 50 SpanKY gentoo-dev 2007-10-10 19:51:36 UTC
should work fine now
Comment 51 Marijn Schouten (RETIRED) gentoo-dev 2007-10-11 12:19:27 UTC
Indeed it installed fine now. Thanks vapier.
Comment 52 Joacim Wicander 2007-10-14 11:28:17 UTC
I cant get Glibc 2.6.1 to compile on amd64X2, i have tried -march=[athlon64|x86_64|opteron] and -mtune=[athlon64|x86_64|opteron] to no avail.

my emerge --info:
Portage 2.1.3.13 (default-linux/amd64/2007.0/desktop, gcc-4.2.2/amd64-vanilla, glibc-2.6.1-r0, 2.6.23-gentoo-smp-devil x86_64)
=================================================================
System uname: 2.6.23-gentoo-smp-devil x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
Timestamp of tree: Sun, 14 Oct 2007 06:50:01 +0000
ccache version 2.4 [enabled]
app-admin/eselect-compiler: 2.0.0_rc2-r1
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.2
dev-lang/python:     2.4.4-r4, 2.5.1-r2
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.10-r5
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 2.0.0_rc1
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.23
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=athlon64 -mtune=athlon64 -funroll-loops -funit-at-a-time -fpeel-loops -ftracer -funswitch-loops -fomit-frame-pointer -pipe -fno-ident -msse -msse2 -msse3"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/eselect/compiler /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -march=athlon64 -mtune=athlon64 -funroll-loops -funit-at-a-time -fpeel-loops -ftracer -funswitch-loops -fomit-frame-pointer -pipe -fno-ident -msse -msse2 -msse3 -fno-enforce-eh-specs"
DISTDIR="/mnt/portage/distfiles"
FEATURES="ccache digest distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://ds.thn.htu.se/linux/gentoo http://mirror.pudas.net/gentoo/ http://mirror.uni-c.dk/pub/gentoo http://mirror.gentoo.no http://gentoo.eliteitminds.com http://osdn.dl.sourceforge.net http://gentoo.mirror.icd.hu/ ftp://mir.zyrianes.net/gentoo/"
LDFLAGS="-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -Wl,--strip-all"
LINGUAS="en en_US"
MAKEOPTS="-j3"
PKGDIR="/mnt/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/mnt/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/xeffects"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X aac acl acpi alsa amd64 arts bash-completion bitmap-fonts browserplugin bzip2 bzlib cairo cdr cli cracklib crypt cups diskio dri dvd dvdr dvdread emboss encode esd evo fam fbcon firefox flac fortran gd gdbm gif glitz gnome gpm gstreamer gtk gtk2 howl iconv imlib2 ipv6 isdnlog java jpeg jpeg2k kerberos lm_sensors mad matroska mfd-rewrites midi mikmod mmx mozbranding mozsvg mp3 mpeg msn mudflap ncurses nls nptl nptlonly nsplugin nvidia ogg onicode opengl openmp oss pam pcre pdf perl png pppd python qt3support quicktime readline reflection sdl session smp spell spl sse sse2 ssl svg sysvipc tcpd tiff truetype truetype-fonts type1-fonts unicode usb vorbis wavpack wma xcb xine xml xml2 xorg xscreensaver xv xvmc zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci 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 mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US" USERLAND="GNU" VIDEO_CARDS="nvidia vesa"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


the error i get when compiling glibc:
mv -f /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/shlib.ldsT /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/shlib.lds
i686-pc-linux-gnu-gcc -Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -Wl,--strip-all  -shared -static-libgcc -Wl,-O1  -Wl,-z,defs -Wl,-dynamic-linker=/lib32/ld-linux.so.2  -B/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/csu/  -Wl,--version-script=/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc.map -Wl,-soname=libc.so.6 -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -nostdlib -nostartfiles -e __libc_main -Wl,-z,now -L/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl -L/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/math -L/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/elf -L/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/dlfcn -L/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/nss -L/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/nis -L/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/rt -L/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/resolv -L/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/crypt -L/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/nptl -Wl,-rpath-link=/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl:/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/math:/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/elf:/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/dlfcn:/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/nss:/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/nis:/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/rt:/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/resolv:/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/crypt:/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/nptl -o /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc.so -T /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/shlib.lds /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/csu/abi-note.o /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/soinit.os /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_pic.os /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/sofini.os /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/interp.os /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/ld.so -lgcc
/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_pic.os: In function `__fork':
(.text+0x7791f): undefined reference to `__sync_bool_compare_and_swap_4'
/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_pic.os: In function `__nis_hash':
(.text+0xd8d70): undefined reference to `__sync_fetch_and_add_4'
/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_pic.os: In function `__nis_hash':
(.text+0xd8db2): undefined reference to `__sync_fetch_and_add_4'
/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_pic.os: In function `__nscd_getpwnam_r':
(.text+0xd91d6): undefined reference to `__sync_fetch_and_add_4'
/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_pic.os: In function `__nscd_getpwnam_r':
(.text+0xd921a): undefined reference to `__sync_fetch_and_add_4'
/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_pic.os: In function `__nscd_getgrnam_r':
(.text+0xd983e): undefined reference to `__sync_fetch_and_add_4'
/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_pic.os:(.text+0xd9882): more undefined references to `__sync_fetch_and_add_4' follow
/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_pic.os: In function `__nscd_get_map_ref':
(.text+0xdb74e): undefined reference to `__sync_val_compare_and_swap_4'
/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_pic.os: In function `__GI___libc_freeres':
(__libc_freeres_fn+0x89e): undefined reference to `__sync_bool_compare_and_swap_4'
collect2: ld returned 1 exit status
make[1]: *** [/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc.so] Error 1
make[1]: Leaving directory `/var/tmp/portage/sys-libs/glibc-2.6.1/work/glibc-2.6.1'
make: *** [all] Error 2
 * 
 * ERROR: sys-libs/glibc-2.6.1 failed.
 * Call stack:
 *            ebuild.sh, line 1695:  Called dyn_compile
 *            ebuild.sh, line 1033:  Called qa_call 'src_compile'
 *            ebuild.sh, line   44:  Called src_compile
 *   glibc-2.6.1.ebuild, line  147:  Called eblit-run 'src_compile'
 *   glibc-2.6.1.ebuild, line  143:  Called eblit-glibc-src_compile
 *    src_compile.eblit, line  168:  Called src_compile
 *   glibc-2.6.1.ebuild, line  147:  Called eblit-run 'src_compile'
 *   glibc-2.6.1.ebuild, line  143:  Called eblit-glibc-src_compile
 *    src_compile.eblit, line  179:  Called toolchain-glibc_src_compile
 *    src_compile.eblit, line  122:  Called die
 * The specific snippet of code:
 *              make PARALLELMFLAGS="${MAKEOPTS}" || die "make for ${ABI} failed"
 *  The die message:
 *   make for x86 failed
 * 
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/log/portage/sys-libs:glibc-2.6.1:20071014-081413.log'.
 * 
Comment 53 Mr. B 2007-10-15 00:07:51 UTC
I had the same problem as above when using eselect-compiler, but after switching to gcc-config I can build glibc successfully. Thus, by my amazing powers of deduction *cough*, I do believe this to be another, perhaps different, bug in eselect-compiler.
Comment 54 Joacim Wicander 2007-10-15 06:04:01 UTC
Tried to change gcc version with gcc-config and it didnt help, still got the same error when compiling glibc 2.6.1.

I have even tried with stipped CFLAGS, LDFLAGS and disabled CCACHE, but i cant GLIBC to compile.
Comment 55 urcindalo 2007-10-17 16:29:31 UTC
I got glibc 2.6.1 to compile on my AMD64 box just by changing my /etc/make.conf from this:
======== [old]
CFLAGS="-march=k8 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
=========

to this:
======== [new]
CFLAGS="-march=athlon64 -mtune=athlon64 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CBUILD="x86_64-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
========

The hint was in #41. Thanks a lot, Aakash!!

I also added the CBUILD line, but, do I really need it?
Comment 56 Joacim Wicander 2007-10-18 06:09:27 UTC
i have now tried with:
CFLAGS="-march=athlon64 -mtune=athlon64 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CBUILD="x86_64-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"

to no avail. ive even tried recompiling binutils, libtool and gcc before i recompile glibc.

Anyone???
Comment 57 Tais P. Hansen 2007-10-19 18:58:22 UTC
(In reply to comment #52)
> sys-devel/gcc-config: 2.0.0_rc1

Start by downgrading to a non-hardmasked gcc-config (1.4.0-something).

Then use gcc-config to switch to a different version than the current version and then back to the version you want to use. Then run env-update followed by source /etc/profile. Then you strip your make.conf, leaving LDFLAGS unset and make sure the following three is identical:

CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe"
CXXFLAGS="${CFLAGS}"

After that you try to build glibc.

I've built glibc-2.6.1 like this with gcc-4.1.2.
Comment 58 Joacim Wicander 2007-10-20 07:59:56 UTC
Thanks Tais.

I just unmerged gcc-config-2.0.0_rc1 and emerged gcc-config-1.4.0-R4 instead and set the right compiler, env-update and source /etc-profile. Now it works-

Thanks again for the help.
Comment 59 Jakub Moc (RETIRED) gentoo-dev 2007-11-17 21:21:57 UTC
*** Bug 199471 has been marked as a duplicate of this bug. ***
Comment 60 Jakub Moc (RETIRED) gentoo-dev 2007-11-21 19:30:49 UTC
*** Bug 199904 has been marked as a duplicate of this bug. ***
Comment 61 Xake 2008-12-09 21:59:48 UTC
(In reply to comment #46)
> glibc's build system sorts CFLAGS which causes other -march flags to maybe take
> precedence
> 
> glibc-2.6.1 now deletes -march from cflags before adding -march=i686
> 

"Moreover, specifying -march=cpu-type implies -mtune=cpu-type."

From "man gcc", look under "-mtune" for intel processors.

This can make people (like me, and a lot of other poeple I have seen on the forum) only set -march and end up with a unoptimized glibc, which for example shows its face in at least one failing testcase (iconvdata/tst-tables) for glibc.

As far as I can understand from this bugreport this only happends (at least on x86) if no "-march" is set in CFLAGS, so is it not possible to just add -march if it is not set?
Or if we want to become really complicated: keep removing/inserting -march and transforming the by user in CFLAGS given -march to -mtune?
Comment 62 devsk 2015-04-09 03:52:43 UTC
Fixing this bug by adding x86_64 to march (as per " * Auto adding -march=x86_64 to CFLAGS_x86 #185404") leads to:

https://bugs.gentoo.org/show_bug.cgi?id=528708

-march=x86_64 is no longer accepted by gcc-4.9. What's the plan to fix this bug and 528708 with gcc-4.9?
Comment 63 SpanKY gentoo-dev 2015-05-30 03:56:46 UTC
(In reply to devsk from comment #62)

you've filed a new bug ... there's no need to go back and post to old bugs