• Weird bug (maybe in clang - inetd.c does not compile without INET6)

    From Milan Obuch@freebsd-stable@dino.sk to muc.lists.freebsd.stable on Mon Aug 17 10:21:43 2026
    From Newsgroup: muc.lists.freebsd.stable

    This is a MIME-formatted message. If you see this text it means that your E-mail software does not support MIME-formatted messages.

    --=_cm0.netlabit.sk-56257-1786954905-0001-2
    Content-Type: text/plain; charset=us-ascii
    Content-Transfer-Encoding: 7bit
    Content-Disposition: inline

    Hi,

    I am building my systems from source and usually with WITHOUT_INET6
    knob among others. Partly inertia, partly minimalisation, partly
    speedup. At the moment, my boxes are at 15-STABLE, last working build
    is from May 30, 2026, git hash cfbe04310e254890c471f97f03dc7c3c5e9af01c
    - that's with compiler

    # cc -v
    FreeBSD clang version 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2)

    Then new LLVM is being imported, builds do not work with error

    ---- 8< ------------------------------------------------------------

    usr.bin/clang/llvm-min-tblgen (obj,all,install)
    make[3]: don't know how to make TableGen.cpp. Stop

    make[3]: stopped making "all" in /usr/src/usr.bin/clang/llvm-min-tblgen
    *** Error code 2

    Stop.
    make[2]: stopped making "bootstrap-tools" in /usr/src
    0.40 real 0.16 user 0.04 sys
    *** Error code 1

    Stop.
    make[1]: stopped making "buildworld" in /usr/src
    *** Error code 1

    Stop.
    make: stopped making "buildworld" in /usr/src

    ---- 8< ------------------------------------------------------------

    for commits 0008bdb8bd28d1c15670084ca63015b551a33f76, c76ec29427955975909939e41052e19d000cf008, 85298a854720b7e712d4500b8d6ca340f6c39dd8, 4575fcccafed03e93f306ddd287229c4568e7280 - import was divided into more commits.

    Next commits does not build as well, with different error:

    ---- 8< ------------------------------------------------------------

    In file included from
    /usr/src/contrib/llvm-project/libcxx/src/algorithm.cpp:9: In file
    included from
    /usr/src/contrib/llvm-project/libcxx/include/algorithm:1865: In file
    included from /usr/src/contrib/llvm-project/libcxx/include/__algorithm/inplace_merge.h:27:
    In file included from /usr/src/contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:48: /usr/src/contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h:9:2: error: unterminated conditional directive 9 | #ifndef _LIBCPP___TYPE_TRAITS_REMOVE_EXTENT_H | ^ 3 errors generated. ***
    Error code 1

    Stop.
    make[4]: stopped making "all" in /usr/src/lib/libc++
    *** Error code 1

    Stop.
    make[3]: stopped making "_prebuild_libs" in /usr/src
    *** Error code 1

    Stop.
    make[2]: stopped making "libraries" in /usr/src
    8.67 real 6.56 user 0.65 sys
    *** Error code 1

    Stop.
    make[1]: stopped making "buildworld" in /usr/src
    *** Error code 1

    Stop.
    make: stopped making "buildworld" in /usr/src

    ---- 8< ------------------------------------------------------------

    Commits were fe97aeb6c4fb57f9cd3ae834e66d85bcb36b91ee, cf7d88e89f1dcc1b66c3e8f327e16122d42d6a6c, d08fb64ae2157d3bc65777589728e880e6409d72, c1db7ad65d704e4ae81bbfe7bdaf049120d324a2 - I think with those import of
    new LLVM is being finished.

    Now, one could expect things going back to normal, but for me, with WITHOUT_INET6 knob in action, did not work, the error is

    ---- 8< ------------------------------------------------------------

    usr.sbin/inetd (all)
    cc -target x86_64-unknown-freebsd15.1 --sysroot=/usr/obj/usr/src/amd64.amd64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -fpie -DPIC -O2 -pipe
    -fno-common -DLOGIN_CAP -DLIBWRAP -DIPSEC -fPIE -ffile-prefix-map=/usr/src=/usr/src
    -ffile-prefix-map=/usr/obj/usr/src=/usr/obj -MD -MF.depend.inetd.pieo -MTinetd.pieo -std=gnu17 -Wno-format-zero-length
    -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k
    -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch
    -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts
    -Wnested-externs -Wold-style-definition -Wno-pointer-sign -Wdate-time -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-parameter
    -Wno-error=cast-function-type-mismatch -Qunused-arguments -c /usr/src/usr.sbin/inetd/inetd.c -o inetd.pieo /usr/src/usr.sbin/inetd/inetd.c:737:26: warning: cast from 'struct
    servtab *(*)(int)' to 'bi_fn_t *' (aka 'void (*)(int, struct servtab
    *)') converts to incompatible function type
    [-Wcast-function-type-mismatch] 737 |
    sep->se_bi->bi_fn == (bi_fn_t *) tcpmux) { |
    ^~~~~~~~~~~~~~~~~~ /usr/src/usr.sbin/inetd/inetd.c:1365:44: error: variable 'nbuf2' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] 1365 |
    rpcb_set(sep->se_rpc_prog, i, netid2, &nbuf2); |
    ^~~~~ 1 warning
    and 1 error generated. *** Error code 1

    Stop.
    make[4]: stopped making "all" in /usr/src/usr.sbin/inetd
    *** Error code 1

    Stop.
    make[3]: stopped making "all" in /usr/src/usr.sbin
    *** Error code 1

    Stop.
    make[2]: stopped making "all" in /usr/src
    39.48 real 17.22 user 3.71 sys
    *** Error code 1

    Stop.
    make[1]: stopped making "buildworld" in /usr/src
    *** Error code 1

    Stop.
    make: stopped making "buildworld" in /usr/src

    ---- 8< ------------------------------------------------------------

    The error points to function setup, which, after looking into it,
    should compile just fine when INET6 is not defined, but, for some
    reason not known to me, does not. There was no change in inetd.c source
    file, compiler was changed, it is now

    # cc -v
    FreeBSD clang version 21.1.7 (https://github.com/llvm/llvm-project.git llvmorg-21.1.7-0-gcd708029e0b2)

    I used simple 'brute force' patch for this, see attachment, which
    allowed me to finish the build process and after installing run the
    resulting system as usual.

    Addition:

    I tried with recent trees as well, yesterday's commit cfc5ebfeb889a0e894f94bfe45ee1ba4338ececb and today's commit f310b83defebddcb0fab9fbb4d9629ea8d0a2f04, with the same result -
    inetd.c does not compile, even when using newer clang

    # cc -v
    FreeBSD clang version 21.1.8 (https://github.com/llvm/llvm-project.git llvmorg-21.1.8-0-g2078da43e25a)

    Applying my patch solves the issue.

    Conclusion:

    I think we either have a bug in clang toolchain - I see the file being succesfully compiled with older clang, and working, or newer clang
    shows more problem tan older one, and then polishing and applying my
    patch is appropriate. While I work with 15-STABLE sources, I verified
    the file inetd.c is exactly the same in CURRENT sources.

    Regards,
    Milan

    --=_cm0.netlabit.sk-56257-1786954905-0001-2
    Content-Type: text/x-patch; charset=utf-8
    Content-Transfer-Encoding: 7bit
    Content-Disposition: attachment; filename=patch-inetd.c

    --- inetd.c.orig 2026-08-14 19:10:15.866775000 +0200
    +++ inetd.c 2026-08-16 17:13:16.947397000 +0200
    @@ -1315,11 +1315,15 @@
    if (sep->se_rpc) {
    u_int i;
    socklen_t len = sep->se_ctrladdr_size;
    - struct netconfig *netid, *netid2 = NULL;
    + struct netconfig *netid;
    #ifdef INET6
    + struct netconfig *netid2 = NULL;
    struct sockaddr_in sock;
    #endif
    - struct netbuf nbuf, nbuf2;
    + struct netbuf nbuf;
    +#ifdef INET6
    + struct netbuf nbuf2;
    +#endif

    if (getsockname(sep->se_fd,
    (struct sockaddr*)&sep->se_ctrladdr, &len) < 0){
    @@ -1360,10 +1364,12 @@
    for (i = sep->se_rpc_lowvers; i <= sep->se_rpc_highvers; i++) {
    rpcb_unset(sep->se_rpc_prog, i, netid);
    rpcb_set(sep->se_rpc_prog, i, netid, &nbuf);
    +#ifdef INET6
    if (netid2) {
    rpcb_unset(sep->se_rpc_prog, i, netid2);
    rpcb_set(sep->se_rpc_prog, i, netid2, &nbuf2);
    }
    +#endif
    }
    }
    if (sep->se_socktype == SOCK_STREAM)

    --=_cm0.netlabit.sk-56257-1786954905-0001-2--


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Dimitry Andric@dim@FreeBSD.org to muc.lists.freebsd.stable on Mon Aug 17 11:01:12 2026
    From Newsgroup: muc.lists.freebsd.stable

    On 17 Aug 2026, at 10:21, Milan Obuch <freebsd-stable@dino.sk> wrote:

    I am building my systems from source and usually with WITHOUT_INET6
    knob among others. Partly inertia, partly minimalisation, partly
    speedup. At the moment, my boxes are at 15-STABLE, last working build
    is from May 30, 2026, git hash cfbe04310e254890c471f97f03dc7c3c5e9af01c
    - that's with compiler

    # cc -v
    FreeBSD clang version 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2)

    Then new LLVM is being imported, builds do not work with error

    ---- 8< ------------------------------------------------------------

    usr.bin/clang/llvm-min-tblgen (obj,all,install)
    make[3]: don't know how to make TableGen.cpp. Stop

    make[3]: stopped making "all" in /usr/src/usr.bin/clang/llvm-min-tblgen
    *** Error code 2

    Stop.
    make[2]: stopped making "bootstrap-tools" in /usr/src
    0.40 real 0.16 user 0.04 sys
    *** Error code 1

    Stop.
    make[1]: stopped making "buildworld" in /usr/src
    *** Error code 1

    Stop.
    make: stopped making "buildworld" in /usr/src

    ---- 8< ------------------------------------------------------------

    for commits 0008bdb8bd28d1c15670084ca63015b551a33f76, c76ec29427955975909939e41052e19d000cf008, 85298a854720b7e712d4500b8d6ca340f6c39dd8, 4575fcccafed03e93f306ddd287229c4568e7280 - import was divided into more commits.

    Next commits does not build as well, with different error:

    ---- 8< ------------------------------------------------------------

    In file included from /usr/src/contrib/llvm-project/libcxx/src/algorithm.cpp:9: In file
    included from
    /usr/src/contrib/llvm-project/libcxx/include/algorithm:1865: In file
    included from /usr/src/contrib/llvm-project/libcxx/include/__algorithm/inplace_merge.h:27: In file included from /usr/src/contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:48: /usr/src/contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h:9:2:
    error: unterminated conditional directive 9 | #ifndef _LIBCPP___TYPE_TRAITS_REMOVE_EXTENT_H | ^ 3 errors generated. ***
    Error code 1

    Stop.
    make[4]: stopped making "all" in /usr/src/lib/libc++
    *** Error code 1

    Stop.
    make[3]: stopped making "_prebuild_libs" in /usr/src
    *** Error code 1

    Stop.
    make[2]: stopped making "libraries" in /usr/src
    8.67 real 6.56 user 0.65 sys
    *** Error code 1

    Stop.
    make[1]: stopped making "buildworld" in /usr/src
    *** Error code 1

    Stop.
    make: stopped making "buildworld" in /usr/src

    ---- 8< ------------------------------------------------------------

    Commits were fe97aeb6c4fb57f9cd3ae834e66d85bcb36b91ee, cf7d88e89f1dcc1b66c3e8f327e16122d42d6a6c, d08fb64ae2157d3bc65777589728e880e6409d72, c1db7ad65d704e4ae81bbfe7bdaf049120d324a2 - I think with those import of
    new LLVM is being finished.
    Yeah, don't try to build the intermediate commits. I was not able to test all possible combinations, while wrestling with git.
    Now, one could expect things going back to normal, but for me, with WITHOUT_INET6 knob in action, did not work, the error is

    ---- 8< ------------------------------------------------------------

    usr.sbin/inetd (all)
    cc -target x86_64-unknown-freebsd15.1 --sysroot=/usr/obj/usr/src/amd64.amd64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -fpie -DPIC -O2 -pipe -fno-common -DLOGIN_CAP -DLIBWRAP -DIPSEC -fPIE -ffile-prefix-map=/usr/src=/usr/src -ffile-prefix-map=/usr/obj/usr/src=/usr/obj -MD -MF.depend.inetd.pieo -MTinetd.pieo -std=gnu17 -Wno-format-zero-length
    -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k
    -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch
    -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts
    -Wnested-externs -Wold-style-definition -Wno-pointer-sign -Wdate-time -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-parameter
    -Wno-error=cast-function-type-mismatch -Qunused-arguments -c /usr/src/usr.sbin/inetd/inetd.c -o inetd.pieo /usr/src/usr.sbin/inetd/inetd.c:737:26: warning: cast from 'struct
    servtab *(*)(int)' to 'bi_fn_t *' (aka 'void (*)(int, struct servtab
    *)') converts to incompatible function type
    [-Wcast-function-type-mismatch] 737 |
    sep->se_bi->bi_fn == (bi_fn_t *) tcpmux) { |
    ^~~~~~~~~~~~~~~~~~ /usr/src/usr.sbin/inetd/inetd.c:1365:44: error: variable 'nbuf2' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] 1365 |
    rpcb_set(sep->se_rpc_prog, i, netid2, &nbuf2); |
    ^~~~~ 1 warning
    This just looks like a warning which is only produced when INET6 is off. I don't know much about inetd, but with #ifdef mazes something always goes wrong. :)
    -Dimitry
    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Milan Obuch@freebsd-stable@dino.sk to muc.lists.freebsd.stable on Mon Aug 17 11:14:37 2026
    From Newsgroup: muc.lists.freebsd.stable

    On Mon, 17 Aug 2026 11:01:12 +0200
    Dimitry Andric <dim@FreeBSD.org> wrote:

    On 17 Aug 2026, at 10:21, Milan Obuch <freebsd-stable@dino.sk> wrote:

    I am building my systems from source and usually with WITHOUT_INET6
    knob among others. Partly inertia, partly minimalisation, partly
    speedup. At the moment, my boxes are at 15-STABLE, last working
    build is from May 30, 2026, git hash cfbe04310e254890c471f97f03dc7c3c5e9af01c
    - that's with compiler

    # cc -v
    FreeBSD clang version 19.1.7
    (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2)

    Then new LLVM is being imported, builds do not work with error

    ---- 8< ------------------------------------------------------------

    usr.bin/clang/llvm-min-tblgen (obj,all,install)
    make[3]: don't know how to make TableGen.cpp. Stop

    make[3]: stopped making "all" in
    /usr/src/usr.bin/clang/llvm-min-tblgen *** Error code 2

    Stop.
    make[2]: stopped making "bootstrap-tools" in /usr/src
    0.40 real 0.16 user 0.04 sys
    *** Error code 1

    Stop.
    make[1]: stopped making "buildworld" in /usr/src
    *** Error code 1

    Stop.
    make: stopped making "buildworld" in /usr/src

    ---- 8< ------------------------------------------------------------

    for commits 0008bdb8bd28d1c15670084ca63015b551a33f76, c76ec29427955975909939e41052e19d000cf008, 85298a854720b7e712d4500b8d6ca340f6c39dd8, 4575fcccafed03e93f306ddd287229c4568e7280 - import was divided into
    more commits.

    Next commits does not build as well, with different error:

    ---- 8< ------------------------------------------------------------

    In file included from /usr/src/contrib/llvm-project/libcxx/src/algorithm.cpp:9: In file
    included from
    /usr/src/contrib/llvm-project/libcxx/include/algorithm:1865: In file included from /usr/src/contrib/llvm-project/libcxx/include/__algorithm/inplace_merge.h:27:
    In file included from /usr/src/contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:48: /usr/src/contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h:9:2:
    error: unterminated conditional directive 9 | #ifndef _LIBCPP___TYPE_TRAITS_REMOVE_EXTENT_H | ^ 3 errors generated. ***
    Error code 1

    Stop.
    make[4]: stopped making "all" in /usr/src/lib/libc++
    *** Error code 1

    Stop.
    make[3]: stopped making "_prebuild_libs" in /usr/src
    *** Error code 1

    Stop.
    make[2]: stopped making "libraries" in /usr/src
    8.67 real 6.56 user 0.65 sys
    *** Error code 1

    Stop.
    make[1]: stopped making "buildworld" in /usr/src
    *** Error code 1

    Stop.
    make: stopped making "buildworld" in /usr/src

    ---- 8< ------------------------------------------------------------

    Commits were fe97aeb6c4fb57f9cd3ae834e66d85bcb36b91ee, cf7d88e89f1dcc1b66c3e8f327e16122d42d6a6c, d08fb64ae2157d3bc65777589728e880e6409d72, c1db7ad65d704e4ae81bbfe7bdaf049120d324a2 - I think with those
    import of new LLVM is being finished.

    Yeah, don't try to build the intermediate commits. I was not able to
    test all possible combinations, while wrestling with git.


    I was just trying to pinpoint the issue. I did not understand
    everything at start, I just did see a breakage. I tried to find the
    exact point where it occured.

    Now, one could expect things going back to normal, but for me, with WITHOUT_INET6 knob in action, did not work, the error is

    ---- 8< ------------------------------------------------------------

    usr.sbin/inetd (all)
    cc -target x86_64-unknown-freebsd15.1 --sysroot=/usr/obj/usr/src/amd64.amd64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -fpie -DPIC -O2 -pipe -fno-common -DLOGIN_CAP -DLIBWRAP -DIPSEC -fPIE -ffile-prefix-map=/usr/src=/usr/src -ffile-prefix-map=/usr/obj/usr/src=/usr/obj -MD
    -MF.depend.inetd.pieo -MTinetd.pieo -std=gnu17
    -Wno-format-zero-length -fstack-protector-strong -Wsystem-headers
    -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter
    -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
    -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Wnested-externs -Wold-style-definition -Wno-pointer-sign -Wdate-time -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-parameter
    -Wno-error=cast-function-type-mismatch -Qunused-arguments -c /usr/src/usr.sbin/inetd/inetd.c -o inetd.pieo /usr/src/usr.sbin/inetd/inetd.c:737:26: warning: cast from 'struct
    servtab *(*)(int)' to 'bi_fn_t *' (aka 'void (*)(int, struct
    servtab *)') converts to incompatible function type [-Wcast-function-type-mismatch] 737 | sep->se_bi->bi_fn == (bi_fn_t
    *) tcpmux) { | ^~~~~~~~~~~~~~~~~~
    /usr/src/usr.sbin/inetd/inetd.c:1365:44: error: variable 'nbuf2' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] 1365 |
    rpcb_set(sep->se_rpc_prog, i, netid2, &nbuf2); |
    ^~~~~ 1
    warning

    This just looks like a warning which is only produced when INET6 is
    off. I don't know much about inetd, but with #ifdef mazes something
    always goes wrong. :)

    Quote from above:

    /usr/src/usr.sbin/inetd/inetd.c:1365:44: error: variable 'nbuf2' is uninitialized when passed as a const pointer argument here

    It clearly states 'error' and build process is stopped here. It is not
    a harmless warning basically not affecting the process...

    Regards,
    Milan


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.22a-Linux NewsLink 1.2