Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 337788 - sys-devel/gcc does not respect LDFLAGS
Summary: sys-devel/gcc does not respect LDFLAGS
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High QA (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 450890 486256 (view as bug list)
Depends on:
Blocks: 454426
  Show dependency tree
 
Reported: 2010-09-17 11:32 UTC by David J Cozatt
Modified: 2014-07-11 06:11 UTC (History)
6 users (show)

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


Attachments
build.log (sys-devel:gcc-4.4.4-r1:20100916-224137.log,84.55 KB, text/plain)
2010-09-17 11:37 UTC, David J Cozatt
Details
bzip2 of build.log (sys-devel:gcc-4.4.4-r2:20100916-210633.log.bz2,199.47 KB, text/plain)
2010-09-22 00:49 UTC, David J Cozatt
Details
toolchain.eclass.ldflags.diff (toolchain.eclass.ldflags.diff,2.09 KB, patch)
2011-01-12 19:39 UTC, Ryan Hill (RETIRED)
Details | Diff
toolchain.eclass.ldflags.diff (toolchain.eclass.ldflags.diff,3.42 KB, patch)
2013-05-08 00:55 UTC, Ryan Hill (RETIRED)
Details | Diff
toolchain.eclass.ldflags.diff (toolchain.eclass.ldflags.diff,5.19 KB, patch)
2013-08-16 05:27 UTC, Ryan Hill (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David J Cozatt 2010-09-17 11:32:33 UTC
"I tell ya I can't get no respect"

QA: other                                                                     │
│^[[31;01mQA Notice: Files built without respecting LDFLAGS have been          │
│detected^[[0m                                                                 │
│ Please include the following list of files in your report:                   │
│/usr/libexec/gcc/x86_64-pc-linux-gnu/4.4.4/cc1  
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.4.4/f951                               │
│/usr/libexec/gcc/x86_64-pc-linux-gnu/4.4.4/collect2                           │
│/usr/libexec/gcc/x86_64-pc-linux-gnu/4.4.4/cc1plus                            │
│/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.4/x86_64-pc-linux-gnu-cpp                │
│/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.4/gcov                                   │
│/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.4/protoize                               │
│/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.4/x86_64-pc-linux-gnu-gfortran           │
│/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.4/x86_64-pc-linux-gnu-g++  
/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.4/x86_64-pc-linux-gnu-gcc                │
│/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.4/x86_64-pc-linux-gnu-c++                │
│/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.4/unprotoize                             │
│/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/libmudflapth.so.0.0.0                  │
│/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/libmudflap.so.0.0.0                    │
│/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/libgcc_s.so.1                          │
│/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/32/libmudflapth.so.0.0.0               │
│/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/32/libmudflap.so.0.0.0                 │
│                                                      
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/32/libgcc_s.so.1                       │
│/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/32/libstdc++.so.6.0.13                 │
│/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/32/libgfortran.so.3.0.0                │
│/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/32/libgomp.so.1.0.0                    │
│/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/libstdc++.so.6.0.13                    │
│/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/libgfortran.so.3.0.0                   │
│/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/libgomp.so.1.0.0                       │
│QA Notice: Package has poor programming practices which may compile 
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/32/libgcc_s.so.1                       │
│/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/32/libstdc++.so.6.0.13                 │
│/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/32/libgfortran.so.3.0.0                │
│/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/32/libgomp.so.1.0.0                    │
│/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/libstdc++.so.6.0.13                    │
│/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/libgfortran.so.3.0.0                   │
│/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/libgomp.so.1.0.0                       │
│QA Notice: Package has poor programming practices which may compile 
│           fine but exhibit random runtime failures.                          │
│/var/tmp/portage/sys-devel/gcc-4.4.4-r1/work/gcc-4.4.4/libgcc/../gcc/unwind-  │
│dw2-fde.c:321: warning: dereferencing type-punned pointer will break strict-  │
│aliasing rules                                                                │
│/var/tmp/portage/sys-devel/gcc-4.4.4-r1/work/gcc-4.4.4/libgcc/../gcc/unwind-  │

last line unwinding message many times. If I have it I'll post the build.log If not will post later compile again now.


Portage 2.1.9.7 (default/linux/amd64/10.0, gcc-4.4.4, glibc-2.12.1-r1, 2.6.35-gentoo-r6 x86_64)
=================================================================
System uname: Linux-2.6.35-gentoo-r6-x86_64-AMD_Athlon-tm-_64_Processor_3200+-with-gentoo-2.0.1
Timestamp of tree: Thu, 16 Sep 2010 21:00:22 +0000
app-shells/bash:     4.1_p7
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.5-r3, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.3
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.13, 2.67
sys-devel/automake:  1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.35 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/portage/ /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests buildpkg collision-protect distlocks fixlafiles fixpackages multilib-strict news parallel-fetch protect-owned sandbox sfperms strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.gtlib.gatech.edu/pub/gentoo/ ftp://gentoo.chem.wisc.edu/gentoo/ http://mirrors.163.com/gentoo/ ftp://mirror.bih.net.ba/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,--hash-style=gnu,-O1 -Wl,--as-needed"
LINGUAS="en_US"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="   "
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl alsa amd64 berkdb bzip2 cdr cli cracklib crypt cups cxx dri en fortran gdbm gpm gtk iconv ipv6 midi mmx modules mudflap multilib ncurses nls nptl nptlonly openmp pam pcre perl pic pppd python readline reflection session sse sse2 ssl sysfs tcpd threads 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 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" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nv nvidia vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


Reproducible: Always
Comment 1 David J Cozatt 2010-09-17 11:37:13 UTC
Created attachment 247728 [details]
build.log

not built with FEATURES="test" iirc
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2010-09-19 09:39:18 UTC
A great build log indeed :P.

Could you paste the 'package information' part of 'emerge --info gcc'?
Comment 3 David J Cozatt 2010-09-20 21:08:11 UTC
=================================================================
                        Package Settings
=================================================================

sys-devel/gcc-4.4.4-r2 was built with the following:
USE="fortran gtk mudflap (multilib) nls nptl openmp (-altivec) -bootstrap -build -doc (-fixed-point) -gcj -graphite (-hardened) (-libffi) -multislot (-n32) (-n64) -nocxx -nopie -nossp -objc -objc++ -objc-gc -test -vanilla"
Comment 4 David J Cozatt 2010-09-20 21:20:19 UTC
(In reply to comment #2)
> A great build log indeed :P.
> 
> Could you paste the 'package information' part of 'emerge --info gcc'?
> 

wrong log ;-( sorry but when I try to attach the right one it's too big 

david@random ~ $ ls -l /var/log/portage/sys-devel\:gcc-4.4.4-r2\:2010091*
-rw-rw---- 1 portage portage 9839557 Sep 16 18:41 /var/log/portage/sys-devel:gcc-4.4.4-r2:20100916-210633.log
-rw-rw---- 1 portage portage 9691633 Sep 19 15:48 /var/log/portage/sys-devel:gcc-4.4.4-r2:20100919-151146.log
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2010-09-21 18:22:02 UTC
(In reply to comment #4)
> wrong log ;-( sorry but when I try to attach the right one it's too big 

Nothing stops you from compressing it.
Comment 6 David J Cozatt 2010-09-22 00:49:51 UTC
Created attachment 248313 [details]
bzip2 of build.log 

There is a 1000kb limit for files the bzip2 file is 

ls -l sys-devel\:gcc-4.4.4-r2\:20100916-210633.log.bz2 
-rw-rw---- 1 portage portage 204258 Sep 16 18:41 sys-devel:gcc-4.4.4-r2:20100916-210633.log.bz2
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2010-09-22 07:12:43 UTC
Ok, I'm pretty sure I see your LDFLAGS passed to the linker there... did you have similar problems with other application lately? Please paste the output of:
\
$ readelf -d /usr/libexec/gcc/x86_64-pc-linux-gnu/4.4.4/cc1
Comment 8 Andreis Vinogradovs ( slepnoga ) 2010-09-22 14:15:33 UTC
confirm this bug
Comment 9 Andreis Vinogradovs ( slepnoga ) 2010-09-22 14:15:46 UTC
slep@mini ~ $ readelf -d /usr/libexec/gcc/x86_64-pc-linux-gnu/4.4.4/cc1

Dynamic section at offset 0x82ada8 contains 23 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libmpfr.so.4]
 0x0000000000000001 (NEEDED)             Shared library: [libgmp.so.10]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000000c (INIT)               0x403d70
 0x000000000000000d (FINI)               0xa06aa8
 0x0000000000000004 (HASH)               0x4002b0
 0x000000006ffffef5 (GNU_HASH)           0x400928
 0x0000000000000005 (STRTAB)             0x401f00
 0x0000000000000006 (SYMTAB)             0x400af0
 0x000000000000000a (STRSZ)              2269 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000015 (DEBUG)              0x0
 0x0000000000000003 (PLTGOT)             0xe2afe8
 0x0000000000000002 (PLTRELSZ)           4560 (bytes)
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000017 (JMPREL)             0x402ba0
 0x0000000000000007 (RELA)               0x4029f0
 0x0000000000000008 (RELASZ)             432 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000006ffffffe (VERNEED)            0x402990
 0x000000006fffffff (VERNEEDNUM)         1
 0x000000006ffffff0 (VERSYM)             0x4027de
 0x0000000000000000 (NULL)               0x0
Comment 10 Andreis Vinogradovs ( slepnoga ) 2010-09-22 14:16:19 UTC
slep@mini ~ $ emerge --info
Portage 2.2_rc85 (default/linux/amd64/10.0/desktop/kde, gcc-4.4.4, glibc-2.12.1-r1, 2.6.35-gentoo-r5-1.04 x86_64)
=================================================================
System uname: Linux-2.6.35-gentoo-r5-1.04-x86_64-Intel-R-_Atom-TM-_CPU_330_@_1.60GHz-with-gentoo-2.0.1
Timestamp of tree: Wed, 22 Sep 2010 03:15:01 +0000
app-shells/bash:     4.1_p7
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.5-r3, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.3
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.13, 2.67
sys-devel/automake:  1.6.3-r1, 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.35 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -fomit-frame-pointer -mfpmath=sse+387 -mpc80 -msse3"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=native -fomit-frame-pointer -mfpmath=sse+387 -mpc80 -msse3"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests buildpkg ccache distlocks fixlafiles fixpackages metadata-transfer news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch usersandbox usersync"
GENTOO_MIRRORS="http://gentoo.tups.lv/source "
LANG="ru_RU.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,--hash-style=gnu"
LINGUAS="ru"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_COMPRESS="lzma"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/kde /home/slep/rion /home/slep/slepnoga/portage /var/lib/layman/sunrise"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac aalib acl acpi akonadi alsa amd64 bash-completion berkdb bl bluetooth branding bzip2 cairo caps cdda cdio cdparanoia cdr cli clucene consolekit cracklib crypt cue cups cxx dbus dga djvu dri dts dvd dvdr emboss encode exif fam fbcon ffmpeg firefox flac fontconfig fortran ftp gdbm ggi gif gnutls gpm gstreamer hal handbook ical iconv icu idn imagemagick imlib inotify ipv6 jbig jpeg jpeg2k kde kerberos kvm ladspa lame lcms ldap libnotify libsamplerate lm_sensors log4j lzma lzo mad mikmod mmap mmx mmxext mng modplug modules mp3 mp4 mpeg mtp mudflap multilib multislot mysql ncurses nls nptl nptlonly nsplugin ogg opengl openmp optimized-qmake pam pango pch pcre pdf perl phonon pipe png pnm policykit ppds pppd python qt3support qt4 radio readline reflection rhelpatch rle samba sasl sdl semantic-desktop session sftp skype slp sms sndfile spell spice sql sqlite sse sse2 ssl ssse3 startup-notification strigi suexec svg symlink sysfs syslog taglib tcpd theora threads tiff truetype unicode usb vhosts vim-syntax vorbis wav wavpack webkit winetriks x264 xattr xcb xinetd xml xmlpatterns xorg xulrunner xv xvid xvmc zeroconf zip 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 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" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LINGUAS="ru" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 11 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2010-09-22 16:52:50 UTC
Ok, I see it now.. it seems that gcc compiles 'cc1' two times, not applying the flags the second time.
Comment 12 David J Cozatt 2010-10-06 21:59:22 UTC
referencing comment #11 would this apply across all gcc builds then?
Comment 13 Ryan Hill (RETIRED) gentoo-dev 2011-01-08 00:20:19 UTC
Yes, and it's simple to use user LDFLAGS here.  I don't know if we want to.

What I'd rather have is a var we can set to skip these warnings.
Comment 14 Ryan Hill (RETIRED) gentoo-dev 2011-01-12 19:39:05 UTC
Created attachment 259636 [details, diff]
toolchain.eclass.ldflags.diff

Purely theoretically, something like this would get us close.  The only remaining files on my system are

 * /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/32/libgcc_s.so.1
 * /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/libgcc_s.so.1

I am not planning on looking into the reason they're omitted.  I also haven't tested this with 2.* and 3.* or any languages past C and C++.

I'm not comfortable with someone being able to break their compiler with LDFLAGS.  Maybe I'm being overcautious, I just haven't looked at the implications in detail and would expect anyone making this change to have done so.
Comment 15 Rick Farina (Zero_Chaos) gentoo-dev 2012-08-02 21:54:57 UTC
> I'm not comfortable with someone being able to break their compiler with
> LDFLAGS.  Maybe I'm being overcautious, I just haven't looked at the
> implications in detail and would expect anyone making this change to have
> done so.

This is unacceptable:


 * QA Notice: Files built without respecting LDFLAGS have been detected
 *  Please include the following list of files in your report:
 * /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libgomp.so.1.0.0
 * /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libgcc_s.so.1
 * /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libmudflapth.so.0.0.0
 * /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libmudflap.so.0.0.0
 * /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/32/libgomp.so.1.0.0
 * /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/32/libgcc_s.so.1
 * /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/32/libmudflapth.so.0.0.0
 * /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/32/libmudflap.so.0.0.0
 * /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/32/libstdc++.so.6.0.14
 * /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6.0.14
 * /usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.3/collect2
 * /usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.3/cc1
 * /usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.3/lto-wrapper
 * /usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.3/cc1plus
 * /usr/x86_64-pc-linux-gnu/gcc-bin/4.5.3/x86_64-pc-linux-gnu-g++
 * /usr/x86_64-pc-linux-gnu/gcc-bin/4.5.3/x86_64-pc-linux-gnu-gcc
 * /usr/x86_64-pc-linux-gnu/gcc-bin/4.5.3/x86_64-pc-linux-gnu-gcov
 * /usr/x86_64-pc-linux-gnu/gcc-bin/4.5.3/x86_64-pc-linux-gnu-cpp
 * /usr/x86_64-pc-linux-gnu/gcc-bin/4.5.3/x86_64-pc-linux-gnu-c++

If you want to continue ignoring LDFLAGS it isn't my place to even attempt to make my case, however, not using QA_FLAGS_IGNORED in the ebuild will cause users to think you are so stupid you can't make gcc respect LDFLAGS... just my 0.02$
Comment 16 SpanKY gentoo-dev 2012-08-02 22:44:27 UTC
(In reply to comment #15)

take it down a notch or two
Comment 17 Rick Farina (Zero_Chaos) gentoo-dev 2012-08-02 23:14:32 UTC
(In reply to comment #16)
> (In reply to comment #15)
> 
> take it down a notch or two

I did not accuse anyone of anything. I said the build.log makes things appear to be accidently broken when it is clearly a conscious choice... I'm happy to QA fix this for all gcc versions in the tree if that makes my intentions more obvious but leaving it as is looks really bad.

I am here to help people not berate them, if you re-read what I wrote I tried to keep that fact obvious.
Comment 18 Ryan Hill (RETIRED) gentoo-dev 2012-08-03 06:20:12 UTC
(Comment #13)
> What I'd rather have is a var we can set to skip these warnings.


(In reply to comment #15)
> This is unacceptable:
> 
> 
>  * QA Notice: Files built without respecting LDFLAGS have been detected
>  *  Please include the following list of files in your report:
>  * /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libgomp.so.1.0.0
>  * /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libgcc_s.so.1
>  * /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libmudflapth.so.0.0.0
>  * /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libmudflap.so.0.0.0
>  * /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/32/libgomp.so.1.0.0
>  * /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/32/libgcc_s.so.1
>  * /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/32/libmudflapth.so.0.0.0
>  * /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/32/libmudflap.so.0.0.0
>  * /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/32/libstdc++.so.6.0.14
>  * /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6.0.14
>  * /usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.3/collect2
>  * /usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.3/cc1
>  * /usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.3/lto-wrapper
>  * /usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.3/cc1plus
>  * /usr/x86_64-pc-linux-gnu/gcc-bin/4.5.3/x86_64-pc-linux-gnu-g++
>  * /usr/x86_64-pc-linux-gnu/gcc-bin/4.5.3/x86_64-pc-linux-gnu-gcc
>  * /usr/x86_64-pc-linux-gnu/gcc-bin/4.5.3/x86_64-pc-linux-gnu-gcov
>  * /usr/x86_64-pc-linux-gnu/gcc-bin/4.5.3/x86_64-pc-linux-gnu-cpp
>  * /usr/x86_64-pc-linux-gnu/gcc-bin/4.5.3/x86_64-pc-linux-gnu-c++
> 
> If you want to continue ignoring LDFLAGS it isn't my place to even attempt
> to make my case, however, not using QA_FLAGS_IGNORED in the ebuild will

Guess what didn't exist yet when I wrote the first comment.


(In reply to comment #17)
> I am here to help people not berate them, if you re-read what I wrote I
> tried to keep that fact obvious.

If my first reaction to your message is GFY then you're doing it wrong. :p
Comment 19 Rick Farina (Zero_Chaos) gentoo-dev 2012-08-03 06:28:43 UTC
> If my first reaction to your message is GFY then you're doing it wrong. :p

I apologize for the confusion, as I said my intent was not to insult anyone but to point out that the current state makes us all look bad as our own QA is telling us we are doing it wrong but instead of fixing it we leave it for years.

While I personally prefer to respect LDFLAGS, any solution the toolchain team agrees on (that makes the warnings go away) will be accepted.  I offer my help in any way possible.
Comment 20 Ryan Hill (RETIRED) gentoo-dev 2012-08-04 06:22:07 UTC
Thank you.

Mike, what do you think about the patch I posted above for setting BOOT_LDFLAGS (for the stage 2 and 3 gcc build) and LDFLAGS_FOR_TARGET (for non-bootstrapped libs) versus setting QA_FLAGS_IGNORED.  I don't care either way.
Comment 21 SpanKY gentoo-dev 2013-01-08 14:30:30 UTC
*** Bug 450890 has been marked as a duplicate of this bug. ***
Comment 22 Ryan Hill (RETIRED) gentoo-dev 2013-05-08 00:55:39 UTC
Created attachment 347684 [details, diff]
toolchain.eclass.ldflags.diff

This should do the right thing from 3.4.6 up.  I tested bootstrap and "make all" builds but not cross compiling (I could use some volunteers here).  For bootstrapping we ignore flags for stage 1 like before, but later stages respect both CFLAGS and LDFLAGS now, as does building the target libs (think libgomp, libstdc++, etc).  For cross-compiling there is of course only the one stage so we respect user flags for it.  I wasn't sure if target libs should honour user flags for cross-compiling (do we want target libs built with host flags?) so I restricted it to bootstrapped builds.

libgcc_s.so.1 doesn't respect LDFLAGS at the moment but that's a one-line patch.

I noticed gcc_do_filter_flags() screws around with flags at the end too.  The comments in there are ancient and not really accurate.  That code should probably be merged into this (or this into that) but that's a cleanup for later.

What do you think sirs?
Comment 23 Ryan Hill (RETIRED) gentoo-dev 2013-08-16 05:27:34 UTC
Created attachment 356166 [details, diff]
toolchain.eclass.ldflags.diff
Comment 24 Ryan Hill (RETIRED) gentoo-dev 2013-09-28 02:03:28 UTC
*** Bug 486256 has been marked as a duplicate of this bug. ***
Comment 25 Matt Turner gentoo-dev 2013-11-03 23:38:01 UTC
(In reply to Ryan Hill from comment #23)
> Created attachment 356166 [details, diff] [details, diff]
> toolchain.eclass.ldflags.diff

Time to commit this?
Comment 26 Ryan Hill (RETIRED) gentoo-dev 2013-11-04 04:10:55 UTC
Waiting on alpha to test it.
Comment 27 Ryan Hill (RETIRED) gentoo-dev 2013-11-04 04:13:53 UTC
Specifically that 4.7 fails to build on alpha without it and passes with.
Comment 28 Matt Turner gentoo-dev 2013-11-04 04:59:25 UTC
Oh, let me know that next time. :)

I'll kick off some builds. Thanks, Ryan!
Comment 29 Ryan Hill (RETIRED) gentoo-dev 2014-07-11 06:11:34 UTC
We had to start filtering -frecord-gcc-switches due to bug #490738 so the QA part of this bug no longer applies and the alpha issues seem to have fixed themselves at some point.  If there are actual problems caused by not propagating CFLAGS/LDFLAGS to each stage of the build then please open a new bug.