From nobody Fri Dec 29 13:52:14 2023 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T1myr2YLgz568L6 for ; Fri, 29 Dec 2023 13:52:20 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T1myq3Psvz4FFK; Fri, 29 Dec 2023 13:52:19 +0000 (UTC) (envelope-from tuexen@freebsd.org) Authentication-Results: mx1.freebsd.org; dkim=none; spf=softfail (mx1.freebsd.org: 193.175.24.27 is neither permitted nor denied by domain of tuexen@freebsd.org) smtp.mailfrom=tuexen@freebsd.org; dmarc=none Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1140:c3d:d8cb:c5d8:57fa:1e9b]) (Authenticated sender: micmac) by drew.franken.de (Postfix) with ESMTPSA id 53431721E280D; Fri, 29 Dec 2023 14:52:15 +0100 (CET) Content-Type: text/plain; charset=utf-8 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\)) Subject: Re: devel/nspr: Fails to build on 1500008 5f71f9636efa From: tuexen@freebsd.org In-Reply-To: Date: Fri, 29 Dec 2023 14:52:14 +0100 Cc: Dimitry Andric , Nuno Teixeira , FreeBSD CURRENT Content-Transfer-Encoding: quoted-printable Message-Id: References: <9EE91B0D-6CFB-464E-AB9C-3A15D77D55FB@freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.3774.300.61.1.2) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Spamd-Result: default: False [-2.70 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_LOW(-0.10)[193.175.24.27:from]; FREEMAIL_TO(0.00)[gmail.com]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_NO_DN(0.00)[]; ASN(0.00)[asn:680, ipnet:193.174.0.0/15, country:DE]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FREEFALL_USER(0.00)[tuexen]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; DMARC_NA(0.00)[freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; R_SPF_SOFTFAIL(0.00)[~all:c]; ARC_NA(0.00)[] X-Rspamd-Queue-Id: 4T1myq3Psvz4FFK X-Spamd-Bar: -- > On Dec 29, 2023, at 14:43, tuexen@freebsd.org wrote: >=20 >> On Dec 29, 2023, at 14:07, Konstantin Belousov = 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. >=20 > 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. >=20 > 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 = >> 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. Best regards Michael >=20 > Best regards > Michael >>=20 >>> -Dimitry >>>=20 >>>> On 29 Dec 2023, at 13:30, Nuno Teixeira = 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 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 >=20 >=20