Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 289757

Summary: >=sys-devel/gcc-4.3 fails with USE="-vanilla fortran" with some glibc's due to fortify patch
Product: Gentoo/Alt Reporter: Justin Lecher (RETIRED) <jlec>
Component: Prefix SupportAssignee: Gentoo Prefix <prefix>
Status: RESOLVED FIXED    
Severity: normal CC: chetanreddy, conan, jinxiaoyong, ryao
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard: SLES 10 (glibc-2.4), RHEL 5 (glibc-2.5)
Package list:
Runtime testing required: ---
Bug Depends on: 346615    
Bug Blocks:    
Attachments: /var/tmp/alexxy/portage/sys-devel/gcc-4.5.3-r1/temp/build.log.gz

Description Justin Lecher (RETIRED) gentoo-dev 2009-10-19 17:29:05 UTC
usr/include/bits/stdlib.h:37: multiple definition of `realpath'
.libs/backtrace.o:/usr/include/bits/stdlib.h:37: first defined here
.libs/in_pack_generic.o: In function `fgets_unlocked':
/usr/include/bits/stdio2.h:114: multiple definition of `fgets_unlocked'
.libs/backtrace.o:/usr/include/bits/stdio2.h:114: first defined here
.libs/in_pack_generic.o: In function `fgets':
/usr/include/bits/stdio2.h:98: multiple definition of `fgets'
.libs/backtrace.o:/usr/include/bits/stdio2.h:98: first defined here
.libs/in_pack_generic.o: In function `gets':
/usr/include/bits/stdio2.h:83: multiple definition of `gets'
.libs/backtrace.o:/usr/include/bits/stdio2.h:83: first defined here
.libs/in_unpack_generic.o: In function `stpncpy':
/usr/include/bits/string3.h:160: multiple definition of `stpncpy'
.libs/backtrace.o:/usr/include/bits/string3.h:160: first defined here
.libs/in_unpack_generic.o: In function `wcstombs':
/usr/include/bits/stdlib.h:114: multiple definition of `wcstombs'
.libs/backtrace.o:/usr/include/bits/stdlib.h:114: first defined here
.libs/in_unpack_generic.o: In function `mbstowcs':
/usr/include/bits/stdlib.h:95: multiple definition of `mbstowcs'
.libs/backtrace.o:/usr/include/bits/stdlib.h:95: first defined here
.libs/in_unpack_generic.o: In function `wctomb':
/usr/include/bits/stdlib.h:74: multiple definition of `wctomb'
.libs/backtrace.o:/usr/include/bits/stdlib.h:74: first defined here
.libs/in_unpack_generic.o: In function `ptsname_r':
/usr/include/bits/stdlib.h:53: multiple definition of `ptsname_r'
.libs/backtrace.o:/usr/include/bits/stdlib.h:53: first defined here
.libs/in_unpack_generic.o: In function `realpath':
/usr/include/bits/stdlib.h:37: multiple definition of `realpath'
.libs/backtrace.o:/usr/include/bits/stdlib.h:37: first defined here
.libs/in_unpack_generic.o: In function `fgets_unlocked':
/usr/include/bits/stdio2.h:114: multiple definition of `fgets_unlocked'
.libs/backtrace.o:/usr/include/bits/stdio2.h:114: first defined here
.libs/in_unpack_generic.o: In function `fgets':
/usr/include/bits/stdio2.h:98: multiple definition of `fgets'
.libs/backtrace.o:/usr/include/bits/stdio2.h:98: first defined here
.libs/in_unpack_generic.o: In function `gets':
/usr/include/bits/stdio2.h:83: multiple definition of `gets'
.libs/backtrace.o:/usr/include/bits/stdio2.h:83: first defined here
collect2: ld returned 1 exit status
make[3]: *** [libgfortran.la] Error 1
make[3]: Leaving directory `/tmp/justin/portage/sys-devel/gcc-4.4.1/work/build/x86_64-pc-linux-gnu/libgfortran'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/tmp/justin/portage/sys-devel/gcc-4.4.1/work/build/x86_64-pc-linux-gnu/libgfortran'
make[1]: *** [all-target-libgfortran] Error 2
make[1]: Leaving directory `/tmp/justin/portage/sys-devel/gcc-4.4.1/work/build'
make: *** [bootstrap-lean] Error 2
 * ERROR: sys-devel/gcc-4.4.1 failed:
 *   emake failed with bootstrap-lean
 * 
 * Call stack:
 *     ebuild.sh, line   51:  Called call-ebuildshell 'src_compile'





$ emerge --info =sys-devel/gcc-4.4.1
Portage 2.2.00.14555-prefix (prefix/linux/amd64, gcc-4.2.4, unavailable, 2.6.18.8-0.10-default x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.18.8-0.10-default-x86_64-Intel-R-_Xeon-R-_CPU_5160_@_3.00GHz-with-SuSE-10.2-X86-64
Timestamp of tree: Thu, 15 Oct 2009 14:25:45 +0000
app-shells/bash:     4.0_p33-r00.1
dev-lang/python:     2.6.2-r2
sys-apps/sandbox:    2.1
sys-devel/autoconf:  2.63-r01.1
sys-devel/automake:  1.10.2-r00.1, 1.11
sys-devel/binutils:  2.20.51.0.1
sys-devel/gcc-config: 1.4.1-r00.2
sys-devel/libtool:   2.2.6a-r00.2
virtual/os-headers:  2.6.30-r1
ABI="amd64"
ACCEPT_KEYWORDS="~amd64-linux"
ACCEPT_LICENSE="* -@EULA"
ACCEPT_PROPERTIES="*"
ACLOCAL_FLAGS="-I /opt/gnome/share/aclocal -I /opt/gnome/share/aclocal"
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 mmap_emul mulaw multi null plug rate route share shm softvol"
APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache 
filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias"
ARCH="amd64"
ASFLAGS_x86="--32"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CDEFINE_amd64="__x86_64__"
CDEFINE_x86="__i386__"
CFLAGS="-O2 -march=nocona -pipe"
CFLAGS_x86="-m32"
CHOST="x86_64-pc-linux-gnu"
CHOST_amd64="x86_64-pc-linux-gnu"
CHOST_x86="i686-pc-linux-gnu"
CLEAN_DELAY="5"
COLLISION_IGNORE="/lib/modules"
COLORTERM="1"
COLUMNS="279"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/sandbox.d /etc/terminfo"
CPU="x86_64"
CSHEDIT="emacs"
CSHRCREAD="true"
CVS_RSH="ssh"
CXXFLAGS="-O2 -march=nocona -pipe"
DEFAULT_ABI="default"
DEFAULT_PATH="/home/anubis/justin/prefix/usr/bin:/home/anubis/justin/prefix/usr/sbin:/home/anubis/justin/prefix/bin:/home/anubis/justin/prefix/sbin:/home/anubis/justin/prefix/bin:/usr/bin:/bin"
DISTDIR="/home/anubis/justin/prefix/usr/portage/distfiles"
EDITOR="/home/anubis/justin/prefix/bin/nano"
ELIBC="glibc"
EMERGE_DEFAULT_OPTS="-t --verbose --jobs=9 --load-average=8 --keep-going"
EMERGE_WARNING_DELAY="10"
ENV="/etc/bash.bashrc"
EPREFIX="/home/anubis/justin/prefix"
EROOT="/home/anubis/justin/prefix/"
F77="gfortran"
FCFLAGS="-O2 -march=nocona -pipe"
FEATURES="assume-digests collision-protect distlocks fixpackages news noinfo parallel-fetch preserve-libs protect-owned sfperms sign split-debug strict unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FETCHCOMMAND="/home/anubis/justin/prefix/usr/bin/wget -t 5 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}""
FFLAGS="-O2 -march=nocona -pipe"
FORTRANC="gfortran"
FROM_HEADER=""
GCC_SPECS=""
GENTOO_MIRRORS="http://gentoo.j-schmitz.net/mirror/             ftp://ftp.gentoo.mesh-solutions.com/gentoo/             ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo                ftp://ftp.tu-clausthal.de/pub/linux/gentoo/             
http://mirror.switch.ch/ftp/mirror/gentoo/"
GNOME2_PATH="/usr/local:/opt/gnome:/usr:/usr/local:/opt/gnome:/usr"
GROFF_NO_SGR="yes"
GROUP="ibi"
GTK_PATH="/usr/local/lib/gtk-2.0:/opt/gnome/lib/gtk-2.0:/usr/lib/gtk-2.0:/usr/local/lib/gtk-2.0:/opt/gnome/lib/gtk-2.0:/usr/lib/gtk-2.0"
GTK_PATH64="/usr/local/lib64/gtk-2.0:/opt/gnome/lib64/gtk-2.0:/usr/lib64/gtk-2.0:/usr/local/lib64/gtk-2.0:/opt/gnome/lib64/gtk-2.0:/usr/lib64/gtk-2.0"
G_BROKEN_FILENAMES="1"
G_FILENAME_ENCODING="@locale,UTF-8,ISO-8859-15,CP1252"
HISTSIZE="1000"
HOME="/home/anubis/justin"
HOST="sarastro"
HOSTNAME="sarastro.ibi.kfa-juelich.de"
HOSTTYPE="x86_64"
INFODIR="/usr/local/info:/usr/share/info:/usr/info:/usr/local/info:/usr/share/info:/usr/info"
INFOPATH="/home/anubis/justin/prefix/usr/share/info:/home/anubis/justin/prefix/usr/share/gcc-data/x86_64-pc-linux-gnu/4.2.4/info"
INPUTRC="/etc/inputrc"
INPUT_DEVICES="keyboard mouse"
JAVA_BINDIR="/usr/lib64/jvm/jre/bin"
JAVA_HOME="/usr/lib64/jvm/jre"
JAVA_ROOT="/usr/lib64/jvm/jre"
JRE_HOME="/usr/lib64/jvm/jre"
KERNEL="linux"
LANG="de_DE.UTF-8"
LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text"
LDFLAGS="-Wl,-O1,--hash-style=gnu,--sort-common"
LDFLAGS_x86="-m elf_i386"
LESS="-R -M --shift 5"
LESSCLOSE="lessclose.sh %s %s"
LESSKEY="/etc/lesskey.bin"
LESSOPEN="|lesspipe.sh %s"
LESS_ADVANCED_PREPROCESSOR="no"
LIBDIR_amd64="lib"
LIBDIR_amd64_fbsd="lib64"
LIBDIR_ppc="lib32"
LIBDIR_ppc64="lib64"
LIBDIR_sparc32="lib32"
LIBDIR_sparc64="lib64"
LIBDIR_x86="lib32"
LIBDIR_x86_fbsd="lib32"
LINES="79"
LINGUAS="en"
LOGNAME="justin"
LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmpc=\E[P:DC=\E[%dP:\
        :im=\E[4h:ei=\E[4l:mi:IC=\E[%d@:ks=\E[?1h\E=:\
        :ke=\E[?1l\E>:vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l:\
        :ti=\E[?1049h:te=\E[?1049l:us=\E[4m:ue=\E[24m:so=\E[3m:\
        :se=\E[23m:mb=\E[5m:md=\E[1m:mr=\E[7m:me=\E[m:ms:\
        :Co#8:pa#64:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:AX:\
        :vb=\Eg:G0:as=\E(0:ae=\E(B:\
        :ac=\140\140aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~..--++,,hhII00:\
        :po=\E[5i:pf=\E[4i:k0=\E[10~:k1=\EOP:k2=\EOQ:k3=\EOR:\
        :k4=\EOS:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:\
        :k9=\E[20~:k;=\E[21~:F1=\E[23~:F2=\E[24~:F3=\E[25~:\
        :F4=\E[26~:F5=\E[28~:F6=\E[29~:F7=\E[31~:F8=\E[32~:\
        :F9=\E[33~:FA=\E[34~:kb=:K1=\EOw:K2=\EOu:K3=\EOy:\
        :K4=\EOq:K5=\EOs:kB=\E[Z:kE=\E[8\^:*4=\E[3$:*7=\E[8$:\
        :#2=\E[7$:#3=\E2$:#4=\E[d:%c=\E[6$:%e=\E[5$:%i=\E[c:\
        :kh=\E[1~:@1=\E[1~:kH=\E[4~:@7=\E[4~:kN=\E[6~:kP=\E[5~:\
        :kI=\E[2~:kD=\E[3~:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:km:"
TEXINPUTS="::/home/anubis/justin/.TeX:/usr/share/doc/.TeX:/usr/doc/.TeX:/home/anubis/justin/.TeX:/usr/share/doc/.TeX:/usr/doc/.TeX"
USE="X amd64 bash-completion berkdb bzip2 cli cracklib crypt dri fortran gdbm iconv isdnlog libffi lzma mmx modules mudflap nano-syntax ncurses nls nptl nptlonly openmp pcre perl png pppd prefix python readline reflection session spl sse sse2 ssl sysfs tcpd threads tk 
truetype unicode xorg 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 mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default 
authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id 
userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="fglrx" 
USER="justin"
USERLAND="GNU"
USE_EXPAND="ALSA_CARDS ALSA_PCM_PLUGINS APACHE2_MODULES APACHE2_MPMS CAMERAS CROSSCOMPILE_OPTS DVB_CARDS ELIBC FCDSL_CARDS FOO2ZJS_DEVICES FRITZCAPI_CARDS INPUT_DEVICES KERNEL LCD_DEVICES LINGUAS LIRC_DEVICES MISDN_CARDS NETBEANS_MODULES QEMU_SOFTMMU_TARGETS 
QEMU_USER_TARGETS SANE_BACKENDS USERLAND VIDEO_CARDS"
USE_EXPAND_HIDDEN="CROSSCOMPILE_OPTS ELIBC KERNEL USERLAND"
USE_ORDER="env:pkg:conf:defaults:pkginternal:env.d"
VENDOR="suse"
VIDEO_CARDS="fglrx"
WINDOW="0"
WINDOWMANAGER="/usr/bin/kde"
XCURSOR_THEME="crystalwhite"
XDG_CONFIG_DIRS="/usr/local/etc/xdg/:/etc/xdg/:/etc/opt/gnome/xdg/"
XDG_DATA_DIRS="/usr/local/share/:/usr/share/:/etc/opt/kde3/share/:/opt/kde3/share/:/opt/gnome/share/"
XKEYSYMDB="/usr/share/X11/XKeysymDB"
XNLSPATH="/usr/share/X11/nls"
_="/home/anubis/justin/prefix/usr/bin/emerge"
mc="() {  . /usr/share/mc/bin/mc-wrapper.sh
}"

=================================================================
                        Package Settings
=================================================================

sys-devel/gcc-4.4.1 was built with the following:
USE="mudflap nls nptl openmp (prefix) (-altivec) -bootstrap -build -doc (-fixed-point) -fortran -gcj -graphite -gtk (-hardened) -ip28 -ip32r10k (-libffi) (-multilib) -multislot (-n32) (-n64) -nocxx -objc -objc++ -objc-gc -test -vanilla" 



$ emerge -pqv =sys-devel/gcc-4.4.1
[ebuild   R   ] sys-devel/gcc-4.4.1  USE="fortran* mudflap nls nptl openmp (-altivec) -bootstrap -build -doc (-fixed-point) -gcj -graphite -gtk (-hardened) -ip28 -ip32r10k (-libffi) (-multilib) -multislot (-n32) (-n64) -nocxx -objc -objc++ -objc-gc -test -vanilla"
Comment 1 Stefan Hoelldampf 2009-10-19 18:56:41 UTC
On RHEL5 amd64-linux I am able to successfully emerge sys-devel/gcc-4.4.1 using USE=fortran, but net-misc/openssh-5.3_p1 fails with a similar error:

--------------------------------------------------------------------------------
x86_64-pc-linux-gnu-gcc -o sftp progressmeter.o sftp.o sftp-client.o sftp-common.o sftp-glob.o -L. -Lopenbsd-compat/ -Wl,-O1 -fstack-protector-all -Wl,-O1 -lssh -lopenbsd-compat -L/tmp/gentoo/usr/lib -lssl -lcrypto -ldl-lz   -lutil -lz -lnsl  -lcrypt -lresolv
./libssh.a(fatal.o): In function `fgets_unlocked':
fatal.c:(.text+0xb0): multiple definition of `fgets_unlocked'
ssh-rand-helper.o:ssh-rand-helper.c:(.text+0x1590): first defined here
./libssh.a(fatal.o): In function `fgets':
fatal.c:(.text+0xf0): multiple definition of `fgets'
ssh-rand-helper.o:ssh-rand-helper.c:(.text+0x15d0): first defined here
...
--------------------------------------------------------------------------------

I think the problem could be related to glibc 2.5 (on RHEL5) defining these functions in /usr/include/bits/*.h
Using a vanilla gcc-4.4.1 (bootstrapped with the RHEL5 system gcc) the multiple definitions do not occur, so some Gentoo modifications seem to be a problem.

BTW, on RHEL4 having glibc-2.3 net-misc/openssh-5.3_p1 can be emerged without any problems.
Comment 2 Fabian Groffen gentoo-dev 2009-10-21 19:54:52 UTC
hmmm, these multiple definitions errors get nasty, more because I've no clue why they only happen on certain linuxes...
Comment 3 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-04-20 13:22:38 UTC
I have confirmed that the workaround to this bug is either USE=vanilla or USE=-fortran. It would be useful to know what the heck USE=vanilla is doing but it is not obvious in the gcc ebuilds.
Comment 4 Fabian Groffen gentoo-dev 2010-04-21 06:34:59 UTC
vanilla means: apply no patches
Comment 5 Stephan Hartmann (RETIRED) gentoo-dev 2010-08-26 17:33:37 UTC
sys-devel/gcc-4.4.4-r1 also failed for me on RHEL5 (amd64-linux) with USE="-vanilla fortran". Appending "-fgnu89-inline" to CFLAGS in libgfortran fixed the issue. This also works for other packages like app-arch/cpio, app-arch/gzip and net-misc/openssh.

BTW:
The problematic patch seems to be "10_all_gcc-default-fortify-source.patch", which enables _FORTIFY_SOURCE=2 by default. If this patch is excluded (using GENTOO_PATCH_EXCLUDE) gcc also compiles itself successfully, but other packages still fail with multiple definitions.
Comment 6 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-08-26 17:39:31 UTC
(In reply to comment #5)
> Appending "-fgnu89-inline" to CFLAGS in libgfortran
> fixed the issue. This also works for other packages like app-arch/cpio,
> app-arch/gzip and net-misc/openssh.

confirmed here, thx.
Comment 7 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-08-26 17:40:51 UTC
*** Bug 283663 has been marked as a duplicate of this bug. ***
Comment 8 Fabian Groffen gentoo-dev 2011-04-06 17:47:53 UTC
and gcc-4.5.*?
Comment 9 Fabian Groffen gentoo-dev 2011-04-06 17:48:45 UTC
*** Bug 290263 has been marked as a duplicate of this bug. ***
Comment 10 Fabian Groffen gentoo-dev 2011-04-06 17:53:07 UTC
*** Bug 306945 has been marked as a duplicate of this bug. ***
Comment 11 Massimo Burcheri 2011-04-12 15:00:42 UTC
Current stable gcc-4.5.2-r00.1 built fine with default USE="-vanilla fortran" on host-OS OpenSuse.
I tried a few others.. All emerged fine:
sys-devel/gcc-4.4.5
sys-devel/gcc-4.4.4-r2
Comment 12 Fabian Groffen gentoo-dev 2011-04-12 15:28:46 UTC
ok, closing then, thanks
Comment 13 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-11-28 13:23:26 UTC
More talk on the ML about this issue so I guess we will re-open..
Comment 14 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-11-28 13:25:01 UTC
Benda says this allows compilation: GENTOO_PATCH_EXCLUDE=10_all_gcc-default-fortify-source.patch
Comment 15 Benda Xu gentoo-dev 2011-11-28 13:51:55 UTC
(In reply to comment #14)
> Benda says this allows compilation:
> GENTOO_PATCH_EXCLUDE=10_all_gcc-default-fortify-source.patch

Ah-ha, In Comment 5 Stephan Hartmann already mentioned about this work around. The patch just enable that buffer overflow check by default. I am now using Centos 5 with gcc-4.5.3 and no problems are spotted.

Don't know what Stephan Hartmann refers to by "but other packages still fail with multiple definitions."
Comment 16 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-11-30 14:04:28 UTC
(In reply to comment #15)
> (In reply to comment #14)
> > Benda says this allows compilation:
> > GENTOO_PATCH_EXCLUDE=10_all_gcc-default-fortify-source.patch
> 
> Ah-ha, In Comment 5 Stephan Hartmann already mentioned about this work around.
> The patch just enable that buffer overflow check by default. I am now using
> Centos 5 with gcc-4.5.3 and no problems are spotted.

So, excluding a patch is easy to do in something like the bashrc inside the profiles IF we can find a condition to check..

Maybe: if "/lib/libc.so.6 | grep "C Library" | grep version" == $problem_version

OR easier, "/usr/bin/ldd --version | head -n1"

Thoughts anyone?
Comment 17 Fabian Groffen gentoo-dev 2011-11-30 14:06:31 UTC
since this depends on the libc, I suggest to query the libc on Linux for it's version (/lib/libc.so or something?) and exclude that patch based on some number out there.

The devil is in the details, of course
Comment 18 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-11-30 14:45:01 UTC
(In reply to comment #17)
> since this depends on the libc, I suggest to query the libc on Linux for it's
> version (/lib/libc.so or something?) and exclude that patch based on some
> number out there.

That is the same as what I just said, no? I'll give it a try
Comment 19 Fabian Groffen gentoo-dev 2011-11-30 14:48:09 UTC
oh, right, I missed that one, sorry for the noise.
Comment 20 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-11-30 15:19:00 UTC
I didn't REALLY want to go here, but...

% cat profile.bashrc
# This is a ugly issue, see bug 289757 for origins

# 1) check OS since you cannot assume that *a* version of glibc is to blame, for
# some reason
# 2) On OS, check for a glibc version
# 3) Then exclude the fortify patch
#
# To add another "problem host OS" then add another elif block or so
#

if [[ ${PN} == "gcc" ]]; then
    if [[ -f /etc/redhat-release ]]; then
        if [[ $(grep "release 5" /etc/redhat-release > /dev/null) ]]; then
            if [[ $(/lib/libc.so.6 | grep "version 2.5" > /dev/null ); then
                GENTOO_PATCH_EXCLUDE=10_all_gcc-default-fortify-source.patch
            fi
        fi
    elif [[ -f /etc/SuSE-release ]]; then
        if [[ $(grep "VERSION = 10" /etc/SuSE-release > /dev/null) ]]; then
            if [[ $(/lib/libc.so.6 | grep "version 2.4" > /dev/null ); then
                GENTOO_PATCH_EXCLUDE=10_all_gcc-default-fortify-source.patch
            fi
        fi
    fi
fi

// vim: set expandtab ts=4:
<EOF>
Comment 21 Fabian Groffen gentoo-dev 2011-11-30 15:29:09 UTC
oh my...

If we'd know what actually fails to compile/link, we probably could just try to compile a simple program with -Wa,FORTIFY=2 or whatever is the correct invocation.
Comment 22 Benda Xu gentoo-dev 2011-12-01 03:42:53 UTC
(In reply to comment #21)
> oh my...
> 
> If we'd know what actually fails to compile/link, we probably could just try to
> compile a simple program with -Wa,FORTIFY=2 or whatever is the correct
> invocation.

What about this one stolen from autoconf snprintf test.

cat > test.c <<< 

#include <stdio.h>
int snprintf(char *a, size_t b, const char *c, ...) { return 0; }

int
main ()
{
  snprintf(0, 0, 0);
  return 0;
}
<EOF>

Even host shipped gcc fails:

$ /usr/bin/gcc -O2 -D_FORTIFY_SOURCE=2 -o test test.c
test.c:2: error: expected declaration specifiers or ‘...’ before numeric constant
test.c:2: error: expected declaration specifiers or ‘...’ before ‘__builtin_object_size’
test.c:2: warning: conflicting types for built-in function ‘__builtin___snprintf_chk’
test.c: In function ‘main’:
test.c:8: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes pointer from integer without a cast

BTW, RHEL 4 with glibc-2.3.5 fails with this test, causing openssh to fail. That's where I have discovered this test piece.
Comment 23 Benda Xu gentoo-dev 2011-12-01 04:06:00 UTC
(In reply to comment #21)
> oh my...
> 
> If we'd know what actually fails to compile/link, we probably could just try to
> compile a simple program with -Wa,FORTIFY=2 or whatever is the correct
> invocation.

And maybe this test is need understandable:

http://sourceware.org/bugzilla/show_bug.cgi?id=6409
Comment 24 Benda Xu gentoo-dev 2011-12-01 04:06:22 UTC
(In reply to comment #23)
> (In reply to comment #21)
> > oh my...
> > 
> > If we'd know what actually fails to compile/link, we probably could just try to
> > compile a simple program with -Wa,FORTIFY=2 or whatever is the correct
> > invocation.
> 
> And maybe this test is need understandable:
> 
> http://sourceware.org/bugzilla/show_bug.cgi?id=6409

s/need/more/g
Comment 25 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-12-01 22:40:18 UTC
(In reply to comment #22)

> What about this one stolen from autoconf snprintf test.

Sorry Benda, I'm not buying this test code. The code snippet fails on RHEL4, but my host doesn't have this bug.
Comment 26 Benda Xu gentoo-dev 2011-12-02 01:49:56 UTC
(In reply to comment #25)
> Sorry Benda, I'm not buying this test code. The code snippet fails on RHEL4,
> but my host doesn't have this bug.

Hi, Jeremy. I personally disabled FORTIFY_SOURCE=2 on CentOS 4.9 too. Otherwise openssh[hpn, tcpd] fails with:

i686-pc-linux-gnu-gcc -O2 -pipe -march=nocona -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wno-pointer-sign -Wno-unused-result -fno-strict-aliasing -fno-builtin-memset -fstack-protector-all -std=gnu99  -I. -I.. -I. -I./..  -DHAVE_CONFIG_H -c bsd-snprintf.c
bsd-snprintf.c: In function 'fmtstr':
bsd-snprintf.c:499:3: warning: value computed is not used
bsd-snprintf.c: At top level:
bsd-snprintf.c:832:1: error: expected declaration specifiers or '...' before numeric constant
bsd-snprintf.c:832:1: error: expected declaration specifiers or '...' before '__builtin_object_size'
bsd-snprintf.c:832:1: warning: conflicting types for built-in function '__builtin___vsnprintf_chk'
bsd-snprintf.c:840:1: error: expected declaration specifiers or '...' before numeric constant
bsd-snprintf.c:840:1: error: expected declaration specifiers or '...' before '__builtin_object_size'
bsd-snprintf.c:840:1: warning: conflicting types for built-in function '__builtin___snprintf_chk'
bsd-snprintf.c: In function '__builtin___snprintf_chk':
bsd-snprintf.c:846:2: warning: passing argument 3 of '__builtin___vsnprintf_chk' makes pointer from integer without a cast
bsd-snprintf.c:832:1: note: expected 'const char *' but argument is of type 'int'
bsd-snprintf.c:846:2: warning: passing argument 4 of '__builtin___vsnprintf_chk' makes pointer from integer without a cast
bsd-snprintf.c:832:1: note: expected 'va_list' but argument is of type 'unsigned int'
bsd-snprintf.c:846:2: error: too many arguments to function '__builtin___vsnprintf_chk'
bsd-snprintf.c:832:1: note: declared here

Could you verify this with your RHEL 4?
Comment 27 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-12-02 04:15:37 UTC
(In reply to comment #26)
> (In reply to comment #25)
> > Sorry Benda, I'm not buying this test code. The code snippet fails on RHEL4,
> > but my host doesn't have this bug.
> 
> Hi, Jeremy. I personally disabled FORTIFY_SOURCE=2 on CentOS 4.9 too. Otherwise
> openssh[hpn, tcpd] fails with:

Nope, it doesn't fail on RHEL4.
Comment 28 Fabian Groffen gentoo-dev 2011-12-03 15:07:48 UTC
can we move the epatch exclude into the gcc ebuilds eventually?  it's easy to rm the patch prior to toolchain_src_unpack.
Comment 29 Fabian Groffen gentoo-dev 2011-12-03 21:23:37 UTC
One might consider this bug even a dup of #362315
Comment 31 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-12-04 20:33:36 UTC
I was trying to specify what works in a very granular fashion, I'm fine with a nuke-all approach in the end. Unfortunately, a has_version check won't work (if that isn't obvious)..
Comment 32 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-12-05 21:19:20 UTC
I hope this is adequately worked around now and we can put it to rest. RESOLVED:WORKAROUND

% cat linux/profile.bashrc
# This is a ugly issue, see bug 289757 for origins
# This mimics the check in gcc ebuilds, bug 362315
#
# # Remember, bash treats floats like strings..

if [[ ${PN} == gcc && ${EBUILD_PHASE} == unpack ]]; then
    # Since 2.3 > 2.12 in numerical terms, just compare 2.X to 2.Y, will break
    # if >=3.0 is ever released
    VERS=$(/lib/libc.so.6 | head -n1 | grep -o "version [0-9]\.[0-9]" | cut -d. -f2 )
    if [[ $VERS -lt 12 ]]; then # compare host glibc 2.x to 2.12
        ewarn "Your host glibc is too old; disabling automatic fortify. bug 289757"
        GENTOO_PATCH_EXCLUDE="10_all_gcc-default-fortify-source.patch"
    fi
fi

# vim: set syn=sh expandtab ts=4:
Comment 33 Alexey Shvetsov archtester gentoo-dev 2011-12-14 17:34:55 UTC
Gcc only builds here with USE=-fortran but with +fortran it still failed on CentOS 5.6


Portage 2.2.01.19893-prefix (prefix/linux/amd64, gcc-4.6.1, unavailable, 2.6.18-238.12.1.el5 x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.18-238.12.1.el5-x86_64-Intel-R-_Xeon-R-_CPU_E5450_@_3.00GHz-with-redhat-5.6-Final
Timestamp of tree: Tue, 13 Dec 2011 22:40:43 +0000
app-shells/bash:      4.2_p10
dev-lang/python:      2.7.2-r3
dev-util/pkgconfig:   0.26
sys-devel/autoconf:   2.68
sys-devel/automake:   1.11.1
sys-devel/binutils:   2.22
sys-devel/gcc:        4.6.1-r1
sys-devel/gcc-config: 1.5-r2
sys-devel/libtool:    2.4-r4
sys-devel/make:       3.82
Repositories: gentoo_prefix science
Installed sets: 
ACCEPT_KEYWORDS="~amd64-linux"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -mtune=native -mfpmath=sse -msse4.1"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/portage /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=native -mtune=native -mfpmath=sse -msse4.1"
DISTDIR="/s/ls2/home/users/alexxy/prefix/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs buildpkg collision-protect distlocks ebuild-locks fixlafiles force-prefix metadata-transfer news parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe -march=native -mtune=native -mfpmath=sse -msse4.1"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="en"
MAKEOPTS="-j4"
PKGDIR="/s/ls2/home/users/alexxy/prefix/usr/portage/packages"
PORTAGE_CONFIGROOT="/s/ls2/home/users/alexxy/prefix/"
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/alexxy"
PORTDIR="/s/ls2/home/users/alexxy/prefix/usr/portage"
PORTDIR_OVERLAY="/s/ls2/home/users/alexxy/prefix/var/lib/layman/science"
SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix"
USE="amd64 bash-completion berkdb blas bzip2 cli cracklib crypt cxx double-precision dri fftw fontconfig fortran gdbm git gmp graphite iconv ipv6 lapack lpsol mmx modules mpi mudflap ncurses nls nptl nptlonly openmp pcre plotutils png pppd prefix readline romio session sse sse2 ssl sysfs tcpd threads truetype unicode vim vim-syntax xorg 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 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" 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="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" 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, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

sys-devel/gcc-4.6.1-r1 was built with the following:
USE="bootstrap cxx graphite mudflap nls nptl openmp (prefix) (-altivec) -build -doc (-fixed-point) -fortran -gcj -go -gtk (-hardened) (-libffi) (-multilib) -multislot -nocxx -nopie -nossp -objc -objc++ -objc-gc -test (-vanilla)"
CFLAGS="-O2 -pipe -march=native -mtune=native"
CXXFLAGS="-O2 -pipe -march=native -mtune=native"
LDFLAGS="-L/s/ls2/home/users/alexxy/prefix/usr/lib -Wl,-rpath=/s/ls2/home/users/alexxy/prefix/usr/lib -L/s/ls2/home/users/alexxy/prefix/lib -Wl,-rpath=/s/ls2/home/users/alexxy/prefix/lib"
Comment 34 Fabian Groffen gentoo-dev 2011-12-14 17:37:18 UTC
how about you first get some sane LDFLAGS?
Comment 35 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-12-14 18:26:25 UTC
As I said in IRC, you shouldn't have USE=bootsrap after a --sync. Don't re-open this bug, please. If you feel like you need to, then reproduce with non-masked ebuilds. Comment #32 stands.
Comment 36 Alexey Shvetsov archtester gentoo-dev 2011-12-14 23:16:37 UTC
Created attachment 295867 [details]
/var/tmp/alexxy/portage/sys-devel/gcc-4.5.3-r1/temp/build.log.gz

gzipped build log for gcc-4.5.3-r1

all prefix packages were rebuilt with gcc-4.2.4 before building gcc-4.5.3
Comment 37 Alexey Shvetsov archtester gentoo-dev 2011-12-14 23:18:57 UTC
alexxy@weed1 ~ $ emerge --info gcc
Portage 2.2.01.19893-prefix (prefix/linux/amd64, gcc-4.2.4, unavailable, 2.6.18-238.12.1.el5 x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.18-238.12.1.el5-x86_64-Intel-R-_Xeon-R-_CPU_E5450_@_3.00GHz-with-redhat-5.6-Final
Timestamp of tree: Tue, 13 Dec 2011 22:40:43 +0000
app-shells/bash:      4.2_p10
dev-lang/python:      2.7.2-r3
dev-util/pkgconfig:   0.26
sys-devel/autoconf:   2.68
sys-devel/automake:   1.11.1
sys-devel/binutils:   2.22
sys-devel/gcc:        4.2.4-r01.4
sys-devel/gcc-config: 1.5-r2
sys-devel/libtool:    2.4-r4
sys-devel/make:       3.82
Repositories: gentoo_prefix science
Installed sets: 
ACCEPT_KEYWORDS="~amd64-linux"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/portage /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/s/ls2/home/users/alexxy/prefix/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs buildpkg collision-protect distlocks ebuild-locks fixlafiles force-prefix metadata-transfer news parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="en"
MAKEOPTS="-j4"
PKGDIR="/s/ls2/home/users/alexxy/prefix/usr/portage/packages"
PORTAGE_CONFIGROOT="/s/ls2/home/users/alexxy/prefix/"
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/alexxy"
PORTDIR="/s/ls2/home/users/alexxy/prefix/usr/portage"
PORTDIR_OVERLAY="/s/ls2/home/users/alexxy/prefix/var/lib/layman/science"
SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix"
USE="amd64 bash-completion berkdb blas bzip2 cli cracklib crypt cxx double-precision dri fftw fontconfig fortran gdbm git gmp graphite iconv infiniband ipv6 lapack lpsol mmx modules mpi mudflap ncurses nls nptl nptlonly openmp pcre plotutils png pppd prefix readline romio session sse sse2 ssl sysfs tcpd threads truetype unicode vim vim-syntax xorg 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 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" 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="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" 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, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

sys-devel/gcc-4.2.4-r01.4 was built with the following:
USE="cxx fortran mudflap nls nptl openmp (prefix) (-altivec) -bootstrap -build -doc -gcj -gtk (-hardened) (-libffi) (-libssp) (-multilib) -multislot -nocxx -objc -objc++ -objc-gc -test (-vanilla)"
Comment 38 Alexey Shvetsov archtester gentoo-dev 2011-12-14 23:19:21 UTC
alexxy@weed1 ~ $ emerge -pv gcc

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  NS    ] sys-devel/gcc-4.5.3-r1 [4.2.4-r01.4] to /s/ls2/home/users/alexxy/prefix/ USE="cxx fortran graphite mudflap nls nptl openmp (-altivec) -bootstrap -build -doc (-fixed-point) -gcj -gtk (-hardened) (-libffi) (-libssp) -lto (-multilib) -multislot -nocxx -nopie -nossp -objc -objc++ -objc-gc -test (-vanilla)" 0 kB

Total: 1 package (1 in new slot), Size of downloads: 0 kB
Comment 39 Alexey Shvetsov archtester gentoo-dev 2011-12-14 23:51:04 UTC
also it builds fine with -fortran (both 4.5 and 4.6)
Comment 40 Benda Xu gentoo-dev 2011-12-15 02:10:47 UTC
(In reply to comment #35)
> As I said in IRC, you shouldn't have USE=bootsrap after a --sync. Don't re-open
> this bug, please. If you feel like you need to, then reproduce with non-masked
> ebuilds. Comment #32 stands.

Bad news, vapier has removed GENTOO_PATCH_EXCLUDE from toolchain.eclass. cf 

    http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/toolchain.eclass?r1=1.488&r2=1.489

Toolchain experts, we were relying on GENTOO_PATCH_EXCLUDE to disable default fortify on hosts with old glibc. What would you suggest to handle this dry situation in prefix?
Comment 41 SpanKY gentoo-dev 2011-12-15 04:08:58 UTC
use EPATCH_EXCLUDE in profile.bashrc
Comment 42 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-12-15 04:43:45 UTC
(In reply to comment #40)

> Bad news, vapier has removed GENTOO_PATCH_EXCLUDE from toolchain.eclass. cf 

Sigh. I'll test and fix tomorrow.

I owe you an apology Alexey. Please accept this.
Comment 43 Benda Xu gentoo-dev 2011-12-15 05:11:38 UTC
EPATCH_EXCLUDE tested to work on RHEL 5.6.

to darkside: another issue: for /lib/libc.so.6 | head -n1 | grep -o "version [0-9]\.[0-9]", it will extract "version 2.12" as "version 2.1" shouldn't it be /lib/libc.so.6 | head -n1 | grep -o "version [0-9]\.[0-9]\+" ?

another ugly thing is that, on debian hosts, libc.so.6 is at /lib/i386-linux-gnu/libc.so.6..., we may try to locate libc.so.6 or use "ldd --version" like 

ldd --version | head -n1 | grep -o ') [0-9].[0-9]\+' | cut -d. -f2

or use (yeah, it's worse)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <stdio.h>
#include <gnu/libc-version.h>
int main (void) { puts (gnu_get_libc_version ()); return 0; }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comment 44 Alexey Shvetsov archtester gentoo-dev 2011-12-15 09:23:40 UTC
he he =) seems like i found root of problems =D


patch now called

10_all_default-fortify-source.patch

while in portage.bashrc it called

10_all_gcc-default-fortify-source.patch
Comment 45 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-12-15 18:38:38 UTC
(In reply to comment #32)
> I hope this is adequately worked around now and we can put it to rest.
> RESOLVED:WORKAROUND

+  15 Dec 2011; Jeremy Olexa <darkside@gentoo.org> linux/profile.bashrc:
+  Fix bug 289757 (again). Use ldd, use EPATCH_EXCLUDE, match new patch name as
+  well

Thanks Benda and Alexey
Comment 46 Chetan Reddy 2011-12-20 18:50:57 UTC
I can't quite find this in git, but my latest sync (from an hour back) has this in prefix/linux/profile.bashrc


VERS=$(/usr/bin/ldd --version | head -n1 | grep -o "version [0-9]\.[0-9]\+" | cut -d. -f2 )                                                     


I think that was supposed to be 

VERS=$(/usr/bin/ldd --version | head -n1 | grep -o ') [0-9].[0-9]\+' | cut -d. -f2)


Sorry if it's already fixed in git but not released yet. If so, can someone please point me to gitweb or viewcvs  where i can look at the latest tree?
Comment 47 Benda Xu gentoo-dev 2011-12-21 04:17:03 UTC
(In reply to comment #46)
> 
> VERS=$(/usr/bin/ldd --version | head -n1 | grep -o ') [0-9].[0-9]\+' | cut -d.
> -f2)
> 
> 
> Sorry if it's already fixed in git but not released yet. If so, can someone
> please point me to gitweb or viewcvs  where i can look at the latest tree?

applied. Thanks for reporting. should hit prefix mirror soon (~1 day)

it is in gentoo-x86 tree being whitelisted:

http://overlays.gentoo.org/proj/alt/browser/trunk/prefix-overlay/whitelist.txt

you can find it here:

http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/profiles/prefix/linux/
Comment 48 Fabian Groffen gentoo-dev 2011-12-21 08:14:27 UTC
@heroxbd: I think you forgot to update the ChangeLog in profiles/prefix for this change.