utmp.c: In function 'getlogin': utmp.c:850:15: error: storage size of 'u' isn't known struct utmp u; ^ utmp.c:860:38: error: invalid application of 'sizeof' to incomplete type 'struct utmp' while (read(fd, (char *)&u, sizeof(struct utmp)) == sizeof(struct utmp)) ^~~~~~ utmp.c:860:62: error: invalid application of 'sizeof' to incomplete type 'struct utmp' while (read(fd, (char *)&u, sizeof(struct utmp)) == sizeof(struct utmp)) ^~~~~~ utmp.c: At top level: utmp.c:881:1: error: conflicting types for 'xpututline' xpututline(u) ^~~~~~~~~~ utmp.c:98:21: note: previous declaration of 'xpututline' was here static struct utmp *xpututline __P((struct utmp *utmp)); ^~~~~~~~~~ utmp.c: In function 'xpututline': utmp.c:885:13: warning: passing argument 1 of 'pututline' from incompatible pointer type [-Wincompatible-pointer-types] pututline(u); ^ In file included from os.h:265, from screen.h:30, from utmp.c:34: /usr/include/utmp.h:32:14: note: expected 'const struct utmpx *' but argument is of type 'struct utmp *' struct utmp *pututline(const struct utmp *); ^~~~~~~~~ utmp.c:887:18: warning: passing argument 1 of 'getutline' from incompatible pointer type [-Wincompatible-pointer-types] u2 = getutline(u); ^ In file included from os.h:265, from screen.h:30, from utmp.c:34: /usr/include/utmp.h:31:14: note: expected 'const struct utmpx *' but argument is of type 'struct utmp *' struct utmp *getutline(const struct utmp *); ^~~~~~~~~ utmp.c:887:6: warning: assignment to 'struct utmp *' from incompatible pointer type 'struct utmpx *' [-Wincompatible-pointer-types] u2 = getutline(u); ^ utmp.c:889:13: error: dereferencing pointer to incomplete type 'struct utmp' return u->ut_type == DEAD_PROCESS ? u : 0; ^~ utmp.c: At top level: utmp.c:98:21: warning: 'xpututline' used but never defined static struct utmp *xpututline __P((struct utmp *utmp)); ^~~~~~~~~~ make: *** [Makefile:82: utmp.o] Error 1 Portage 2.3.41 (python 3.5.5-final-0, default/linux/amd64/17.0/musl/hardened, gcc-8.1.0, musl-1.1.19, 4.9.71-hardened x86_64) ================================================================= System uname: Linux-4.9.71-hardened-x86_64-Intel-R-_Core-TM-_i7-3630QM_CPU_@_2.40GHz-with-gentoo-2.6 KiB Mem: 8040044 total, 4524272 free KiB Swap: 8388604 total, 8388604 free Head commit of repository gentoo: cf6c995752712574c8ca70fef732571e4cd7f4b0 Head commit of repository libressl: a4b9fd25537566eb73bc178828a5dc90ff79e904 Head commit of repository mozilla: 9f6e23b7cd602f020235bdd7ef6303c4c0f342f1 Head commit of repository musl: b91983e38004299f2fbd19ca43ad3ceef73c1003 Head commit of repository smaeul: 052ea2a759e8cf9df798b710e9069d0d48672142 sh dash 0.5.10.2 ld GNU ld (Gentoo 2.30 p3) 2.30.0 ccache version 3.3.4 [enabled] app-shells/bash: 4.4_p23::gentoo dev-lang/perl: 5.26.2::gentoo dev-lang/python: 2.7.15::anarchy, 3.5.5-r1::gentoo, 3.6.5-r1::gentoo dev-util/ccache: 3.3.4-r1::gentoo dev-util/cmake: 3.11.4::gentoo sys-apps/baselayout: 2.6::gentoo sys-apps/openrc: 0.38.1::gentoo sys-apps/sandbox: 2.13::musl sys-devel/autoconf: 2.13::gentoo, 2.69-r4::gentoo sys-devel/automake: 1.16.1-r1::gentoo sys-devel/binutils: 2.30-r3::gentoo sys-devel/gcc: 8.1.0-r3::musl sys-devel/gcc-config: 1.9.1::gentoo sys-devel/libtool: 2.4.6-r5::gentoo sys-devel/make: 4.2.1-r3::gentoo sys-kernel/linux-headers: 4.17::musl (virtual/os-headers) sys-libs/musl: 1.1.19::gentoo Repositories: gentoo location: /usr/portage sync-type: git sync-uri: https://anongit.gentoo.org/git/repo/gentoo.git priority: -1000 libressl location: /home/sources/libressl sync-type: git sync-uri: https://github.com/gentoo/libressl.git masters: gentoo priority: 0 mozilla location: /home/mozilla sync-type: git sync-uri: git+ssh://git@git.gentoo.org/proj/mozilla.git masters: gentoo priority: 1 musl location: /home/sources/musl sync-type: git sync-uri: git+ssh://git@git.gentoo.org/proj/musl.git masters: gentoo priority: 2 smaeul location: /home/sources/portage-overlay sync-type: git sync-uri: https://github.com/smaeul/portage-overlay.git masters: gentoo priority: 3 anarchy location: /home/gentoo masters: gentoo priority: 4 ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-gentoo-linux-musl" CFLAGS="-Os -march=native -pipe" CHOST="x86_64-gentoo-linux-musl" CONFIG_PROTECT="/etc /usr/lib/libreoffice/program/sofficerc /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" CXXFLAGS="-Os -march=native -pipe" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--with-bdeps=y --quiet-build=y --autounmask-keep-masks" ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY 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-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch preserve-libs protect-owned sandbox sfperms strict strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://mirror.leaseweb.com/gentoo/ http://mirrors.rit.edu/gentoo/" INSTALL_MASK="charset.alias" LC_ALL="en_US.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common" MAKEOPTS="-j9 --no-print-directory -l8" PKGDIR="/usr/portage/packages" PORTAGE_COMPRESS="xz" PORTAGE_COMPRESS_FLAGS="-z -9 -f -S .xz" 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 --exclude=/.git" PORTAGE_TMPDIR="/var/tmp/tmpfs" USE="X aac alsa amd64 bzip2 cairo cdio cgroups consolekit crypt cups cxx dbus dri dri3 egl ffmpeg gtk gtk3 hardened iconv icu introspection ipv6 jpeg libcanberra libressl libsecret libtirpc lzma mp3 ncurses nptl opengl openmp pam pax_kernel pcre pdf pie png policykit postproc pulseaudio readline seccomp spell sqlite ssh ssl ssp theora threads tiff truetype udev udisks unicode upower vaapi vpx x264 xattr xcb xinerama xtpax xvid zlib" ABI_X86="64" ALSA_CARDS="hda-intel" CALLIGRA_FEATURES="karbon plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" CURL_SSL="libressl" ELIBC="musl" 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="evdev synaptics" KERNEL="linux" L10N="en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="BPF X86" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby23" USERLAND="GNU" VIDEO_CARDS="intel" 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: CC, CPPFLAGS, CTARGET, CXX, LANG, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_RSYNC_EXTRA_OPTS
Created attachment 537784 [details] build.log
Yes, I already tried to fix this one in the past but iirc it caused problem with some other targets. For musl you probably want to conditionally revert this patch: https://git.savannah.gnu.org/cgit/screen.git/commit/?h=screen-v4&id=2e2410a668be96bcd64afbba2fd601c237f5a68e Reason for this is that v4 (screen-v4 git branch) has so much #ifdeffery that no matter what you do it breaks, so it's unlikely to be fixed in next v4 release. I could take another look at fixing it in v4, but quite frankly I think my limited time is better spend at working towards making v5 a reality, for v5 I did a lot of cleaning up and tried to depend on posix compatibility almost everywhere to avoid such problems and removed most of those #ifdefs, which seems to work quite well. Also it's not caused by gcc-8 but by using musl, so no need to block gcc-8, I have same result with gcc-6 when trying to build 4.6.2. utmp.c: In function ‘getlogin’: utmp.c:850:15: error: storage size of ‘u’ isn’t known struct utmp u; ^ utmp.c:860:38: error: invalid application of ‘sizeof’ to incomplete type ‘struct utmp’ while (read(fd, (char *)&u, sizeof(struct utmp)) == sizeof(struct utmp)) ^~~~~~ utmp.c:860:62: error: invalid application of ‘sizeof’ to incomplete type ‘struct utmp’ while (read(fd, (char *)&u, sizeof(struct utmp)) == sizeof(struct utmp)) ^~~~~~ utmp.c: At top level: utmp.c:881:1: error: conflicting types for ‘xpututline’ xpututline(u) ^~~~~~~~~~ utmp.c:98:21: note: previous declaration of ‘xpututline’ was here static struct utmp *xpututline __P((struct utmp *utmp)); ^~~~~~~~~~ utmp.c: In function ‘xpututline’: utmp.c:885:13: warning: passing argument 1 of ‘pututline’ from incompatible pointer type [-Wincompatible-pointer-types] pututline(u); ^ In file included from os.h:265:0, from screen.h:30, from utmp.c:34: /usr/include/utmp.h:32:14: note: expected ‘const struct utmpx *’ but argument is of type ‘struct utmp *’ struct utmp *pututline(const struct utmp *); ^~~~~~~~~ utmp.c:887:18: warning: passing argument 1 of ‘getutline’ from incompatible pointer type [-Wincompatible-pointer-types] u2 = getutline(u); ^ In file included from os.h:265:0, from screen.h:30, from utmp.c:34: /usr/include/utmp.h:31:14: note: expected ‘const struct utmpx *’ but argument is of type ‘struct utmp *’ struct utmp *getutline(const struct utmp *); ^~~~~~~~~ utmp.c:887:6: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] u2 = getutline(u); ^ utmp.c:889:13: error: dereferencing pointer to incomplete type ‘struct utmp’ return u->ut_type == DEAD_PROCESS ? u : 0; ^~ utmp.c: At top level: utmp.c:98:21: warning: ‘xpututline’ used but never defined static struct utmp *xpututline __P((struct utmp *utmp)); ^~~~~~~~~~ make: *** [Makefile:82: utmp.o] Error 1 make: *** Waiting for unfinished jobs.... * ERROR: app-misc/screen-4.6.2::gentoo failed (compile phase): * emake failed * * If you need support, post the output of `emerge --info '=app-misc/screen-4.6.2::gentoo'`, * the complete build log and the output of `emerge -pqv '=app-misc/screen-4.6.2::gentoo'`. * The complete build log is located at '/var/tmp/portage/app-misc/screen-4.6.2/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/app-misc/screen-4.6.2/temp/environment'. * Working directory: '/var/tmp/portage/app-misc/screen-4.6.2/work/screen-4.6.2' * S: '/var/tmp/portage/app-misc/screen-4.6.2/work/screen-4.6.2' >>> Failed to emerge app-misc/screen-4.6.2, Log file: >>> '/var/tmp/portage/app-misc/screen-4.6.2/temp/build.log' * Messages for package app-misc/screen-4.6.2: * ERROR: app-misc/screen-4.6.2::gentoo failed (compile phase): * emake failed * * If you need support, post the output of `emerge --info '=app-misc/screen-4.6.2::gentoo'`, * the complete build log and the output of `emerge -pqv '=app-misc/screen-4.6.2::gentoo'`. * The complete build log is located at '/var/tmp/portage/app-misc/screen-4.6.2/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/app-misc/screen-4.6.2/temp/environment'. * Working directory: '/var/tmp/portage/app-misc/screen-4.6.2/work/screen-4.6.2' * S: '/var/tmp/portage/app-misc/screen-4.6.2/work/screen-4.6.2' ssh # gcc --version gcc (Gentoo Hardened 6.4.0-r1 p1.3) 6.4.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Created attachment 537788 [details] log of successful build with sys-devel/gcc-8.1.0-r3 I have no problem building app-misc/srceen-4.6.2 with sys-devel/gcc-8.1.0-r3 on amd64. Not sure why it works for me but not for the OP. Maybe because I have USE='-pam'? Just a wild, unsubstantiated guess.
(In reply to Amadeusz Sławiński from comment #2) > Yes, I already tried to fix this one in the past but iirc it caused problem > with some other targets. > > For musl you probably want to conditionally revert this patch: > https://git.savannah.gnu.org/cgit/screen.git/commit/?h=screen- > v4&id=2e2410a668be96bcd64afbba2fd601c237f5a68e > > Reason for this is that v4 (screen-v4 git branch) has so much #ifdeffery > that no matter what you do it breaks, so it's unlikely to be fixed in next > v4 release. I could take another look at fixing it in v4, but quite frankly > I think my limited time is better spend at working towards making v5 a > reality, for v5 I did a lot of cleaning up and tried to depend on posix > compatibility almost everywhere to avoid such problems and removed most of > those #ifdefs, which seems to work quite well. > > Also it's not caused by gcc-8 but by using musl, so no need to block gcc-8, > I have same result with gcc-6 when trying to build 4.6.2. > > utmp.c: In function ‘getlogin’: > utmp.c:850:15: error: storage size of ‘u’ isn’t known > struct utmp u; > ^ > utmp.c:860:38: error: invalid application of ‘sizeof’ to incomplete type > ‘struct utmp’ > while (read(fd, (char *)&u, sizeof(struct utmp)) == sizeof(struct utmp)) > ^~~~~~ > utmp.c:860:62: error: invalid application of ‘sizeof’ to incomplete type > ‘struct utmp’ > while (read(fd, (char *)&u, sizeof(struct utmp)) == sizeof(struct utmp)) > ^~~~~~ > utmp.c: At top level: > utmp.c:881:1: error: conflicting types for ‘xpututline’ > xpututline(u) > ^~~~~~~~~~ > utmp.c:98:21: note: previous declaration of ‘xpututline’ was here > static struct utmp *xpututline __P((struct utmp *utmp)); > ^~~~~~~~~~ > utmp.c: In function ‘xpututline’: > utmp.c:885:13: warning: passing argument 1 of ‘pututline’ from incompatible > pointer type [-Wincompatible-pointer-types] > pututline(u); > ^ > In file included from os.h:265:0, > from screen.h:30, > from utmp.c:34: > /usr/include/utmp.h:32:14: note: expected ‘const struct utmpx *’ but > argument is of type ‘struct utmp *’ > struct utmp *pututline(const struct utmp *); > ^~~~~~~~~ > utmp.c:887:18: warning: passing argument 1 of ‘getutline’ from incompatible > pointer type [-Wincompatible-pointer-types] > u2 = getutline(u); > ^ > In file included from os.h:265:0, > from screen.h:30, > from utmp.c:34: > /usr/include/utmp.h:31:14: note: expected ‘const struct utmpx *’ but > argument is of type ‘struct utmp *’ > struct utmp *getutline(const struct utmp *); > ^~~~~~~~~ > utmp.c:887:6: warning: assignment from incompatible pointer type > [-Wincompatible-pointer-types] > u2 = getutline(u); > ^ > utmp.c:889:13: error: dereferencing pointer to incomplete type ‘struct utmp’ > return u->ut_type == DEAD_PROCESS ? u : 0; > ^~ > utmp.c: At top level: > utmp.c:98:21: warning: ‘xpututline’ used but never defined > static struct utmp *xpututline __P((struct utmp *utmp)); > ^~~~~~~~~~ > make: *** [Makefile:82: utmp.o] Error 1 > make: *** Waiting for unfinished jobs.... > * ERROR: app-misc/screen-4.6.2::gentoo failed (compile phase): > * emake failed > * > * If you need support, post the output of `emerge --info > '=app-misc/screen-4.6.2::gentoo'`, > * the complete build log and the output of `emerge -pqv > '=app-misc/screen-4.6.2::gentoo'`. > * The complete build log is located at > '/var/tmp/portage/app-misc/screen-4.6.2/temp/build.log'. > * The ebuild environment file is located at > '/var/tmp/portage/app-misc/screen-4.6.2/temp/environment'. > * Working directory: > '/var/tmp/portage/app-misc/screen-4.6.2/work/screen-4.6.2' > * S: '/var/tmp/portage/app-misc/screen-4.6.2/work/screen-4.6.2' > > >>> Failed to emerge app-misc/screen-4.6.2, Log file: > > >>> '/var/tmp/portage/app-misc/screen-4.6.2/temp/build.log' > > * Messages for package app-misc/screen-4.6.2: > > * ERROR: app-misc/screen-4.6.2::gentoo failed (compile phase): > * emake failed > * > * If you need support, post the output of `emerge --info > '=app-misc/screen-4.6.2::gentoo'`, > * the complete build log and the output of `emerge -pqv > '=app-misc/screen-4.6.2::gentoo'`. > * The complete build log is located at > '/var/tmp/portage/app-misc/screen-4.6.2/temp/build.log'. > * The ebuild environment file is located at > '/var/tmp/portage/app-misc/screen-4.6.2/temp/environment'. > * Working directory: > '/var/tmp/portage/app-misc/screen-4.6.2/work/screen-4.6.2' > * S: '/var/tmp/portage/app-misc/screen-4.6.2/work/screen-4.6.2' > ssh # gcc --version > gcc (Gentoo Hardened 6.4.0-r1 p1.3) 6.4.0 > Copyright (C) 2017 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. I can compile it with gcc-{6,7}.x without a problem. I will test if reverting that patch will work as a workaround for the moment.
Amadeusz, I have tested the patch you suggested, it results in redefinitions. I will wait for you to make the release from branch master which is working.
Is this still a problem with gcc-8.2.0?
(In reply to tt_1 from comment #6) > Is this still a problem with gcc-8.2.0? I just rebuilt screen-4.6.2-r1 on with gcc-8.2.0-r6 without problem.
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.0.6&id=8f84f7daabb2fddfc5f81e9257e8c465b2a0caef after reverting as chithead suggested it compiles fine. anarchy@bull ~ $ pkg-config libelf --libs -lelf which is what the default would be with the revert.
I can no longer produce the failure so will close for now.