Date: Fri, 29 Dec 2023 10:09:07 -0700 From: Warner Losh <imp@bsdimp.com> To: Michael Tuexen <tuexen@freebsd.org> Cc: Konstantin Belousov <kostikbel@gmail.com>, 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: <CANCZdfoPrsQkUekEqpVdf8saXkWq2DOkM57nHEm1dGJyHbM02w@mail.gmail.com> In-Reply-To: <CE216A44-E255-4334-A632-35C4B605D2D2@freebsd.org> 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> <FDE0A068-FBB2-4704-BE58-3E44B048722B@freebsd.org> <CE216A44-E255-4334-A632-35C4B605D2D2@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000ac00cd060da917d5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Dec 29, 2023, 6:52=E2=80=AFAM <tuexen@freebsd.org> wrote: > > > > On Dec 29, 2023, at 14:43, tuexen@freebsd.org wrote: > > > >> On Dec 29, 2023, at 14:07, Konstantin Belousov <kostikbel@gmail.com> > wrote: > >> > >> 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=3Da8b70cf26030d68631200619bd1b0ad= 35b34b6b8 > 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 C9= 9, > or the sys/netinet/tcp.h header should be fixed to use __inline instead. > >>> > >> netinet/tcp.h is required by POSIX, and as far as we support > applications > >> using C89, it must stay C89 compatible. > >> > >> 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=3Da8b70cf26030d68631200619bd1b0ad= 35b34b6b8 > < > 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. > Thinking about it: since we expose the TCP flags to the world, we should > also expose the accessors related to it. > Yea. __inline is the way to go. I should add this test to the includes test we already run at buildworld time... Warner Best regards > Michael > > > > Best regards > > Michael > >> > >>> -Dimitry > >>> > >>>> On 29 Dec 2023, at 13:30, Nuno Teixeira <eduardo@freebsd.org> wrote: > >>>> > >>>> (...) > >>>> -ansi =3D=3D Same as -std=3Dc89 > >>>> > >>>> So it seems correct to remove it when -std=3Dc99 is used. > >>>> > >>>> Nuno Teixeira <eduardo@freebsd.org> escreveu no dia sexta, > 29/12/2023 =C3=A0(s) 12:03: > >>>> > >>>> > >>>> > >>>> I think we have two options: > >>>> 1. Build the ports with a C version of at least C99. > >>>> > >>>> - 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" > >>>> > >>>> Fix build. > >>>> > >>>> Notes: > >>>> > >>>> Adding USE_CSTD=3Dc99 doesn't fix build by itself like we seen on so= me > ports that were fixed by it. > >>>> > >>>> Something have changed from current 1500007 to 1500008. > >>>> > >>>> 2. Remove the inline from tcp_[gs]et_flags(). > >>>> > >>>> Best regards > >>>> Michael > >>>>> -- > >>>>> Nuno Teixeira > >>>>> FreeBSD Committer (ports) > >>>> > >>>> > >>>> > >>>> -- > >>>> Nuno Teixeira > >>>> FreeBSD Committer (ports) > >>>> > >>>> > >>>> -- > >>>> Nuno Teixeira > >>>> FreeBSD Committer (ports) > >>> > >>> > > > > > > > --000000000000ac00cd060da917d5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><div dir=3D"ltr" = class=3D"gmail_attr">On Fri, Dec 29, 2023, 6:52=E2=80=AFAM <<a href=3D"= mailto:tuexen@freebsd.org">tuexen@freebsd.org</a>> wrote:<br></div><bloc= kquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #cc= c solid;padding-left:1ex"><br> <br> > On Dec 29, 2023, at 14:43, <a href=3D"mailto:tuexen@freebsd.org" targe= t=3D"_blank" rel=3D"noreferrer">tuexen@freebsd.org</a> wrote:<br> > <br> >> On Dec 29, 2023, at 14:07, Konstantin Belousov <<a href=3D"mail= to:kostikbel@gmail.com" target=3D"_blank" rel=3D"noreferrer">kostikbel@gmai= l.com</a>> wrote:<br> >> <br> >> On Fri, Dec 29, 2023 at 01:50:34PM +0100, Dimitry Andric wrote:<br= > >>> The problem is really that our kernel headers (those under sys= /) require C99. The only thing that <a href=3D"https://cgit.freebsd.org/src= /commit/?id=3Da8b70cf26030d68631200619bd1b0ad35b34b6b8" rel=3D"noreferrer n= oreferrer" target=3D"_blank">https://cgit.freebsd.org/src/commit/?id=3Da8b7= 0cf26030d68631200619bd1b0ad35b34b6b8</a> did was move two static inline fun= ctions from sys/netinet/tcp_var.h to sys/netinet/tcp.h, and it looks like t= he former header is never directly included by ports. The latter is, so tho= se ports should be switched to C99, or the sys/netinet/tcp.h header should = be fixed to use __inline instead.<br> >>> <br> >> netinet/tcp.h is required by POSIX, and as far as we support appli= cations<br> >> using C89, it must stay C89 compatible.<br> >> <br> >> But why userspace would need these newish accessors at all?=C2=A0 = IMO at least<br> > TCP is now using flags that are not contained in the th_flags field an= ymore,<br> > but also use the th_x2 field.<br> > <br> > People were assuming that all flags are in th_flags and th_x2 is not u= sed and<br> > used it for internal processing. This was causing problems.<br> > <br> > Using the accessor functions hides the split between th_flags and th_x= 2.<br> > See, for example,<br> > <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3Da8b70cf26030d6863= 1200619bd1b0ad35b34b6b8" rel=3D"noreferrer noreferrer" target=3D"_blank">ht= tps://cgit.FreeBSD.org/src/commit/?id=3Da8b70cf26030d68631200619bd1b0ad35b3= 4b6b8</a> <<a href=3D"https://cgit.freebsd.org/src/commit/?id=3Da8b70cf2= 6030d68631200619bd1b0ad35b34b6b8" rel=3D"noreferrer noreferrer" target=3D"_= blank">https://cgit.freebsd.org/src/commit/?id=3Da8b70cf26030d68631200619bd= 1b0ad35b34b6b8</a>><br> >> for userspace they do not add any value except additional namespac= e pollution.<br> >> They should be hidden under #ifdef _KERNEL.<br> > That might be possible. A kernel build with this completes. Haven'= t checked a<br> > buildlworld. Will report when its done.<br> Thinking about it: since we expose the TCP flags to the world, we should<br= > also expose the accessors related to it.<br></blockquote></div></div><div d= ir=3D"auto"><br></div><div dir=3D"auto">Yea. __inline is the way to go.</di= v><div dir=3D"auto"><br></div><div dir=3D"auto">I should add this test to t= he includes test we already run at buildworld time...</div><div dir=3D"auto= "><br></div><div dir=3D"auto">Warner</div><div dir=3D"auto"><br></div><div = dir=3D"auto"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" s= tyle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Best regards<br> Michael<br> > <br> > Best regards<br> > Michael<br> >> <br> >>> -Dimitry<br> >>> <br> >>>> On 29 Dec 2023, at 13:30, Nuno Teixeira <<a href=3D"mai= lto:eduardo@freebsd.org" target=3D"_blank" rel=3D"noreferrer">eduardo@freeb= sd.org</a>> wrote:<br> >>>> <br> >>>> (...)<br> >>>> -ansi =3D=3D Same as -std=3Dc89<br> >>>> <br> >>>> So it seems correct to remove it when -std=3Dc99 is used.<= br> >>>> <br> >>>> Nuno Teixeira <<a href=3D"mailto:eduardo@freebsd.org" t= arget=3D"_blank" rel=3D"noreferrer">eduardo@freebsd.org</a>> escreveu no= dia sexta, 29/12/2023 =C3=A0(s) 12:03:<br> >>>> <br> >>>> <br> >>>> <br> >>>> I think we have two options:<br> >>>> 1. Build the ports with a C version of at least C99.<br> >>>> <br> >>>> - Adding USE_CSTD=3Dc99<br> >>>> - Removing -ansi:<br> >>>> --- configure.orig=C2=A0 =C2=A0 =C2=A02023-12-29 11:54:11 = UTC<br> >>>> +++ configure<br> >>>> -=C2=A0 =C2=A0 CFLAGS=3D"$CFLAGS $(DSO_CFLAGS) -ansi = -Wall"<br> >>>> +=C2=A0 =C2=A0 CFLAGS=3D"$CFLAGS $(DSO_CFLAGS) -Wall&= quot;<br> >>>> <br> >>>> Fix build.<br> >>>> <br> >>>> Notes:<br> >>>> <br> >>>> Adding USE_CSTD=3Dc99 doesn't fix build by itself like= we seen on some ports that were fixed by it.<br> >>>> <br> >>>> Something have changed from current 1500007 to 1500008.<br= > >>>> <br> >>>> 2. Remove the inline from tcp_[gs]et_flags().<br> >>>> <br> >>>> Best regards<br> >>>> Michael<br> >>>>> -- <br> >>>>> Nuno Teixeira<br> >>>>> FreeBSD Committer (ports)<br> >>>> <br> >>>> <br> >>>> <br> >>>> -- <br> >>>> Nuno Teixeira<br> >>>> FreeBSD Committer (ports)<br> >>>> <br> >>>> <br> >>>> -- <br> >>>> Nuno Teixeira<br> >>>> FreeBSD Committer (ports)<br> >>> <br> >>> <br> > <br> > <br> <br> <br> </blockquote></div></div></div> --000000000000ac00cd060da917d5--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfoPrsQkUekEqpVdf8saXkWq2DOkM57nHEm1dGJyHbM02w>