Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 586208 - sys-libs/libunwind-1.2 with CCACHE: libunwind-dwarf-local.a(Lstep.o): multiple definition of '_ULx86_64_step'
Summary: sys-libs/libunwind-1.2 with CCACHE: libunwind-dwarf-local.a(Lstep.o): multipl...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-17 15:45 UTC by Matt Whitlock
Modified: 2017-10-04 09:32 UTC (History)
0 users

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


Attachments
build.log (build.log,94.53 KB, text/plain)
2016-06-17 15:45 UTC, Matt Whitlock
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Whitlock 2016-06-17 15:45:48 UTC
Created attachment 437868 [details]
build.log

sys-libs/libunwind-1.1, -1.1-r1, and -1.2_rc1 all fail to build with the following error:

/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: ./.libs/libunwind-dwarf-local.a(Lstep.o): multiple definition of '_ULx86_64_step'
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: x86_64/.libs/Lstep.o: previous definition here
collect2: error: ld returned 1 exit status


# emerge --info '=sys-libs/libunwind-1.1-r1::gentoo'
Portage 2.3.0_rc1 (python 2.7.11-final-0, default/linux/amd64/13.0/desktop/plasma, gcc-5.4.0, glibc-2.23-r2, 4.6.1-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.6.1-gentoo-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q6600_@_2.40GHz-with-gentoo-2.2
KiB Mem:     8166136 total,    243816 free
KiB Swap:    8388604 total,   4445168 free
Timestamp of repository gentoo: Fri, 17 Jun 2016 14:00:01 +0000
sh dash 0.5.8.2
ld GNU gold (Gentoo 2.25.1 p1.1 2.25.1) 1.11
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
ccache version 3.2.5 [enabled]
app-shells/bash:          4.3_p42-r2::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.0-r1::gentoo
dev-lang/python:          2.7.11-r2::gentoo, 3.4.4::gentoo
dev-util/ccache:          3.2.5::gentoo
dev-util/cmake:           3.5.2-r1::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.21::gentoo
sys-apps/sandbox:         2.10-r2::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r2::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            5.4.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.6::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r2::gentoo
Repositories:

local
    location: /usr/local/portage/overlay
    masters: gentoo
    priority: -2000

bitcoin
    location: /var/lib/layman/bitcoin
    sync-type: laymansync
    sync-uri: https://gitlab.com/bitcoin/gentoo.git
    masters: gentoo
    priority: -1500

fw-overlay
    location: /var/lib/layman/fw-overlay
    sync-type: laymansync
    sync-uri: https://github.com/no-hope/fw-overlay.git
    masters: gentoo
    priority: -1500

kde
    location: /var/lib/layman/kde
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/proj/kde.git
    masters: gentoo
    priority: -1500

vmware
    location: /var/lib/layman/vmware
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/vmware.git
    masters: gentoo
    priority: -1500

x11
    location: /var/lib/layman/x11
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/x11
    masters: gentoo
    priority: -1500

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

lbry
    location: /usr/local/portage/overlays/lbry
    sync-type: git
    sync-uri: https://github.com/lbryio/lbry-gentoo-overlay.git
    masters: gentoo

jmesmon
    location: /var/lib/layman/jmesmon
    sync-type: laymansync
    sync-uri: git://github.com/jmesmon/overlay.git
    masters: gentoo jmesmon
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O3 -ggdb -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/X11/xkb /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0 /var/yp/Makefile"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dbus-1 /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/apache2-php7.0/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cgi-php7.0/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/php/cli-php7.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O3 -ggdb -pipe"
DISTDIR="/usr/local/portage/distfiles"
EMERGE_DEFAULT_OPTS="--nospinner --unordered-display --usepkg"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs ccache compressdebug 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 usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.leaseweb.com/gentoo/ http://mirrors.rit.edu/gentoo/ http://mirror.lug.udel.edu/pub/gentoo/ http://gentoo.mirrors.pair.com/ http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O2 -Wl,--as-needed"
MAKEOPTS="-j5 -l8"
PKGDIR="/usr/local/portage/packages"
PORTAGE_COMPRESS="xz"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acpi alsa amd64 berkdb branding bzip2 cairo cdda cdparanoia cdr cli consolekit cracklib crypt cups curl cxx dbus declarative dri dts dvd dvdr emboss encode exif fam ffmpeg firefox flac fontconfig gdbm gif git glamor gmp gstreamer gtk iconv icu ipv6 java jpeg kde kipi lame lcms libnotify libsamplerate lzma mad matroska mmx mmxext mng modules mp3 mp4 mpeg multilib mysql ncurses nptl nsplugin ogg opengl openmp pango pcre pdf phonon php plasma png policykit ppds qml qt3support qt4 qt5 quicktime readline sdl seccomp session smp spell sse sse2 ssl startup-notification subversion svg taglib tcmalloc theora threads tiff truetype udev udisks unicode upower usb v4l vaapi vdpau vnc vorbis vpx webkit widgets x264 xcb xcomposite xml xscreensaver xv xvid xvmc yahoo zlib" ABI_X86="64" ALSA_CARDS="hda-intel" 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 author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 ssse3" 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 ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_US en" LIRC_DEVICES="mceusb" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" QEMU_SOFTMMU_TARGETS="arm" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="amdgpu radeon radeonsi" 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:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 SpanKY gentoo-dev 2016-06-17 16:13:18 UTC
can you try w/out -ggdb ?
Comment 2 Matt Whitlock 2016-06-17 16:19:31 UTC
(In reply to SpanKY from comment #1)
> can you try w/out -ggdb ?

Same error without -ggdb.

I also tried with "-O1" instead of "-O3 -ggdb", and that still failed in the exact same way.

Isn't the link command line just wrong? It includes both Lstep.o and libunwind-dwarf-local.a, but the latter contains the former, so of course there will be multiple definitions.
Comment 3 Matt Whitlock 2017-02-15 16:33:44 UTC
I ran into this problem again in sys-libs/libunwind-1.2, so I set out to diagnose it.

As it turns out, the link command is not wrong: there are in fact two different Lstep.o objects, one compiled from src/x86_64/Lstep.c and one compiled from src/dwarf/Lstep.c. The problem was that these two source files are byte-for-byte identical, and ccache's "direct mode" apparently doesn't record the full paths of included local files, so despite that the two Gstep.c files included by the two Lstep.c files are different, ccache wasn't noticing this. The solution was to set CCACHE_NODIRECT=1 (via /etc/portage/package.env) for sys-libs/libunwind. Now it builds successfully. I'd suggest adding this environment variable to the ebuild to save other ccache users this headache.
Comment 4 Andreas K. Hüttel archtester gentoo-dev 2017-08-30 14:28:35 UTC
(In reply to Matt Whitlock from comment #3)
> I ran into this problem again in sys-libs/libunwind-1.2, so I set out to
> diagnose it.
> 
> As it turns out, the link command is not wrong: there are in fact two
> different Lstep.o objects, one compiled from src/x86_64/Lstep.c and one
> compiled from src/dwarf/Lstep.c. The problem was that these two source files
> are byte-for-byte identical, and ccache's "direct mode" apparently doesn't
> record the full paths of included local files, so despite that the two
> Gstep.c files included by the two Lstep.c files are different, ccache wasn't
> noticing this. The solution was to set CCACHE_NODIRECT=1 (via
> /etc/portage/package.env) for sys-libs/libunwind. Now it builds
> successfully. I'd suggest adding this environment variable to the ebuild to
> save other ccache users this headache.

That looks both harmless and useful. Added to 1.2 and 1.2.1.
Comment 5 Matt Whitlock 2017-09-12 09:09:04 UTC
(In reply to Andreas K. Hüttel from comment #4)
> That looks both harmless and useful. Added to 1.2 and 1.2.1.

Thanks for your effort, but your modification to the ebuild is ineffective. CCACHE_NODIRECT=1 needs to be exported to the environment in the src_compile phase.

multilib_src_compile() {
	# Bug 586208
	CCACHE_NODIRECT=1 default
}
Comment 6 Larry the Git Cow gentoo-dev 2017-10-04 09:32:06 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=acd563315f0606f21b3453d9449c2be756edcf28

commit acd563315f0606f21b3453d9449c2be756edcf28
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: 2017-10-04 09:30:50 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: 2017-10-04 09:31:14 +0000

    sys-libs/libunwind: Fix bug 586208 properly this time
    
    Closes: https://bugs.gentoo.org/586208
    Package-Manager: Portage-2.3.11, Repoman-2.3.3

 sys-libs/libunwind/libunwind-1.2.1.ebuild | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)