Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 786702 - sys-power/nut-2.7.4-r6 failed to compile with sys-devel/gcc-11.1.0
Summary: sys-power/nut-2.7.4-r6 failed to compile with sys-devel/gcc-11.1.0
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords: PATCH
: 801454 (view as bug list)
Depends on:
Blocks: gcc-11
  Show dependency tree
 
Reported: 2021-04-29 08:04 UTC by Dmitry Suloev
Modified: 2021-08-04 19:37 UTC (History)
9 users (show)

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


Attachments
patch to fix this issue (nut-ebuild.patch,424 bytes, patch)
2021-04-29 08:12 UTC, Dmitry Suloev
Details | Diff
build log (sys-power:nut-2.7.4-r6:20210510-063847.log,80.29 KB, text/plain)
2021-05-10 17:23 UTC, Gary E. Miller
Details
/etc/portage/env/sys-power/nut-2.7.4-r6 (file_786702.txt,1.61 KB, text/plain)
2021-07-04 10:31 UTC, strites
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Suloev 2021-04-29 08:04:37 UTC
sys-power/nut-2.7.4-r6 failed to compile with sys-devel/gcc-11.1.0 because new version of gcc is used gnu++17 as default standard. Overriding default with -std=gnu++14 flag allow avoid this problem and nut compiles fine.

Reproducible: Always

Steps to Reproduce:
1. emerge nut
Comment 1 Dmitry Suloev 2021-04-29 08:12:34 UTC
Created attachment 703785 [details, diff]
patch to fix this issue
Comment 2 Gary E. Miller 2021-05-10 17:23:30 UTC
Me too.

backup ~ # emerge -pqv '=sys-power/nut-2.7.4-r6::gentoo'
[ebuild   R   ] sys-power/nut-2.7.4-r6  USE="cgi ipmi snmp (split-usr) ssl tcpd ups_drivers_al175 ups_drivers_apcsmart ups_drivers_apcsmart-old ups_drivers_apcupsd-ups ups_drivers_bcmxcp ups_drivers_bcmxcp_usb ups_drivers_belkin ups_drivers_belkinunv ups_drivers_bestfcom ups_drivers_bestfortress ups_drivers_bestuferrups ups_drivers_bestups ups_drivers_blazer_ser ups_drivers_blazer_usb ups_drivers_clone ups_drivers_clone-outlet ups_drivers_dummy-ups ups_drivers_etapro ups_drivers_everups ups_drivers_gamatronic ups_drivers_genericups ups_drivers_isbmex ups_drivers_ivtscd ups_drivers_liebert ups_drivers_liebert-esp2 ups_drivers_masterguard ups_drivers_metasys ups_drivers_mge-shut ups_drivers_mge-utalk ups_drivers_microdowell ups_drivers_nutdrv_qx ups_drivers_oldmge-shut ups_drivers_oneac ups_drivers_optiups ups_drivers_powercom ups_drivers_powerpanel ups_drivers_rhino ups_drivers_richcomm_usb ups_drivers_riello_ser ups_drivers_riello_usb ups_drivers_safenet ups_drivers_snmp-ups ups_drivers_solis ups_drivers_tripplite ups_drivers_tripplite_usb ups_drivers_tripplitesu ups_drivers_upscode2 ups_drivers_usbhid-ups ups_drivers_victronups usb xml (-selinux) -ups_drivers_netxml-ups -ups_drivers_nut-ipmipsu -zeroconf" 

 * IMPORTANT: 1 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

backup ~ # emerge --info '=sys-power/nut-2.7.4-r6::gentoo'
Portage 3.0.18 (python 3.8.9-final-0, default/linux/amd64/17.1, gcc-11.1.0, glibc-2.32-r7, 5.12.0-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.12.0-gentoo-x86_64-Intel-R-_Xeon-R-_CPU_E3-1241_v3_@_3.50GHz-with-glibc2.2.5
KiB Mem:    16300072 total,   5791580 free
KiB Swap:   33554428 total,  33552364 free
Timestamp of repository gentoo: Mon, 10 May 2021 01:15:01 +0000
Head commit of repository gentoo: 35e3514030b905e16a44074ea4aee6a8e7fef30c
sh bash 5.0_p18
ld GNU ld (Gentoo 2.35.2 p1) 2.35.2
distcc[6688] (dcc_trace_version) distcc 3.3.3 x86_64-pc-linux-gnu; built May  9 2021 19:21:40 [disabled]
app-shells/bash:          5.0_p18::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          2.7.18_p9::gentoo, 3.7.10_p3::gentoo, 3.8.9_p2::gentoo, 3.9.4_p1::gentoo
dev-lang/rust:            1.51.0-r2::gentoo
dev-util/cmake:           3.18.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1-r1::gentoo
sys-apps/sandbox:         2.22::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.2-r1::gentoo
sys-devel/binutils:       2.35.2::gentoo
sys-devel/gcc:            11.1.0::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.us.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: --exclude ChangeLog* 
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=core-avx2 "
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.0/ext-active/ /etc/php/cgi-php8.0/ext-active/ /etc/php/cli-php8.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=core-avx2 "
DISTDIR="/var/cache/distfiles/"
EMERGE_DEFAULT_OPTS="--keep-going --with-bdeps=y --backtrack=2"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs cgroup config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.gossamerhost.com http://gentoo.mirrors.tera-byte.com/ http://gentoo.mirrors.easynews.com/linux/gentoo/ http://cosmos.illinois.edu/pub/gentoo/ http://gentoo.mirrors.tds.net/gentoo"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_US"
MAKEOPTS="-j8 -l4"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude ChangeLog* "
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="10bit X aac acl adns aio amd64 asyncdns avahi bash-completion bcmath berkdb bzip2 cairo caps cdp cgi clang cli conntrack cron crypt curl dbus declarative dri edp elogind enca examples faac fdp fontconfig fortran fpm fpx gbm gcrypt gd gdbm git glamor gmp gnutls gpg gs gsm gtk harfbuzz hddtemp hdri http2 iconv infinality ipmi ipv6 jbig jpeg lcms libedit libglvnd libnl libtirpc lto lz4 lzma minizip mp3 multilib ncurses netlink network nfs nfsdcld nfsidmap nfsv4 nfsv41 nls nptl offensive openexr opengl openmp openssl pam pcap pch pcre pgo png python q32 q8 qt3support qt4 qt5 rar raw readline rpc scrypt sctp seccomp sharedmem snmp sonmp split-usr sqlite ssh ssl svg tcpd threads tiff tools truetype unbound unicode update_drivedb urandom usb vim-syntax vpx wg-quick wmf wxwidgets x264 x265 xattr xml zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2018" 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" APACHE2_MODULES="proxy actions alias auth_basic authn_alias authn_anon authn_core authn_dbm authn_file authz_core authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias access_compat auth_digest http2 ident imagemap log_forensic macro proxy_fcgi ratelimit remoteip reqtimeout slotmem_shm" APACHE2_MPMS="prefork" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="apache conntrack cpu csv df disk exec filecount interface iptables irq load logfile match_empty_counter match_regex match_value memcached memory mysql network rrdtool sensors swap syslog table tail target_notification target_replace target_scale target_set tcpconns unixsock uptime users vmem write_http" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="emu gentoo_platforms_efi-32 gentoo_platforms_efi-64 pc" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en en-US" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="nv nouveau vesa radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, RUSTFLAGS

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

sys-power/nut-2.7.4-r6::gentoo was built with the following:
USE="cgi ipmi snmp (split-usr) ssl tcpd ups_drivers_al175 ups_drivers_apcsmart ups_drivers_apcsmart-old ups_drivers_apcupsd-ups ups_drivers_bcmxcp ups_drivers_bcmxcp_usb ups_drivers_belkin ups_drivers_belkinunv ups_drivers_bestfcom ups_drivers_bestfortress ups_drivers_bestuferrups ups_drivers_bestups ups_drivers_blazer_ser ups_drivers_blazer_usb ups_drivers_clone ups_drivers_clone-outlet ups_drivers_dummy-ups ups_drivers_etapro ups_drivers_everups ups_drivers_gamatronic ups_drivers_genericups ups_drivers_isbmex ups_drivers_ivtscd ups_drivers_liebert ups_drivers_liebert-esp2 ups_drivers_masterguard ups_drivers_metasys ups_drivers_mge-shut ups_drivers_mge-utalk ups_drivers_microdowell ups_drivers_nutdrv_qx ups_drivers_oldmge-shut ups_drivers_oneac ups_drivers_optiups ups_drivers_powercom ups_drivers_powerpanel ups_drivers_rhino ups_drivers_richcomm_usb ups_drivers_riello_ser ups_drivers_riello_usb ups_drivers_safenet ups_drivers_snmp-ups ups_drivers_solis ups_drivers_tripplite ups_drivers_tripplite_usb ups_drivers_tripplitesu ups_drivers_upscode2 ups_drivers_usbhid-ups ups_drivers_victronups usb xml (-selinux) -ups_drivers_netxml-ups -ups_drivers_nut-ipmipsu -zeroconf" ABI_X86="(64)"
CFLAGS="-O2 -pipe -march=core-avx2 -fno-lto"
Comment 3 Gary E. Miller 2021-05-10 17:23:56 UTC
Created attachment 706830 [details]
build log

build log
Comment 4 strites 2021-07-04 10:31:09 UTC
Created attachment 721645 [details]
/etc/portage/env/sys-power/nut-2.7.4-r6

this file makes it compile (applied the patch and sent it to /etc/portage/env)
Comment 5 email200202 2021-07-10 06:26:13 UTC
The same problem is in sys-power/nut-2.7.4-r7

Your patch works.
Comment 6 Barry Schwartz 2021-07-16 12:52:45 UTC
What I did is stick

[ "${CATEGORY}/${PN}-${PV}" == "sys-power/nut-2.7.4" ] &&
       CXXFLAGS="${CXXFLAGS} -std=gnu++14"

in my /etc/portage/bashrc

It has the advantage of not requiring compiler-specific modifications to the ebuild. But obviously it is an upstream problem.
Comment 7 Douglas J Hunley 2021-07-16 13:07:08 UTC
(In reply to Barry Schwartz from comment #6)
> What I did is stick
> 
> [ "${CATEGORY}/${PN}-${PV}" == "sys-power/nut-2.7.4" ] &&
>        CXXFLAGS="${CXXFLAGS} -std=gnu++14"
> 
> in my /etc/portage/bashrc
> 
> It has the advantage of not requiring compiler-specific modifications to the
> ebuild. But obviously it is an upstream problem.

You should look into package.env. It's a cleaner way to do this.
Comment 8 Gary E. Miller 2021-07-17 01:13:20 UTC
Thanks for the hint.  I created /etc/portage/env/nut.conf, and referred to it in /etc/portage/package.env and it worked!


spidey ~ # cat /etc/portage/package.env
=sys-power/nut-2.7.4-r7 nut.conf

spidey ~ # cat /etc/portage/env/nut.conf
# https://bugs.gentoo.org/show_bug.cgi?id=786702
CXXFLAGS="${CXXFLAGS} -std=gnu++14"
Comment 9 Dmitry Suloev 2021-07-20 14:11:26 UTC
According to project source code available on https://github.com/networkupstools/nut there is no plans to migrating on newest C++ standard. So is better way to fix this issue is update ebuild.
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-04 19:32:32 UTC
*** Bug 801454 has been marked as a duplicate of this bug. ***
Comment 11 Larry the Git Cow gentoo-dev 2021-08-04 19:37:52 UTC
The bug has been closed via the following commit(s):

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

commit a1af71cd65bb61bf0f39a5051723ba89508da5b4
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-08-04 19:37:25 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-08-04 19:37:41 +0000

    sys-power/nut: workaround build failure with GCC 11
    
    Closes: https://bugs.gentoo.org/786702
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-power/nut/nut-2.7.4-r7.ebuild | 4 ++++
 1 file changed, 4 insertions(+)