Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 451110 - sys-apps/systemd-197 with >=glibc-2.16 + <gcc-4.6 - src/shared/util.h:136: undefined reference to `_Static_assert'
Summary: sys-apps/systemd-197 with >=glibc-2.16 + <gcc-4.6 - src/shared/util.h:136: un...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo systemd Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-10 00:53 UTC by Timothy Miller
Modified: 2015-02-17 10:27 UTC (History)
5 users (show)

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


Attachments
build log (build.log.txt,48.40 KB, text/plain)
2013-01-10 00:53 UTC, Timothy Miller
Details
environment (environment.txt,136.49 KB, text/plain)
2013-01-10 00:53 UTC, Timothy Miller
Details
build log of failed udev compilation (build.log,50.09 KB, text/plain)
2013-01-12 09:38 UTC, Richard Wiedenhöft
Details
environment (environment,139.20 KB, text/plain)
2013-01-12 09:39 UTC, Richard Wiedenhöft
Details
Diff of edited /usr/include/assert.h header file (assert.h.diff,338 bytes, text/plain)
2013-01-14 21:05 UTC, jeremy
Details
Successful udev build log after editing header file (udev-197-r2:20130114-200229.log,45.57 KB, text/plain)
2013-01-14 21:06 UTC, jeremy
Details
udev.patch (udev.patch,872 bytes, patch)
2013-01-15 00:50 UTC, William Hubbs
Details | Diff
udev.patch (udev.patch,863 bytes, text/x-diff)
2013-01-15 03:45 UTC, William Hubbs
Details
assert.h.patch (assert.patch,366 bytes, patch)
2013-01-15 16:18 UTC, jeremy
Details | Diff
glibc-2.16.0.ebuild.example (glibc-2.16.0.ebuild,7.69 KB, text/plain)
2013-01-15 16:19 UTC, jeremy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Miller 2013-01-10 00:53:03 UTC
Created attachment 335004 [details]
build log

CCLD     udevadm
./.libs/libudev-core.a(util.o): In function `safe_atolu':
/var/tmp/portage/sys-fs/udev-197/work/systemd-197/src/shared/util.h:136: undefined reference to `_Static_assert'
collect2: ld returned 1 exit status
make: *** [systemd-udevd] Error 1
make: *** Waiting for unfinished jobs....
./.libs/libudev-core.a(util.o): In function `safe_atolu':
/var/tmp/portage/sys-fs/udev-197/work/systemd-197/src/shared/util.h:136: undefined reference to `_Static_assert'
collect2: ld returned 1 exit status
make: *** [udevadm] Error 1
 * ERROR: sys-fs/udev-197 failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=sys-fs/udev-197'`,
 * the complete build log and the output of `emerge -pqv '=sys-fs/udev-197'`.
 * The complete build log is located at '/var/tmp/portage/sys-fs/udev-197/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-fs/udev-197/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-fs/udev-197/work/systemd-197'
 * S: '/var/tmp/portage/sys-fs/udev-197/work/systemd-197'
Comment 1 Timothy Miller 2013-01-10 00:53:51 UTC
Created attachment 335006 [details]
environment
Comment 2 Timothy Miller 2013-01-10 00:54:27 UTC
Portage 2.1.11.38 (default/linux/amd64/10.0, gcc-4.5.4, glibc-2.16.0, 3.7.1-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.7.1-gentoo-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9450_@_2.66GHz-with-gentoo-2.2
Timestamp of tree: Thu, 10 Jan 2013 00:30:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p42
dev-lang/python:          2.7.3-r3, 3.2.3-r2
dev-util/cmake:           2.8.10.2-r1
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.69
sys-devel/automake:       1.11.6, 1.12.6
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.5.4, 4.6.3
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.7 (virtual/os-headers)
sys-libs/glibc:           2.16.0
Repositories: gentoo
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=core2 -ggdb -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /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=core2 -ggdb -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=4"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="rsync://mirror.mcs.anl.gov/gentoo/ rsync://rsync.gtlib.gatech.edu/gentoo rsync://mirrors.rit.edu/gentoo/ http://gentoo.osuosl.org/ http://gentoo.netnitco.net http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ ftp://mirror.datapipe.net/gentoo ftp://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ http://gentoo.mirrors.easynews.com/linux/gentoo/ ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ ftp://gentoo.imj.fr/pub/gentoo/ ftp://distro.ibiblio.org/pub/linux/distributions/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="--jobs=2 --load-average=7"
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=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 acl amd64 avahi avi berkdb bzip2 cairo cli cracklib crypt cups cxx dbus divx dri dv dvd dvdread encode fame fortran gdbm gpm iconv ipv6 jpeg kvm mjpeg mmx modules mp3 mpeg mudflap multilib ncurses nls nptl ogg openmp pam pcre pppd python quicktime readline session sse sse2 sse3 ssl subtitles tcpd unicode vorbis xvid 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="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="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" PHP_TARGETS="php5-3 php5-4" 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 ruby18" 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, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 3 Timothy Miller 2013-01-10 00:54:47 UTC
[ebuild     U ] sys-fs/udev-197 [196-r1] USE="acl kmod openrc -doc -gudev -hwdb -introspection -keymap (-selinux) -static-libs"
Comment 4 Timothy Miller 2013-01-10 01:03:51 UTC
This fails with gcc 4.5.4 but works with gcc 4.6.3.  Should we care?
Comment 5 William Hubbs gentoo-dev 2013-01-10 05:35:07 UTC
It compiled fine here with 4.5.4, so I could use some help finding what
the issue might be that is different.

Portage 2.2.0_alpha149 (default/linux/x86/10.0, gcc-4.5.4, glibc-2.15-r3, 3.5.7-gentoo i686)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.5.7-gentoo-i686-Intel-R-_Celeron-R-_D_CPU_3.20GHz-with-gentoo-2.2
Timestamp of tree: Wed, 09 Jan 2013 19:00:01 +0000
ld GNU ld (GNU Binutils) 2.22
app-shells/bash:          4.2_p37
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/cmake:           2.8.9
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.2
sys-apps/openrc:          9999::local
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.4, 4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo local
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--nospinner"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms sign strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2"
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="acl alsa berkdb bzip2 cli cracklib crypt cups curl cxx dri fortran gdbm gpg gpm iconv imap ipv6 javascript modules mudflap ncurses nls nptl openmp pam pcre portaudio pppd readline sep-usr session ssl tcpd unicode usb x86 zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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="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 evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" 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, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

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

sys-fs/udev-197 was built with the following:
USE="acl kmod openrc -doc -gudev -hwdb -introspection -keymap (-selinux) -static-libs"
Comment 6 William Hubbs gentoo-dev 2013-01-10 05:38:05 UTC
It looks like I have an older glibc.

@toolchain:
Your help would be appreciated here.  thanks much.
Comment 7 SpanKY gentoo-dev 2013-01-10 05:42:54 UTC
this is to be expected.  _Static_assert is new to the c11 standard and gcc-4.5.x didn't include support for it (yet).  not a bug in gcc.

the issue most likely is that glibc-2.16 unconditionally defines static_assert in assert.h and then systemd just checks to see if that is defined.

since static_assert() is part of a standard, i'm not sure it is a bug in glibc that it provides this define.
Comment 8 Richard Wiedenhöft 2013-01-12 09:29:56 UTC
Failed here with gcc 4.6.3 and glibc 2.16.0.

emerge -pqv `=sys-fs/udev-197-r2`:
[ebuild     U ] sys-fs/udev-197-r2 [171-r9] USE="acl%* gudev* hwdb* introspection* keymap* kmod%* openrc%* -doc% (-selinux) -static-libs% (-action_modeswitch%) (-build%) (-debug%) (-edd%) (-extras%) (-floppy%) (-rule_generator%*) (-test%)" 

emerge --info:
Portage 2.1.11.40 (default/linux/amd64/10.0/desktop/gnome, gcc-4.5.4, glibc-2.16.0, 3.7.1-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.7.1-gentoo-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q8300_@_2.50GHz-with-gentoo-2.2
Timestamp of tree: Sat, 12 Jan 2013 07:45:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p42
dev-lang/python:          2.7.3-r3, 3.2.3-r2
dev-util/cmake:           2.8.10.2-r1
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.5.4, 4.6.3
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.7 (virtual/os-headers)
sys-libs/glibc:           2.16.0
Repositories: gentoo
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -fomit-frame-pointer -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /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/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs 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"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://de-mirror.org/gentoo/ ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://ftp.halifax.rwth-aachen.de/gentoo/"
LANG="de_DE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
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=""
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli colord consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr eds emboss encode evo exif fam firefox flac fortran gdbm gif gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk iconv ipv6 jpeg lcms ldap libnotify mad mmx mng modules mp3 mp4 mpeg mudflap multilib nautilus ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds pppd pulseaudio qt3support qt4 readline sdl session socialweb spell sse sse2 ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xcb xml xv xvid 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="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="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="nvidia" 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, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 9 Richard Wiedenhöft 2013-01-12 09:38:44 UTC
Created attachment 335296 [details]
build log of failed udev compilation
Comment 10 Richard Wiedenhöft 2013-01-12 09:39:02 UTC
Created attachment 335298 [details]
environment
Comment 11 SpanKY gentoo-dev 2013-01-12 16:56:52 UTC
you can prob make this work in the udev ebuild by doing:

 has_version '<sys-devel/gcc-4.6' && \
   sed -i 's:static_assert:alsdjflkasjdfa:' src/shared/macro.h
Comment 12 William Hubbs gentoo-dev 2013-01-12 18:41:30 UTC
@vapier:
I think your test above is true if < gcc 4.6 is _installed_, but doesn't
take into account which version is actually being used. Is that what we
want?
Comment 13 SpanKY gentoo-dev 2013-01-12 21:56:03 UTC
(In reply to comment #12)

true, you should probably use toolchain-funcs instead.  the basic idea is the same though.
Comment 14 William Hubbs gentoo-dev 2013-01-13 16:25:32 UTC
@vapier:
How about this test?

	has_version '=sys-devel/gcc-*' && \
		[ $(gcc-major-version) -lt 4 -o $(gcc-minor-version) -lt 6 ] &&
		sed -i 's:static_assert:alsdjflkasjdfa:' src/shared/macro.h
Comment 15 William Hubbs gentoo-dev 2013-01-13 16:46:23 UTC
Actually the has_version call could become:

has_version sys-devel/gcc
Comment 16 SpanKY gentoo-dev 2013-01-13 18:15:29 UTC
(In reply to comment #14)

that'd fail in the future with gcc-5.0 :)

you could inherit versionator.eclass and run:
  version_is_at_least 4.6 $(gcc-version)
Comment 17 Mike Doty (RETIRED) gentoo-dev 2013-01-14 19:46:48 UTC
I can confirm the build failure with gcc:4.5 (4.5.3-r2) on amd64.

I agree with Spanky that udev needs a build dep to check for proper support, but I wonder if we should extend toolchain-funcs to include a check for a supported gcc spec instead of just checking for a minimum gcc version.  Something along the lines of "supported_toolchain_standard c++11"

Alternatively, can we inject a c++11 check into autoconf files so it's obvious that udev fails due to missing c++11 support?
Comment 18 jeremy 2013-01-14 21:04:05 UTC
I can confirm a build failure as well. Full ~amd64 keyworded system (linux-headers=3.7 glibc=2.16.0 gcc=4.6.3).

The failure seems to be introduced by sys-libs/glibc-2.16.0. Or more specifically a certain block of code in a header file (/usr/include/assert.h) Which according to equery belongs to glibc. 

The block of code is

#if defined __USE_ISOC11 && !defined __cplusplus
/* Static assertion.  Requires support in the compiler.  */
# undef static_assert
# define static_assert _Static_assert
#endif

I backed up that header file and then removed that block of code as test. And to my surprise udev actually built.

Im not sure what the best way is to go about this. Certainly shouldnt actually change that header file. 

Im no dev im just a regular user trying different solutions that have come to mind and thought i would share my findings.

Ive include a diff of the header file as well as successful build log just incase it is of some use to get this bug solved.
Comment 19 jeremy 2013-01-14 21:05:29 UTC
Created attachment 335648 [details]
Diff of edited /usr/include/assert.h header file
Comment 20 jeremy 2013-01-14 21:06:58 UTC
Created attachment 335650 [details]
Successful udev build log after editing header file
Comment 21 Mike Doty (RETIRED) gentoo-dev 2013-01-14 21:48:51 UTC
(In reply to comment #17)
> I can confirm the build failure with gcc:4.5 (4.5.3-r2) on amd64.
> 
> I agree with Spanky that udev needs a build dep to check for proper support,
> but I wonder if we should extend toolchain-funcs to include a check for a
> supported gcc spec instead of just checking for a minimum gcc version. 
> Something along the lines of "supported_toolchain_standard c++11"
> 
> Alternatively, can we inject a c++11 check into autoconf files so it's
> obvious that udev fails due to missing c++11 support?

And I can confirm a build success with gcc-4.7.2.  Based on #c18, I think it's safe to say gcc:4.6 does not properly support c++11, so if we're going to use a simple bdep on gcc, then it should be >=gcc:4.7
Comment 22 jeremy 2013-01-14 23:10:36 UTC
I dont know much about the various build systems but is it possible to override a system header? What i mean by this is instead of using /usr/include/assert.h which is the system location use as example /usr/local/include/assert.h just for that single header file.

and use this header file if we are using a glibc version higher than 2.16.0 and gcc version 4.6 slot or lower. Otherwise use the system version.

It would basically break down like this

Case #1:

if glibc is lower that 2.16.0 use system header (gcc version would be irrelevent in this case as Static_assert wasnt defined until this version of glibc)

Case #2 

if glibc version is 2.16.0 or higher AND gcc is also slot 4.7 or higher use system header.

Case #3

If glibc version is 2.16.0 or higher AND gcc version is slot 4.6 or lower then use the local header instead (/usr/local/include/assert.h)

I have no idea if this would even work but its just an idea i thought of. Im also lost as far as how to impliment it. 

We would have to get the edited header file into the specified directory first i assume.

Local header directory location is just an example also.
Comment 23 SpanKY gentoo-dev 2013-01-14 23:22:08 UTC
(In reply to comment #17)

that won't work.  no gcc version supports all of c++11 -- every new release fleshes out more support.

just add the one liner from comment #14 / comment #17 and be done.  updating DEPEND/RDEPEND makes no sense.
Comment 24 William Hubbs gentoo-dev 2013-01-14 23:56:22 UTC
I don't know if this is any information we haven't already mentioned in
the bug, but from upstream, Lennart says the versions of glibc and gcc
are not compatible. i.e. glibc supports static asserts but gcc does not.
Systemd checks for static asserts with #ifdef.
Comment 25 William Hubbs gentoo-dev 2013-01-15 00:50:42 UTC
Created attachment 335662 [details, diff]
udev.patch

@vapier:
How about adding a check like this in pkg_pretend? Does this take care
of the issue?

Thanks,

William
Comment 26 SpanKY gentoo-dev 2013-01-15 01:42:43 UTC
(In reply to comment #24)

yes, that's what i mentioned earlier.  as for "incompatible", glibc itself doesn't care or use static asserts.  it merely provides a public definition for the internal gcc definition.

(In reply to comment #25)

that check is bad imo.  just add the aforementioned sed.
Comment 27 William Hubbs gentoo-dev 2013-01-15 03:45:44 UTC
Created attachment 335666 [details]
udev.patch

@vapier:
Is this the correct test?

Thanks,

William
Comment 28 SpanKY gentoo-dev 2013-01-15 05:49:59 UTC
(In reply to comment #27)

LGTM
Comment 29 William Hubbs gentoo-dev 2013-01-15 15:33:45 UTC
You might want to do this for systemd as well. Add the patch in comment
#27 and add toolchain-funcs to your inherit call.

Thanks,

William
Comment 30 Ian Stakenvicius (RETIRED) gentoo-dev 2013-01-15 15:49:50 UTC
Udev/systemd can't be the only thing that's going to come across this.  Since it's a compatibility issue between gcc and glibc , and since glibc is just defining something based on other static defines, would it be possible to patch one or both of them so that this WON'T be defined when a too-old GCC is used?

Perhaps somehow getting toolchains <= gcc-4.7 to unset __USE_ISOC11 ? Or having a __TOOLCHAIN_PROVIDES_ISOC11 that gcc-4.7 and above will auto define?

(both of the above are a bit hackish but i hope they at least illustrate what I mean)

I don't see an easy way to handle this in dependencies, since there's no way to force which minimum gcc version an ebuild is going to use, right?  Perhaps we need one...
Comment 31 jeremy 2013-01-15 16:08:38 UTC
(In reply to comment #30)
> Udev/systemd can't be the only thing that's going to come across this. 
> Since it's a compatibility issue between gcc and glibc , and since glibc is
> just defining something based on other static defines, would it be possible
> to patch one or both of them so that this WON'T be defined when a too-old
> GCC is used?
> 
> Perhaps somehow getting toolchains <= gcc-4.7 to unset __USE_ISOC11 ? Or
> having a __TOOLCHAIN_PROVIDES_ISOC11 that gcc-4.7 and above will auto define?
> 
> (both of the above are a bit hackish but i hope they at least illustrate
> what I mean)
> 
> I don't see an easy way to handle this in dependencies, since there's no way
> to force which minimum gcc version an ebuild is going to use, right? 
> Perhaps we need one...

I just moved glibc to my local overlay and made a patch to completely remove that section from the header file (assert.h) and then rebuilt world to make sure it didn't negatively affect anything. 

I don't see why the patch couldn't be applied conditionally using useflags and pdepends. 

in gcc ebuilds below slot 4.7 run a check to get glibc version. If it returns 2.16 or higher make gcc depend on glibc build with use=no-isoc11

In glibc ebuilds 2.16 or higher add a useflag no-isoc11 which would patch the headerfile when enabled.
Comment 32 jeremy 2013-01-15 16:18:11 UTC
Created attachment 335732 [details, diff]
assert.h.patch
Comment 33 jeremy 2013-01-15 16:19:03 UTC
Created attachment 335734 [details]
glibc-2.16.0.ebuild.example
Comment 34 jeremy 2013-01-15 16:20:36 UTC
Ive attached a copy of the patch and glibc ebuild incase it will be useful.

This glibc ebuild just contains the patch line. No useflag additions.
Comment 35 SpanKY gentoo-dev 2013-01-15 17:57:24 UTC
(In reply to comment #30)

they're the only thing hitting it now.  gcc-4.6 is in the process of stabilizing which will make this largely a moot point.

people keep missing the point -- there is no 1 knob to control all of ISOC11.  both glibc and gcc need updating, and neither version is finished implementing *the entire spec*.
Comment 36 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-07-31 21:46:30 UTC
I see that we require >gcc-4.6 nowadays so I guess we can close this one.
Comment 37 Samuli Suominen (RETIRED) gentoo-dev 2014-06-04 19:01:28 UTC
*** Bug 510524 has been marked as a duplicate of this bug. ***
Comment 38 SpanKY gentoo-dev 2015-02-17 10:27:20 UTC
glibc-2.22 will include a fallback _Static_assert when gcc doesn't provide it:
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3999d26ead93990b244ada078073fb58fb8bb5be