Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 624288 - sys-fs/udev-233 fails to compile with gcc-7.1.0 or gcc-7.3.0 and '-O3'
Summary: sys-fs/udev-233 fails to compile with gcc-7.1.0 or gcc-7.3.0 and '-O3'
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: udev maintainers
Depends on:
Blocks: gcc-7
  Show dependency tree
Reported: 2017-07-08 19:58 UTC by Philipp Psurek
Modified: 2018-01-31 15:33 UTC (History)
1 user (show)

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

udev-233_build.log.xz (udev-233_build.log.xz,22.07 KB, application/x-xz)
2017-07-08 19:58 UTC, Philipp Psurek
udev-233_build.log udev-233 compilation with -O2 CFLAG (udev-233_build-O2.log.xz,28.32 KB, application/x-xz)
2017-07-08 21:13 UTC, Philipp Psurek

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Psurek 2017-07-08 19:58:46 UTC
Created attachment 482318 [details]

sys-fs/udev-233 fails to compile. Log is attached. Here are some Warnings and errors extracted:

cc1: warning: ./src/shared: No such file or directory [-Wmissing-include-dirs]
/mnt/bdt/data/gentoo/portage/sys-fs/udev-233/work/systemd-233/src/basic/env-util.c: In function ‘replace_env_n’:
/mnt/bdt/data/gentoo/portage/sys-fs/udev-233/work/systemd-233/src/basic/env-util.c:644:35: warning: ‘len’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                                 t = strv_env_get_n(env, word+2, len, flags);
/mnt/bdt/data/gentoo/portage/sys-fs/udev-233/work/systemd-233/src/basic/env-util.c:647:76: warning: ‘test_value’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                                         t = v = replace_env_n(test_value, e-test_value, env, flags);

cc1: warning: ./src/shared: No such file or directory [-Wmissing-include-dirs]
/mnt/bdt/data/gentoo/portage/sys-fs/udev-233/work/systemd-233/src/basic/exec-util.c: In function ‘execute_directories’:
/mnt/bdt/data/gentoo/portage/sys-fs/udev-233/work/systemd-233/src/basic/exec-util.c:155:27: warning: ‘pid’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                         r = wait_for_terminate_and_warn(t, pid, true);
/mnt/bdt/data/gentoo/portage/sys-fs/udev-233/work/systemd-233/src/basic/exec-util.c:133:23: note: ‘pid’ was declared here
                 pid_t pid;

cc1: warning: ./src/shared: No such file or directory [-Wmissing-include-dirs]
/mnt/bdt/data/gentoo/portage/sys-fs/udev-233/work/systemd-233/src/basic/cgroup-util.c: In function ‘cg_pid_get_path’:
/mnt/bdt/data/gentoo/portage/sys-fs/udev-233/work/systemd-233/src/basic/cgroup-util.c:1058:48: warning: ‘controller_str’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                                 if (k == cs && memcmp(word, controller_str, cs) == 0) {

/mnt/bdt/data/gentoo/portage/sys-fs/udev-233/work/systemd-233/src/shared/install.c: In function ‘config_parse_also’:
/mnt/bdt/data/gentoo/portage/sys-fs/udev-233/work/systemd-233/src/shared/install.c:1007:22: error: argument 1 null where non-null expected [-Werror=nonnull]
                 name = basename(path);
In file included from /mnt/bdt/data/gentoo/portage/sys-fs/udev-233/work/systemd-233/src/shared/install.c:28:0:
/usr/include/string.h:603:14: note: in a call to function ‘basename’ declared here
 extern char *basename (const char *__filename) __THROW __nonnull ((1));

/mnt/bdt/data/gentoo/portage/sys-fs/udev-233/work/systemd-233/src/shared/install.c:1007:22: error: argument 1 null where non-null expected [-Werror=nonnull]
                 name = basename(path);
In file included from /mnt/bdt/data/gentoo/portage/sys-fs/udev-233/work/systemd-233/src/shared/install.c:28:0:
/usr/include/string.h:603:14: note: in a call to function ‘basename’ declared here
 extern char *basename (const char *__filename) __THROW __nonnull ((1));
cc1: some warnings being treated as errors
make: *** [Makefile:17379: src/shared/libshared_la-install.lo] Error 1

$ emerge --info
Portage 2.3.6 (python 3.4.5-final-0, default/linux/amd64/13.0/desktop, gcc-7.1.0, glibc-2.25-r2, 4.11.0-gentoo x86_64)
System uname: Linux-4.11.0-gentoo-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T8100_@_2.10GHz-with-gentoo-2.3
KiB Mem:     3974560 total,    360732 free
KiB Swap:    4194300 total,   4044680 free
Timestamp of repository gentoo: Sat, 08 Jul 2017 18:45:01 +0000
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.28 p1.2) 2.28
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.3_p48-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.1-r2::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo
dev-util/cmake:           3.7.2::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.26.3::gentoo
sys-apps/sandbox:         2.10-r3::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.10.3-r1::gentoo, 1.11.6-r1::gentoo, 1.12.6::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.28-r2::gentoo
sys-devel/gcc:            7.1.0-r1::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r2::gentoo

    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://
    priority: -1000
    sync-rsync-extra-opts: --exclude-from=/etc/portage/rsync_excludes

    location: /home/philipp/proj/overlays/myoverlay
    masters: gentoo
    priority: 0

    location: /usr/local/portage-crossdev
    masters: gentoo
    priority: 10

    location: /var/lib/layman/java
    masters: gentoo
    priority: 50

CFLAGS="-march=core2 -mtune=core2 -O3 -pipe -fstack-protector -mcx16 -msahf -msse4.1 -mfxsr --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /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=core2 -mtune=core2 -O3 -pipe -fstack-protector -mcx16 -msahf -msse4.1 -mfxsr --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072"
FCFLAGS="-march=core2 -mtune=core2 -O3 -pipe -fstack-protector -mcx16 -msahf -msse4.1 -mfxsr --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=core2 -mtune=core2 -O3 -pipe -fstack-protector -mcx16 -msahf -msse4.1 -mfxsr --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
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"
USE="X a52 aac acl acpi alsa amd64 apache2 berkdb bluetooth branding bzip2 cacert cairo caps cdda cdr cgi cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif glamor glib gpm gtk iconv ipv6 iqbalance jpeg lcms ldap libnotify mad mng modules mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp orc pam pango pcre pdf png policykit ppds pulseaudio qt3support qt4 readline rtlsdr sdl seccomp session spell ssl startup-notification svg tcpd threads tiff truetype udev udisks unicode upower usb vaapi vdpau vorbis wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="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 asis auth_digest authn_dbd cern_meta charset_lite dbd dumpio ident imagemap log_forensic proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http proxy_scgi reqtimeout substitute version access_compat authn_core authz_core authz_dbd cache_disk lbmethod_bybusyness lbmethod_byrequests lbmethod_bytraffic lbmethod_heartbeat macro proxy_fcgi proxy_html proxy_wstunnel ratelimit remoteip slotmem_shm socache_shmcb unixd" APACHE2_MPMS="worker" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 sse4_1 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" L10N="de" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" QEMU_USER_TARGETS="arm i386 mipsel x86_64" RUBY_TARGETS="ruby21 ruby22" USERLAND="GNU" VIDEO_CARDS="intel i965" 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"

please tell me if you need to know something else about my Gentoo system.
Comment 1 Mike Gilbert gentoo-dev 2017-07-08 20:03:06 UTC
This is a bug in gcc-7.1.0.
Comment 2 Philipp Psurek 2017-07-08 21:13:50 UTC
Created attachment 482390 [details]
udev-233_build.log udev-233 compilation with -O2 CFLAG

Thank you Mike for the fast categorization of this bug and linking it to bug 620092. Indeed compiling udev-233 with 7.1.0-r1 and changing the CFLAG from -03 to -O2 was a success. For the sake of completeness I provide the build log I extracted from the console. There are some warnings, but no errors.

With the next issue of GCC-7 I'll report how udev-233 compiles with -03.

It might be a good idea to force -O2 in the ebuild. But I think that no change is needed as this seems to be a GCC-7 only bug, the users of other GCCs have no problems with -O3 and GCC-7 is not for the masses.
Comment 3 Philipp Psurek 2018-01-31 15:24:36 UTC
sys-fs/udev-233 fails to compile with '-O3' even with gcc-7.3.0. I assume this version of gcc is quite mature.  On the other hand sys-fs/udev-236-r1 compiles well with '-O3' and gcc-7.3.0 and even with gcc-7.1.0(!). All mentioned compile runs has been preformed on amd64 and arm.

This bug seems not to be a gcc bug.

Please close this bug unresolved or resolve it through removing sys-fs/udev-233 from portage tree.
Comment 4 Mike Gilbert gentoo-dev 2018-01-31 15:33:54 UTC
I believe this was worked around in systemd (and udev) at some point. It was definitely a bug in gcc-7.1.0 though.

Marking this obsolete since the problem no longer occurs with the latest versions of each.