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

Bug 445132

Summary: sys-devel/gdb-7.5: build fails w/-ftracer on amd64: linux-x86-low.c:2939: Error: symbol 'start_i386_void_call_2_a' is already defined
Product: Gentoo Linux Reporter: Evan Teran <evan.teran>
Component: [OLD] Core systemAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED DUPLICATE    
Severity: minor CC: jer
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build log

Description Evan Teran 2012-11-28 23:52:39 UTC
it seems that sys-devel/gdb-7.5 just went stable, unfortunately it fails to build for me. It errors out with lots of errors regarding symbols already being defined. I will attach a build log shortly.

Reproducible: Always

Steps to Reproduce:
emerge -au gdb
Actual Results:  
 * ERROR: sys-devel/gdb-7.5 failed (compile phase):
 *   emake failed
 * 
 * Call stack:
 *          ebuild.sh, line   93:  Called src_compile
 *        environment, line 2386:  Called __eapi2_src_compile
 *   phase-helpers.sh, line  612:  Called die
 * The specific snippet of code:
 *              emake || die "emake failed"
 * 
 * If you need support, post the output of `emerge --info '=sys-devel/gdb-7.5'`,
 * the complete build log and the output of `emerge -pqv '=sys-devel/gdb-7.5'`.
 * The complete build log is located at '/var/tmp/portage/sys-devel/gdb-7.5/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/gdb-7.5/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-devel/gdb-7.5/work/gdb-7.5'
 * S: '/var/tmp/portage/sys-devel/gdb-7.5/work/gdb-7.5'



$ emerge --info
Portage 2.2.0_alpha142 (default/linux/amd64/10.0, gcc-4.5.4, glibc-2.15-r3, 3.6.8-gentoo x86_64)
=================================================================
System uname: Linux-3.6.8-gentoo-x86_64-Intel-R-_Core-TM-_i7_CPU_M_640_@_2.80GHz-with-gentoo-2.1
Timestamp of tree: Wed, 28 Nov 2012 23:00:01 +0000
ld GNU ld (GNU Binutils) 2.22
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.6.8, 2.7.3-r2, 3.2.3
dev-util/cmake:           2.8.9
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.11.5
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.4, 4.6.3, 4.7.2
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo codef00-com
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -fomit-frame-pointer -finline-functions -ftracer -pipe -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -fomit-frame-pointer -finline-functions -ftracer -pipe -ggdb"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_US en_US.UTF-8"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="64bit X acl acpi aio alsa amd64 android apache2 apng aspell bash-completion berkdb bluetooth boost bzip2 c++0x cairo cddb cdr cli clucene cmake consolekit cracklib crypt css cups curl cxx dbus debugger declarative dell development device-mapper dri dts dvd dvdr encode extra extras fastcgi ffmpeg flac fontconfig fortran gcj gd gdbm gif git google gpm grammar graphite graphviz gtk gudev hfs hwdb iconv icu innodb inotify ioctl ipv6 java java6 jpeg json kde kpathsea kqemu kvm lame laptop latex ldap libnotify lto matroska minizip mmx mng modules mono mp3 mpeg mpi mplayer mudflap multilib mysql mysqli ncurses nls nptl nsplugin nvidia oauth ogg openal opengl openmp openrc openssl openxml ovftool pam pcre pdf pdfimport pdo perl plasma png policykit pppd private-headers python qmake qt3support qt4 qtscript rdoc readline romio rss samba script sdl semantic-desktop session simplexml soap sockets sql sqlite sqlite3 sse sse2 sse3 sse4 sse4_1 sse4a ssl ssse3 static-analyzer subversion svg tcpd teamarena theora threads thumbnail tidy tiff tools truetype udisks unicode usb valgrind virtuoso vmware-tools vorbis webgl webkit wicd wifi wxwidgets x264 x86-64 xcomposite xine xinerama xml xscreensaver xsl xvid zeroconf 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="authn_core authz_core socache_shmcb unixd 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 sheets 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 synaptics evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_US en_US.UTF-8" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby19" USERLAND="GNU" VIDEO_CARDS="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"
USE_PYTHON="2.6 2.7"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Evan Teran 2012-11-28 23:53:07 UTC
Created attachment 330870 [details]
build log
Comment 2 Rafał Mużyło 2012-11-29 00:00:02 UTC
Drop the whole '-fomit-frame-pointer -finline-functions -ftracer' string from your C{,XX}FLAGS and try again.
Comment 3 Evan Teran 2012-11-29 03:34:59 UTC
That worked, perhaps the ebuild should filter out these flags if they break the build? I've always considered -fomit-frame-pointer -finline-functions to be pretty tame in general, and -ftracer is a recent addition to my flags which doesn't sound like it should break things.
Comment 4 SpanKY gentoo-dev 2012-11-29 04:53:37 UTC
what flag exactly is causing it to break ?
Comment 5 Evan Teran 2012-11-29 05:50:35 UTC
looks like -ftracer, when I take that out, it builds fine.
Comment 6 Rafał Mużyło 2012-11-29 15:17:59 UTC
Correct me, if I'm wrong, but isn't '-fomit-frame-pointer' a bit pointless on amd64 ?
That flag was needed sometimes on x86, due to register pressure in some of the packages, but shouldn't any performance gain from it be negligible on amd64 ?
Comment 7 SpanKY gentoo-dev 2012-11-29 18:39:14 UTC
(In reply to comment #5)

need to sort out whether it's a gcc bug or expected behavior.  doubtful it is a bug in gdb (although not impossible).

(In reply to comment #6)

yes, it is pointless with any -O level on x86_64.  even on x86, starting with gcc-4.6, it is also enabled by default.
Comment 8 Evan Teran 2012-11-29 18:54:11 UTC
Regarding #6, while it's a little off topic I'll respond :-).

Yes, starting with gcc 4.6 the frame pointer is omitted anyway, but I'm not using 4.6 or greater as my system compiler yet, so we'll assume that there would be a frame pointer were it not for that flag (for now).

It certainly it has a far lesser effect on x86_64, but I wouldn't go so far as to say that it's pointless. An extra register available for general usage can really only improve the emitted code or at worst be equal in performance, I can't imagine a scenario where it would make things worse.

In addition, there is the *very minor* frame pointer maintenance code which no longer needs to exist, namely.

  push rbp
  mov rbp, rsp
  ...
  mov rsp, rbp
  pop rbp
  ret

I highly doubt that these 4 instructions have any really measurable effect on performance, but it's one less thing each function has to do, once again, can't makes things worse.

All in all, considering that the GNU folks thought it was a good enough idea to enable by default in future versions of gcc, I consider it good enough for me :-). It's certainly never caused me any problems.

In the end it's a matter of preference of course.
Comment 9 SpanKY gentoo-dev 2012-11-29 19:14:42 UTC
(In reply to comment #8)

the change in defaults with 4.6 affect x86 (32bit) only.  x86_64 has long had this behavior by default.

further, your logic is slightly flawed.  "good enough for upstream 4.6" doesn't mean they suddenly changed their mind and so it is retroactively a good idea.  improvements in the generation of code/debug information and register allocation is a much more likely reason as to why the default has changed.  those improvements don't exist in older versions.
Comment 10 Evan Teran 2012-11-29 19:36:23 UTC
(In reply to comment #9)

Fair enough, I wasn't aware that the change in default was 32-bit only.

While your right that whatever improvements triggered the change in default don't suddenly improve the older versions of the compiler, it wasn't my intention to imply that. Regardless, you still make a valid point there, 4.5 probably doesn't do as good a job managing registers as 4.6+ does.

But since x86_64 has this enable by default, it's kinda a moot point, frame pointers are disabled either way ;-).
Comment 11 Nick Wallingford 2013-08-11 18:41:03 UTC
I suspect this is a duplicate of 376455. The problem is the combination of both -finline-functions and -ftracer. If you remove either -ftracer or -finline-functions the problem does not arise.

https://bugs.gentoo.org/show_bug.cgi?id=376455
Comment 12 Ryan Hill (RETIRED) gentoo-dev 2013-08-12 16:51:03 UTC

*** This bug has been marked as a duplicate of bug 376455 ***