This package currently fails to build (at least on the amd64
architecture) with link time optimizations enabled. For a background
for LTO please see
https://wiki.debian.org/ToolChain/LTO
The goal is to enable this optimization by default in an upcoming
Debian release in dpkg-buildflags for 64bit architectures. The goal
is to get this package to build with link time optimizations, or to
explicitly disable link time optimizations for this package build.
To reproduce the build failure, enable the lto optimization in
testing/unstable by adding "optimize=+lto" to DEB_BUILD_MAINT_OPTIONS
in the debian/rules file, or if this macro is unset, just set it:
export DEB_BUILD_MAINT_OPTIONS = optimize=+lto
Please try to fix the build with lto enabled, fixing the packaging or
forwarding the issue upstream. If the issue cannot be fixed,
explicitly disallow building the package with lto by adding to your
rules file:
export DEB_BUILD_MAINT_OPTIONS = optimize=-lto
or adding that string to your existing setting of DEB_BUILD_MAINT_OPTIONS.
The full build log can be found at:
http://qa-logs.debian.net/2022/06/09/dpkglto/ircd-irc2_2.11.2p3~dfsg-7_unstable_dpkglto.log
The last lines of the build log are at the end of this report.
[...]
../ircd/channel.c:3167:22: warning: assignment to ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
3167 | for (; (name = strtoken(&p, parv[1], ",")); parv[1] = NULL)
| ^
../ircd/channel.c: In function ‘m_list’:
../ircd/channel.c:3450:30: warning: assignment to ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
3450 | for (; (name = strtoken(&p, parv[1], ",")); parv[1] = NULL)
| ^
../ircd/channel.c: In function ‘m_names’:
../ircd/channel.c:3661:30: warning: assignment to ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
3661 | for (; (name = strtoken(&p, parv[1], ",")); parv[1] = NULL)
| ^
gcc -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -I. -I../ircd -I../common -c -o class.o ../ircd/class.c
gcc -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -I. -I../ircd -I../common -c -o hash.o ../ircd/hash.c
gcc -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -I. -I../ircd -I../common -DIRCDCONF_PATH="\"/etc/ircd/ircd.conf\"" \
-DIRCDTUNE_PATH="\"/var/run/ircd/ircd.tune\"" \
-DIRCDMOTD_PATH="\"/etc/ircd/ircd.motd\"" \
-DIRCD_PATH="\"/usr/sbin/ircd\"" -DIAUTH_PATH="\"/usr/sbin/iauth\"" \
-DIAUTH="\"iauth\"" -DIRCDDBG_PATH="\"/var/log/ircd/ircd.debug\"" \
-c -o ircd.o ../ircd/ircd.c
../ircd/ircd.c: In function ‘main’:
../ircd/ircd.c:943:15: warning: ignoring return value of ‘setuid’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
943 | (void)setuid((uid_t)euid);
| ^~~~~~~~~~~~~~~~~~~
../ircd/ircd.c: In function ‘ircd_writetune’:
../ircd/ircd.c:1444:15: warning: ignoring return value of ‘truncate’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
1444 | (void)truncate(filename, 0);
| ^~~~~~~~~~~~~~~~~~~~~
../ircd/ircd.c: In function ‘ircd_readtune’:
../ircd/ircd.c:1475:17: warning: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
1475 | read(fd, buf, 100); /* no panic if this fails.. */
| ^~~~~~~~~~~~~~~~~~
gcc -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -I. -I../ircd -I../common -c -o list.o ../ircd/list.c
gcc -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -I. -I../ircd -I../common -c -o res.o ../ircd/res.c
gcc -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -I. -I../ircd -I../common -c -o s_auth.o ../ircd/s_auth.c
../ircd/s_auth.c: In function ‘read_iauth’:
../ircd/s_auth.c:444:55: warning: comparison between pointer and zero character constant [-Wpointer-compare]
444 | if (reason && (reason + 2 != '\0'))
| ^~
../ircd/s_auth.c:444:44: note: did you mean to dereference the pointer?
444 | if (reason && (reason + 2 != '\0'))
| ^
gcc -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -I. -I../ircd -I../common -DIRCDPID_PATH="\"/var/run/ircd/ircd.pid\"" -DIAUTH_PATH="\"/usr/sbin/iauth\"" -DIAUTH="\"iauth\"" -c -o s_bsd.o ../ircd/s_bsd.c
../ircd/s_bsd.c: In function ‘get_my_name’:
../ircd/s_bsd.c:3057:15: warning: implicit declaration of function ‘getipnodebyname’; did you mean ‘getprotobyname’? [-Wimplicit-function-declaration]
3057 | hp1 = getipnodebyname(cname, AF_INET6, AI_DEFAULT, &error_num1);
| ^~~~~~~~~~~~~~~
| getprotobyname
../ircd/s_bsd.c:3057:48: error: ‘AI_DEFAULT’ undeclared (first use in this function); did you mean ‘RES_DEFAULT’?
3057 | hp1 = getipnodebyname(cname, AF_INET6, AI_DEFAULT, &error_num1);
| ^~~~~~~~~~
| RES_DEFAULT
../ircd/s_bsd.c:3057:48: note: each undeclared identifier is reported only once for each function it appears in
../ircd/s_bsd.c:3100:9: warning: implicit declaration of function ‘freehostent’; did you mean ‘gethostent’? [-Wimplicit-function-declaration]
3100 | freehostent(hp1);
| ^~~~~~~~~~~
| gethostent
../ircd/s_bsd.c: In function ‘inetport’:
../ircd/s_bsd.c:313:23: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
313 | (void)write(0, buf, strlen(buf));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
../ircd/s_bsd.c: In function ‘write_pidfile’:
../ircd/s_bsd.c:832:15: warning: ignoring return value of ‘truncate’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
832 | (void)truncate(IRCDPID_PATH, 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [Makefile:349: s_bsd.o] Error 1
make[2]: Leaving directory '/<<PKGBUILDDIR>>/builddir'
make[1]: *** [debian/rules:63: override_dh_auto_build] Error 2
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:39: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2