Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Dec 2023 14:43:17 +0100
From:      tuexen@freebsd.org
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Dimitry Andric <dim@freebsd.org>, Nuno Teixeira <eduardo@freebsd.org>, FreeBSD CURRENT <freebsd-current@freebsd.org>
Subject:   Re: devel/nspr: Fails to build on 1500008 5f71f9636efa
Message-ID:  <FDE0A068-FBB2-4704-BE58-3E44B048722B@freebsd.org>
In-Reply-To: <ZY7EqD4QcV1K0zcA@kib.kiev.ua>
References:  <CAFDf7U%2BxbTuhS7nUzeZgVknMPyyfYxuakFtrE4=h-1LtFK_Yig@mail.gmail.com> <9EE91B0D-6CFB-464E-AB9C-3A15D77D55FB@freebsd.org> <CAFDf7UJBY9a=SX_iTE2TOxK_r%2BaK1NDizMdebuYeaL6Zb89QbQ@mail.gmail.com> <CAFDf7ULcNYuD4ZAWXCjgbcWBbdmWw2b0O1vb9phqjXCP5VhpJA@mail.gmail.com> <C5D01D64-82F6-4713-8156-1D3B68D2E1EA@FreeBSD.org> <ZY7EqD4QcV1K0zcA@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
> On Dec 29, 2023, at 14:07, Konstantin Belousov <kostikbel@gmail.com> =
wrote:
>=20
> On Fri, Dec 29, 2023 at 01:50:34PM +0100, Dimitry Andric wrote:
>> The problem is really that our kernel headers (those under sys/) =
require C99. The only thing that =
https://cgit.freebsd.org/src/commit/?id=3Da8b70cf26030d68631200619bd1b0ad3=
5b34b6b8 did was move two static inline functions from =
sys/netinet/tcp_var.h to sys/netinet/tcp.h, and it looks like the former =
header is never directly included by ports. The latter is, so those =
ports should be switched to C99, or the sys/netinet/tcp.h header should =
be fixed to use __inline instead.
>>=20
> netinet/tcp.h is required by POSIX, and as far as we support =
applications
> using C89, it must stay C89 compatible.
>=20
> But why userspace would need these newish accessors at all?  IMO at =
least
TCP is now using flags that are not contained in the th_flags field =
anymore,
but also use the th_x2 field.

People were assuming that all flags are in th_flags and th_x2 is not =
used and
used it for internal processing. This was causing problems.

Using the accessor functions hides the split between th_flags and th_x2.
See, for example,
=
https://cgit.FreeBSD.org/src/commit/?id=3Da8b70cf26030d68631200619bd1b0ad3=
5b34b6b8 =
<https://cgit.freebsd.org/src/commit/?id=3Da8b70cf26030d68631200619bd1b0ad=
35b34b6b8>
> for userspace they do not add any value except additional namespace =
pollution.
> They should be hidden under #ifdef _KERNEL.
That might be possible. A kernel build with this completes. Haven't =
checked a
buildlworld. Will report when its done.

Best regards
Michael
>=20
>> -Dimitry
>>=20
>>> On 29 Dec 2023, at 13:30, Nuno Teixeira <eduardo@freebsd.org> wrote:
>>>=20
>>> (...)
>>> -ansi =3D=3D Same as -std=3Dc89
>>>=20
>>> So it seems correct to remove it when -std=3Dc99 is used.
>>>=20
>>> Nuno Teixeira <eduardo@freebsd.org> escreveu no dia sexta, =
29/12/2023 =C3=A0(s) 12:03:
>>>=20
>>>=20
>>>=20
>>> I think we have two options:
>>> 1. Build the ports with a C version of at least C99.
>>>=20
>>> - Adding USE_CSTD=3Dc99
>>> - Removing -ansi:
>>> --- configure.orig     2023-12-29 11:54:11 UTC
>>> +++ configure
>>> -    CFLAGS=3D"$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
>>> +    CFLAGS=3D"$CFLAGS $(DSO_CFLAGS) -Wall"
>>>=20
>>> Fix build.
>>>=20
>>> Notes:
>>>=20
>>> Adding USE_CSTD=3Dc99 doesn't fix build by itself like we seen on =
some ports that were fixed by it.
>>>=20
>>> Something have changed from current 1500007 to 1500008.
>>>=20
>>>  2. Remove the inline from tcp_[gs]et_flags().
>>>=20
>>> Best regards
>>> Michael
>>>> --=20
>>>> Nuno Teixeira
>>>> FreeBSD Committer (ports)
>>>=20
>>>=20
>>>=20
>>> --=20
>>> Nuno Teixeira
>>> FreeBSD Committer (ports)
>>>=20
>>>=20
>>> --=20
>>> Nuno Teixeira
>>> FreeBSD Committer (ports)
>>=20
>>=20




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FDE0A068-FBB2-4704-BE58-3E44B048722B>