Summary: | app-misc/screen-4.6.2 with sys-devel/gcc-8.1.0-r3 on musl - utmp.c:850:15: error: storage size of 'u' isn't known | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Jory A. Pratt <anarchy> |
Component: | Current packages | Assignee: | Gentoo Shell Tools project <shell-tools> |
Status: | RESOLVED INVALID | ||
Severity: | normal | CC: | amade, gentoo, herrtimson, swegener, viklevin2 |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 654766 | ||
Attachments: |
build.log
log of successful build with sys-devel/gcc-8.1.0-r3 |
Description
Jory A. Pratt
2018-06-29 17:35:05 UTC
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. |