* bug#53424: tftp-hpa: Fails to build (multiple definition of 'toplevel' when linking)
@ 2022-01-21 21:06 Ivan Vilata i Balaguer
2022-01-21 21:20 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2022-01-21 22:14 ` Maxime Devos
0 siblings, 2 replies; 5+ messages in thread
From: Ivan Vilata i Balaguer @ 2022-01-21 21:06 UTC (permalink / raw)
To: 53424
[-- Attachment #1.1: Type: text/plain, Size: 4880 bytes --]
Hi! When trying to upgrade package `tftp-hpa 5.2` from Guix commit `404f6953`
to that of commit `4a943cfd`, the build fails showing these warnings and
error:
```
starting phase `build'
[…]
gcc -g -O2 -W -Wall -Wpointer-arith -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wwrite-strings -Wundef -Wshadow -Wsign-compare -pipe -fno-strict-aliasing -I/tmp/guix-build-tftp-hpa-5.2.drv-0/tftp-hpa-5.2 -c main.c
tftp.c: In function ‘tftp_sendfile’:
tftp.c:88:5: warning: implicit declaration of function ‘bsd_signal’; did you mean ‘ssignal’? [-Wimplicit-function-declaration]
88 | bsd_signal(SIGALRM, timer);
| ^~~~~~~~~~
| ssignal
tftp.c:88:5: warning: nested extern declaration of ‘bsd_signal’ [-Wnested-externs]
main.c: In function ‘main’:
main.c:308:5: warning: implicit declaration of function ‘bsd_signal’; did you mean ‘ssignal’? [-Wimplicit-function-declaration]
308 | bsd_signal(SIGINT, intr);
| ^~~~~~~~~~
| ssignal
main.c:308:5: warning: nested extern declaration of ‘bsd_signal’ [-Wnested-externs]
gcc -g -O2 -W -Wall -Wpointer-arith -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wwrite-strings -Wundef -Wshadow -Wsign-compare -pipe -fno-strict-aliasing -I/tmp/guix-build-tftp-hpa-5.2.drv-0/tftp-hpa-5.2 -c misc.c
sed -e 's/@@VERSION@@/5.2/g' < tftp.1.in > tftp.1
gcc -g -O2 -W -Wall -Wpointer-arith -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wwrite-strings -Wundef -Wshadow -Wsign-compare -pipe -fno-strict-aliasing -I/tmp/guix-build-tftp-hpa-5.2.drv-0/tftp-hpa-5.2 -c remap.c
sed -e 's/@@VERSION@@/5.2/g' < tftpd.8.in > tftpd.8
tftpd.c: In function ‘tftp_recvfile’:
tftpd.c:1647:69: warning: argument ‘oap’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
1647 | static void tftp_recvfile(const struct formats *pf, struct tftphdr *oap, int oacklen)
| ~~~~~~~~~~~~~~~~^~~
main.c:191:20: warning: inlining failed in call to ‘usage’: call is unlikely and code size would grow [-Winline]
191 | static inline void usage(int errcode)
| ^~~~~
main.c:244:25: note: called from here
244 | usage(EX_USAGE);
| ^~~~~~~~~~~~~~~
main.c:191:20: warning: inlining failed in call to ‘usage’: call is unlikely and code size would grow [-Winline]
191 | static inline void usage(int errcode)
| ^~~~~
main.c:266:25: note: called from here
266 | usage(EX_USAGE);
| ^~~~~~~~~~~~~~~
main.c:191:20: warning: inlining failed in call to ‘usage’: call is unlikely and code size would grow [-Winline]
191 | static inline void usage(int errcode)
| ^~~~~
main.c:279:21: note: called from here
279 | usage(*optx == 'h' ? 0 : EX_USAGE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:191:20: warning: inlining failed in call to ‘usage’: call is unlikely and code size would grow [-Winline]
191 | static inline void usage(int errcode)
| ^~~~~
main.c:284:17: note: called from here
284 | usage(EX_USAGE);
| ^~~~~~~~~~~~~~~
gcc tftp.o main.o ../common/libcommon.a /tmp/guix-build-tftp-hpa-5.2.drv-0/tftp-hpa-5.2/lib/libxtra.a -o tftp
ld: main.o:/tmp/guix-build-tftp-hpa-5.2.drv-0/tftp-hpa-5.2/tftp/main.c:98: multiple definition of `toplevel'; tftp.o:/tmp/guix-build-tftp-hpa-5.2.drv-0/tftp-hpa-5.2/tftp/tftp.c:51: first defined here
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:12: tftp] Error 1
make[1]: Leaving directory '/tmp/guix-build-tftp-hpa-5.2.drv-0/tftp-hpa-5.2/tftp'
make: *** [Makefile:7: tftp.build] Error 2
make: *** Waiting for unfinished jobs....
gcc tftpd.o recvfrom.o misc.o remap.o ../common/libcommon.a /tmp/guix-build-tftp-hpa-5.2.drv-0/tftp-hpa-5.2/lib/libxtra.a -o tftpd
make[1]: Leaving directory '/tmp/guix-build-tftp-hpa-5.2.drv-0/tftp-hpa-5.2/tftpd'
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "make" arguments: ("-j" "4") exit-status: 2 term-signal: #f stop-signal: #f>
phase `build' failed after 0.8 seconds
command "make" "-j" "4" failed with status 2
```
Maybe something changed with the compiler which causes `toplevel` to be
defined twice, not sure whether the warnings are relevant. Attaching whole
`/var/log/guix/drvs/n7/mi9pqbpgad3gnz97s02zd056qnzcfg-tftp-hpa-5.2.drv.bz2`.
Thanks a lot!
--
Ivan Vilata i Balaguer -- https://elvil.net/
[-- Attachment #1.2: mi9pqbpgad3gnz97s02zd056qnzcfg-tftp-hpa-5.2.drv.bz2 --]
[-- Type: application/octet-stream, Size: 4892 bytes --]
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#53424: tftp-hpa: Fails to build (multiple definition of 'toplevel' when linking)
2022-01-21 21:06 bug#53424: tftp-hpa: Fails to build (multiple definition of 'toplevel' when linking) Ivan Vilata i Balaguer
@ 2022-01-21 21:20 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2022-01-22 21:08 ` Ivan Vilata i Balaguer
2022-01-21 22:14 ` Maxime Devos
1 sibling, 1 reply; 5+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2022-01-21 21:20 UTC (permalink / raw)
To: Ivan Vilata i Balaguer; +Cc: 53424
[-- Attachment #1: Type: text/plain, Size: 260 bytes --]
Hullo Ivan,
At a glance, this *looks* like what is frequently fixed by adding
‘-fcommon’ to CFLAGS[0]. Worth a try…
Kind regards,
T G-R
[0]:
https://git.savannah.gnu.org/cgit/guix.git/commit/?id=ab5d31c53eb06ced0873599a98c74dba80b46b1e
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#53424: tftp-hpa: Fails to build (multiple definition of 'toplevel' when linking)
2022-01-21 21:06 bug#53424: tftp-hpa: Fails to build (multiple definition of 'toplevel' when linking) Ivan Vilata i Balaguer
2022-01-21 21:20 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
@ 2022-01-21 22:14 ` Maxime Devos
1 sibling, 0 replies; 5+ messages in thread
From: Maxime Devos @ 2022-01-21 22:14 UTC (permalink / raw)
To: Ivan Vilata i Balaguer, 53424
[-- Attachment #1: Type: text/plain, Size: 544 bytes --]
Ivan Vilata i Balaguer schreef op vr 21-01-2022 om 22:06 [+0100]:
> tftp.c:88:5: warning: implicit declaration of function ‘bsd_signal’;
> did you mean ‘ssignal’? [-Wimplicit-function-declaration]
> 88 | bsd_signal(SIGALRM, timer);
> | ^~~~~~~~~~
This one looks like tftp.c forgot to include <signal.h> directly
and relied on another header to include <signal.h>.
It's a warning, not an error, but declarations of functions can
sometimes be important for ABI purposes.
Greetings,
Maxime
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#53424: tftp-hpa: Fails to build (multiple definition of 'toplevel' when linking)
2022-01-21 21:20 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
@ 2022-01-22 21:08 ` Ivan Vilata i Balaguer
2022-01-22 21:39 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
0 siblings, 1 reply; 5+ messages in thread
From: Ivan Vilata i Balaguer @ 2022-01-22 21:08 UTC (permalink / raw)
To: Tobias Geerinckx-Rice; +Cc: 53424
[-- Attachment #1: Type: text/plain, Size: 740 bytes --]
Tobias Geerinckx-Rice (2022-01-21 22:20:15 +0100) wrote:
> Hullo Ivan,
>
> At a glance, this *looks* like what is frequently fixed by adding ‘-fcommon’
> to CFLAGS[0]. Worth a try…
>
> Kind regards,
>
> T G-R
>
> [0]: https://git.savannah.gnu.org/cgit/guix.git/commit/?id=ab5d31c53eb06ced0873599a98c74dba80b46b1e
(Please note that I know very little about the GNU Build System.)
I downloaded the sources with `guix build --source tftp-hpa`, extracted them,
ran `guix environment -C --pure tftp-hpa` and in the environment `./configure
CFLAGS=-fcommon`, then `make` was able to build everything without error,
though warnings were still there.
Cheers,
--
Ivan Vilata i Balaguer -- https://elvil.net/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#53424: tftp-hpa: Fails to build (multiple definition of 'toplevel' when linking)
2022-01-22 21:08 ` Ivan Vilata i Balaguer
@ 2022-01-22 21:39 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
0 siblings, 0 replies; 5+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2022-01-22 21:39 UTC (permalink / raw)
To: Ivan Vilata i Balaguer; +Cc: 53424-done
[-- Attachment #1: Type: text/plain, Size: 286 bytes --]
Hullo again,
I had a minute to spare and pushed the fix to master. Thanks for
the report!
Ivan Vilata i Balaguer 写道:
> (Please note that I know very little about the GNU Build
> System.)
See commit dfc32d8d997da74a6e838b450649bd89905ffdc3 ;-)
Closing,
T G-R
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-01-22 21:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-21 21:06 bug#53424: tftp-hpa: Fails to build (multiple definition of 'toplevel' when linking) Ivan Vilata i Balaguer
2022-01-21 21:20 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2022-01-22 21:08 ` Ivan Vilata i Balaguer
2022-01-22 21:39 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2022-01-21 22:14 ` Maxime Devos
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).