Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 502952 - sys-fs/udev-210 fails to link with GCC 4.9
Summary: sys-fs/udev-210 fails to link with GCC 4.9
Status: RESOLVED DUPLICATE of bug 494228
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL: http://cgit.freedesktop.org/systemd/s...
Whiteboard:
Keywords:
Depends on: 494228
Blocks:
  Show dependency tree
 
Reported: 2014-02-27 08:19 UTC by Ryan Hill (RETIRED)
Modified: 2014-06-20 10:40 UTC (History)
2 users (show)

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


Attachments
udev-210-gcc-49.log (udev-210-gcc-49.log,704.82 KB, text/plain)
2014-02-27 08:19 UTC, Ryan Hill (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Hill (RETIRED) gentoo-dev 2014-02-27 08:19:41 UTC
Created attachment 371372 [details]
udev-210-gcc-49.log

Could be a toolchain issue, I haven't had time to investigate.  Just filing it here in case you see some mention upstream.

/bin/sh ./libtool  --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc -std=gnu99 -pipe -Wall -Wextra -Wno-inline -Wundef -Wformat=2 -Wformat-security -Wformat-nonliteral -Wlogical-op -Wsign-compare -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Wno-long-long -Wno-overlength-strings -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Werror=overflow -Wdate-time -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fdiagnostics-color -fno-strict-aliasing -fvisibility=hidden -ffunction-sections -fdata-sections -fstack-protector --param=ssp-buffer-size=4 -flto  -fvisibility=default -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -O2 -march=native -pipe -Wl,--as-needed -Wl,--no-undefined -Wl,--gc-sections -Wl,-z,relro -Wl,-z,now -Wl,-fuse-ld=gold  -version-info 2:0:2 -export-dynamic -no-undefined -export-symbols-regex '^g_udev_.*' -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -o libgudev-1.0.la -rpath /usr/lib64 src/gudev/libgudev_1_0_la-gudevclient.lo src/gudev/libgudev_1_0_la-gudevdevice.lo src/gudev/libgudev_1_0_la-gudevenumerator.lo src/gudev/libgudev_1_0_la-gudevmarshal.lo src/gudev/libgudev_1_0_la-gudevenumtypes.lo libudev.la -lgio-2.0 -lgobject-2.0 -lglib-2.0  -ldl 
libtool: link: /usr/bin/x86_64-pc-linux-gnu-nm -B  src/gudev/.libs/libgudev_1_0_la-gudevclient.o src/gudev/.libs/libgudev_1_0_la-gudevdevice.o src/gudev/.libs/libgudev_1_0_la-gudevenumerator.o src/gudev/.libs/libgudev_1_0_la-gudevmarshal.o src/gudev/.libs/libgudev_1_0_la-gudevenumtypes.o   | sed -n -e 's/^.*[	 ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[	 ][	 ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d' | /bin/sed 's/.* //' | sort | uniq > .libs/libgudev-1.0.exp
libtool: link: /bin/grep -E -e "^g_udev_.*" ".libs/libgudev-1.0.exp" > ".libs/libgudev-1.0.expT"
libtool: link: mv -f ".libs/libgudev-1.0.expT" ".libs/libgudev-1.0.exp"
libtool: link: echo "{ global:" > .libs/libgudev-1.0.ver
libtool: link:  cat .libs/libgudev-1.0.exp | sed -e "s/\(.*\)/\1;/" >> .libs/libgudev-1.0.ver
libtool: link:  echo "local: *; };" >> .libs/libgudev-1.0.ver
libtool: link:  x86_64-pc-linux-gnu-gcc -shared  -fPIC -DPIC  src/gudev/.libs/libgudev_1_0_la-gudevclient.o src/gudev/.libs/libgudev_1_0_la-gudevdevice.o src/gudev/.libs/libgudev_1_0_la-gudevenumerator.o src/gudev/.libs/libgudev_1_0_la-gudevmarshal.o src/gudev/.libs/libgudev_1_0_la-gudevenumtypes.o   -Wl,-rpath -Wl,/var/tmp/portage/sys-fs/udev-210/work/systemd-210-amd64/.libs -Wl,--as-needed ./.libs/libudev.so -lrt -lgio-2.0 -lgobject-2.0 -lglib-2.0 -ldl  -flto -pthread -O2 -march=native -Wl,--no-undefined -Wl,--gc-sections -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,-fuse-ld=gold -Wl,--hash-style=gnu -Wl,-O1   -pthread -Wl,-soname -Wl,libgudev-1.0.so.0 -Wl,-version-script -Wl,.libs/libgudev-1.0.ver -o .libs/libgudev-1.0.so.0.2.0
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.0-pre9999/../../../../x86_64-pc-linux-gnu/bin/ld.gold: error: .libs/libgudev-1.0.ver:2:1: syntax error, unexpected LOCAL, expecting STRING or QUOTED_STRING or EXTERN
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.0-pre9999/../../../../x86_64-pc-linux-gnu/bin/ld.gold: fatal error: unable to parse version script file .libs/libgudev-1.0.ver
collect2: error: ld returned 1 exit status
Makefile:7449: recipe for target 'libgudev-1.0.la' failed


dirtyepic@caribou ~ $ emerge --info
Portage 2.2.8-r1 (default/linux/amd64/13.0/developer, gcc-4.9.0-pre9999, glibc-2.19, 3.13.2-gentoo x86_64)
=================================================================
System uname: Linux-3.13.2-gentoo-x86_64-Intel-R-_Core-TM-_i7-3920XM_CPU_@_2.90GHz-with-gentoo-2.2
KiB Mem:    32597268 total,   1662872 free
KiB Swap:    1048572 total,    836484 free
Timestamp of tree: Wed, 26 Feb 2014 04:30:01 +0000
ld GNU ld (GNU Binutils) 2.24
ccache version 3.1.9 [enabled]
app-shells/bash:          4.2_p45-r1
dev-java/java-config:     2.2.0
dev-lang/python:          2.6.9, 2.7.6, 3.2.5-r3, 3.3.4
dev-util/ccache:          3.1.9-r3
dev-util/cmake:           2.8.12.2
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-r2
sys-devel/gcc:            3.3.6-r1, 3.4.6-r2, 4.1.2, 4.2.4-r1, 4.3.6-r1, 4.4.7, 4.5.4, 4.6.4, 4.7.3-r1, 4.7.4_pre9999::toolchain, 4.8.2-r1, 4.8.3_pre9999::toolchain, 4.9.0_pre9999::toolchain
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.13 (virtual/os-headers)
sys-libs/glibc:           2.19
Repositories: gentoo kde crossdev local gcc-porting toolchain dirtyepic
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
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/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y --quiet-build=n"
FCFLAGS="-O2 -march=native -pipe"
FEATURES="assume-digests binpkg-logs ccache cgroup clean-logs compressdebug distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms sign split-log splitdebug strict test test-fail-continue unknown-features-warn unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -march=native -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org/"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
LDFLAGS="-Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j12 V=1"
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/kde /home/dirtyepic/crossdev /home/dirtyepic/overlay /home/dirtyepic/svn/gcc-porting /home/dirtyepic/svn/toolchain /home/dirtyepic/svn/dirtyepic"
USE="X a52 aac accessibility acpi alsa amd64 ao archive avahi avx bash-completion berkdb bzip2 c++0x cairo caps cdda cdr clang cli clucene consolekit cracklib crypt cscope custom-cflags custom-cpuopts custom-optimization cvs cxx dbus dri dts dvd dvdr egl emboss encode exif fam ffmpeg firefox flac fontconfig gbm gif gles gles1 gles2 gmp gold graphite gstreamer gtk gtkstyle hdaps iconv icu infinality inotify jpeg lastfm libcanberra libffi libkms libnotify llvm lto lzma mad mdnsresponder-compat mmap mmx mmxext modules moodbar mp3 mp4 mpeg multilib ncurses network nntp nptl nsplugin ogg opengl openmp optimized-qmake osmesa pam pcre pdf png policykit postproc ppds qt3support qt4 rar readline rtc savedconfig sdl session smp snmp spell sse sse2 sse3 sse4 sse4_1 ssh ssl ssse3 startup-notification subversion svg system-cairo system-icu system-jpeg taglib theora threads thumbnail tiff track-src-odirect truetype tsmuxer twolame udev udis86 udisks unicode upnp upower urandom usb vaapi vdpau vim vim-syntax vorbis vpx wifi wxwidgets x264 xa xattr xcb xft xkb xml xv xvfb xvid xvmc 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" 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 synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_CA en_US" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_6 python2_7 python3_2 python3_3" RUBY_TARGETS="ruby21" USERLAND="GNU" VIDEO_CARDS="nouveau" 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 3.2 3.3"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC


dirtyepic@caribou ~ $ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.0-pre9999/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.0-pre9999/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.9.0_pre9999/work/gcc-4.9.0-9999/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.0-pre9999 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.0-pre9999/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.0-pre9999 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.0-pre9999/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.0-pre9999/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.0-pre9999/include/g++-v4 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.9.0-pre9999/python --enable-languages=c,c++ --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --disable-nls --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.9.0_pre9999' --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj --enable-libgomp --disable-libmudflap --disable-libssp --disable-libquadmath --enable-lto --with-cloog --disable-isl-version-check
Thread model: posix
gcc version 4.9.0-pre9999 20140226 (experimental) commit 3c2e3ed6de5a1bd597c5a6e666013173aeb6ccab (Gentoo 4.9.0_pre9999)
Comment 1 Ryan Hill (RETIRED) gentoo-dev 2014-02-27 08:34:55 UTC
After:

libtool: link: /usr/bin/x86_64-pc-linux-gnu-nm -B  src/gudev/.libs
/libgudev_1_0_la-gudevclient.o src/gudev/.libs/libgudev_1_0_la-gudevdevice.o
 src/gudev/.libs/libgudev_1_0_la-gudevenumerator.o src/gudev/.libs
/libgudev_1_0_la-gudevmarshal.o src/gudev/.libs/libgudev_1_0_la-
gudevenumtypes.o   | sed -n -e 's/^.*[	 ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[
	 ][	 ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | 
sed '/ __gnu_lto/d' ...
                   ^ here

libgudev-1.0.exp is empty, so libgudev-1.0.ver ends up being:

  { global:
  local: *; };
Comment 2 Ryan Hill (RETIRED) gentoo-dev 2014-02-27 08:45:13 UTC
And this is because GCC now defaults to slim LTO objects which bare nm doesn't understand.  We need to use the linker plugins.
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2014-02-27 11:39:12 UTC
configure.ac is detecting if compiler supports lto or not, and adds -flto accordingly when supported, see:

https://bugs.gentoo.org/show_bug.cgi?id=502950#c9
https://bugs.gentoo.org/show_bug.cgi?id=502950#c10

so if I understand right, this bug wouldn't be happening if we stripped '-flto' out from the build?
i honestly don't know if we should or not, treat upstream adding -flto okay or not, like it's okay for upstream to test and add -Wl,--as-needed if they want
or treat it illegal like upstream adding eg. -O2 to CFLAGS
Comment 4 Ryan Hill (RETIRED) gentoo-dev 2014-02-28 02:13:38 UTC
I'll comment there, but I don't have a problem with packages using compiler features like this.  Just like some packages use potentially unsafe flags because they've been designed to work with them.

I don't think udev has to do anything here.  This should be handled by toolchain and we have time before 4.9 is out to figure out the proper way to do that.
Comment 5 Ryan Hill (RETIRED) gentoo-dev 2014-04-23 01:10:26 UTC

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