• Bug#1074938: epic4: ftbfs with GCC-14

    From Niko Tyni@21:1/5 to Matthias Klose on Fri Aug 2 20:00:01 2024
    Control: tag -1 patch

    On Wed, Jul 03, 2024 at 12:25:59PM +0000, Matthias Klose wrote:
    Package: src:epic4
    Version: 1:2.10.10-1.1
    Severity: important
    Tags: sid trixie
    User: debian-gcc@lists.debian.org
    Usertags: ftbfs-gcc-14

    checking whether the C compiler (gcc ) works... no
    configure: error: installation or configuration problem: C compiler cannot create executables.
    make: *** [debian/rules:14: build-stamp] Error 1

    Turns out this was recently broken on sid both by GCC 14 and glibc 2.39.

    The above error is because the generated configure script is outdated
    and fails with GCC 14 due to implicit int types (-Werror=implicit-int).

    This is fixed by the first attached patch, which adds a dh_autoreconf
    call to regenerate the configure script.

    With that, we see

    make[2]: Entering directory '/<<PKGBUILDDIR>>/source'
    gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -I./../include -I../include -c
    alias.c
    In file included from ./../include/irc.h:28,
    from alias.c:39:
    ./../include/irc_std.h:299:8: error: redefinition of ‘struct sockaddr_storage’
    299 | struct sockaddr_storage {
    | ^~~~~~~~~~~~~~~~
    In file included from /usr/include/x86_64-linux-gnu/sys/socket.h:33,
    from ./../include/irc_std.h:52:
    /usr/include/x86_64-linux-gnu/bits/socket.h:196:39: note: originally defined here
    196 | struct __attribute_struct_may_alias__ sockaddr_storage
    | ^~~~~~~~~~~~~~~~
    make[2]: *** [Makefile:31: alias.o] Error 1

    because the configure probe for sockaddr_storage no longer detects it
    properly on glibc >= 2.39. The socket headers in glibc were changed
    to include the may_alias attribute, making the tightly specified
    regex in AC_EGREP_HEADER not match anymore, see

    https://sourceware.org/git/?p=glibc.git;a=commit;h=26e7005728

    The second attached patch relaxes all the AC_EGREP_HEADER regexes
    to allow for other similar changes in the future.

    I have tested that the package builds for me with these, and checked
    that the changed AC_EGREP_HEADER probes get the same result on amd64
    as they did in the last successful buildd log. I have not checked the
    configure results otherwise, and I have not tested the resulting binaries
    in any way.

    Hope this helps,
    --
    Niko Tyni ntyni@debian.org

    From d05f5406b2fe63b7c351906ce275020c0511239d Mon Sep 17 00:00:00 2001
    From: Niko Tyni <ntyni@debian.org>
    Date: Fri, 2 Aug 2024 09:23:23 +0100
    Subject: [PATCH] Run dh_autoreconf before the build

    The bundled configure script fails with GCC 14
    due to implicit int types (-Werror=implicit-int).
    ---
    debian/control | 2 +-
    debian/rules | 1 +
    2 files changed, 2 insertions(+), 1 deletion(-)

    diff --git a/debian/control b/debian/control
    index 42663e2..e7cfc91 100644
    --- a/debian/control
    +++ b/debian/control
    @@ -3,7 +3,7 @@ Section: net
    Priority: optional
    Maintainer: Kurt Roeckx <kurt@roeckx.be>
    Standards-Version: 3.8.3
    -Build-depends: debhelper (>= 5), libncurses5-dev, libssl-dev, libperl-dev +Build-depends: debhelper (>= 5), libncurses5-dev, libssl-dev, libperl-dev, dh-autoreconf
    Homepage: http://www.epicsol.org/

    Package: epic4
    diff --git a/debian/rules b/debian/rules
    index 11a502e..f4ffd5a 100755
    --- a/debian/rules
    +++ b/debian/rules
    @@ -11,6 +11,7 @@ build-arch: build-stamp
    build-indep: build-stamp
    build-stamp:
    dh_testdir
    + dh_autoreconf
    ./configure --prefix=/usr --mandir=/usr/share/man \
    --with-ssl \
    --with-ipv6 \
    --
    2.45.2


    From: Niko Tyni <ntyni@debian.org>
    Date: Fri, 2 Aug 2024 09:31:19 +0100
    X-Dgit-Generated: 1:2.10.10-1.1 0171eb699acbd