Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 497976 - sys-devel/binutils-2.24: LDFLAGS="-Wl,--as-needed" breaks >=sys-libs/db-5.0.32 ("undefined reference" to dlopen calls dl{sym,error,open,close})
Summary: sys-devel/binutils-2.24: LDFLAGS="-Wl,--as-needed" breaks >=sys-libs/db-5.0.3...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://sourceware.org/git/gitweb.cgi...
Whiteboard:
Keywords:
: 462494 (view as bug list)
Depends on:
Blocks: 497850
  Show dependency tree
 
Reported: 2014-01-13 09:52 UTC by Lars Wendler (Polynomial-C) (RETIRED)
Modified: 2014-01-28 08:09 UTC (History)
2 users (show)

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


Attachments
build.log file of db-5.3.21 (build.log,457.18 KB, text/plain)
2014-01-13 09:52 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-01-13 09:52:39 UTC
Created attachment 367772 [details]
build.log file of db-5.3.21

I stubled upon these when I treid to bump db-5.3.28 (bug #488488).

I tested the following version:

4.8.30: succeeds
5.0.32: fails
5.1.29: fails
5.2.42: fails
5.3.21: fails (as does 5.3.28)
6.0.21-r1: fails


Error message:

libtool: link: x86_64-pc-linux-gnu-gcc -march=corei7 -mtune=corei7 -O2 -pipe -fomit-frame-pointer -finline-functions -o .libs/dbsql -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -Wl,--default-symver .libs/shell.o  -Wl,--as-needed ./.libs/libdb_sql-5.3.so -ldl -lpthread 
./.libs/libdb_sql-5.3.so: undefined reference to `dlsym'
./.libs/libdb_sql-5.3.so: undefined reference to `dlerror'
./.libs/libdb_sql-5.3.so: undefined reference to `dlopen'
./.libs/libdb_sql-5.3.so: undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
Makefile:899: recipe for target 'dbsql' failed
make: *** [dbsql] Error 1
emake failed
 * ERROR: sys-libs/db-5.3.21::gentoo failed (compile phase):
 *   make failed


# emerge --info db
Portage 2.2.8 (default/linux/amd64/13.0/desktop/kde, gcc-4.8.2, glibc-2.17, 3.10.26 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.10.26-x86_64-Intel-R-_Core-TM-_i7-2600_CPU_@_3.40GHz-with-gentoo-2.2
KiB Mem:    16458876 total,    495952 free
KiB Swap:    2097148 total,   2097148 free
Timestamp of tree: Mon, 13 Jan 2014 07:00:01 +0000
ld GNU ld (GNU Binutils) 2.24
app-shells/bash:          4.2_p45-r1
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.6, 3.2.5-r3, 3.3.3
dev-util/cmake:           2.8.12.1-r3
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.13.4, 1.14.1
sys-devel/binutils:       2.24-r1
sys-devel/gcc:            4.8.2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo poly-c
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA AdobeFlash-11.x dlj-1.1 PUEL RTCW RTCW-ETEULA googleearth Oracle-BCLA-JavaSE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=corei7 -mtune=corei7 -O2 -pipe -fomit-frame-pointer -finline-functions"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-3.0"
CONFIG_PROTECT_MASK="/etc/X11/Sessions /etc/X11/app-defaults /etc/X11/xinit /etc/adobe /etc/bash_completion.d /etc/bonobo-activation /etc/ca-certificates.conf /etc/cups /etc/dbus-1 /etc/env.d /etc/eselect/compiler /etc/fish /etc/fonts /etc/fonts/fonts.conf /etc/foomatic /etc/gconf /etc/gentoo-release /etc/gimp /etc/gnome-vfs-2.0 /etc/gtk /etc/gtk-2.0 /etc/hotplug /etc/hotplug.d /etc/htdig /etc/imlib /etc/init.d /etc/iproute2 /etc/libgda-3.0 /etc/ntop /etc/pam.d /etc/pango /etc/profile.d /etc/qt4 /etc/revdep-rebuild /etc/sandbox.d /etc/sasl2 /etc/sgml /etc/sound /etc/ssl /etc/ssmtp /etc/t1lib /etc/terminfo /etc/usb_modeswitch.d /etc/xinetd.d /etc/xml /etc/zsh"
CXXFLAGS="-march=corei7 -mtune=corei7 -O2 -pipe -fomit-frame-pointer -finline-functions"
DISTDIR="/var/tmp/distfiles"
EMERGE_DEFAULT_OPTS="--alphabetical --with-bdeps=y --jobs=1 --keep-going --misspell-suggestions=n --autounmask=n --quiet-build=n --verbose-slot-rebuilds=n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
INSTALL_MASK="/lib/systemd /lib32/systemd /lib64/systemd /usr/lib/systemd /usr/lib32/systemd /usr/lib64/systemd"
LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -Wl,--as-needed"
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
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"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/poly-c"
USE="3dnow 3dnowext X a52 aac acl acpi alsa amd64 berkdb branding bzip2 cairo caps cdda cdparanoia cdr cli cracklib crypt cups cxx dbus declarative dts dvd dvdr dvdread emboss encode exif fam ffmpeg flac gdbm gif gmp gnutls gpg gtk iconv icu idn imagemagick imlib inotify jpeg jpeg2k kde kdehiddenvisibility kipi lame lcms libnotify lzma mad matroska mjpeg mmx mmxext mng modules mp3 mp4 mpeg mtp mudflap multilib ncurses nls nptl nsplugin ogg opengl openmp opus pam pango pcre pdf plasma png ppds projectm qt3support qt4 quicktime readline rtmp sdl session silc slang smp speex spell sse sse2 ssl startup-notification svg theora threads tiff truetype twolame udev unicode upower usb vcd vorbis vpx wxwidgets x264 xattr xcb xcomposite xinerama xml xscreensaver xulrunner xv xvid xvmc zlib zsh-completion" ABI_X86="64" ALSA_CARDS="hda-intel" 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" 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 joystick" KERNEL="linux" LIBREOFFICE_EXTENSIONS="pdfimport presenter-console presenter-minimizer" LINGUAS="de en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2 python3_3" RUBY_TARGETS="ruby21" SANE_BACKENDS="xerox_mfp" USERLAND="GNU" VIDEO_CARDS="radeon" 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, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON

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

sys-libs/db-6.0.20-r1 was built with the following:
USE="cxx -doc -examples -java -tcl -test"
LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -Wl,--as-needed -Wl,--default-symver"
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-01-13 10:26:53 UTC
This seems to be a problem with sys-devel/binutils-2.24 and --as-needed LDFLAG. Downgrading to binutils-2.23.2 makes the problem disappear.
CCing toolchain herd.
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-01-13 12:52:08 UTC
binutils upstream fixed this already (see URL). I've applied the patch locally and after that I go no more errors.
Comment 3 SpanKY gentoo-dev 2014-01-19 04:47:06 UTC
should be all set now in the tree; thanks for the report!

Commit message: Add fix from upstream for --as-needed handling
http://sources.gentoo.org/gentoo/src/patchsets/binutils/2.24/24_all_as-needed.patch?rev=1.1
http://sources.gentoo.org/sys-devel/binutils/binutils-2.24-r2.ebuild?rev=1.1
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2014-01-28 08:09:05 UTC
*** Bug 462494 has been marked as a duplicate of this bug. ***