From nobody Fri Mar 24 09:09:58 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 4PjbyW209Bz41Jtt for ; Fri, 24 Mar 2023 09:10:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PjbyV3ghyz3KGf for ; Fri, 24 Mar 2023 09:10:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20210112.gappssmtp.com header.s=20210112 header.b=s3zPQ3Sz; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2a00:1450:4864:20::529) smtp.mailfrom=wlosh@bsdimp.com; dmarc=none Received: by mail-ed1-x529.google.com with SMTP id eg48so4996543edb.13 for ; Fri, 24 Mar 2023 02:10:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; t=1679649009; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=FFEQVFOm3GWtnJZbONPXk7luISVslfdyp5R3Au6W8Yc=; b=s3zPQ3Szz1xytA95m6U9macIbeg9EqIdN5ALCWe9AsGGToXIjgrqw904t0eaE1BuXI lD9k/+KlC+7T93jcEylaFzDPP7a8OjrEHt1apwvmnR1mhqRUGnnCzTlDMjByoFUviTkk tuvFg/K0l20GiAWh82ASuEG3+raJY3o1isuCu/t65UCOF1cy6W3SkdSnSU4pmgBZaPnN STPgiOJp8g3MuDp5MF85fvDHdmWgJzP+d6hU/DfTnm9xvPIYM1n7lCJwhON5ia7KsjxC E135qKQfzQEYBkkGw0OMhOg+5EwWmb07FtQjx6nBtNG0lbiNGL8k/wlkM0ADJ1WoigoA AtdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679649009; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FFEQVFOm3GWtnJZbONPXk7luISVslfdyp5R3Au6W8Yc=; b=TCZstIE5fWKtt99LOU3XJAHPbHabH+jkWhZVs0rqGAF+CdZ/sovug7i37BI3xGiRdf rlkqI3XXkrOCVxOUetuJ8d/RFihRkqSViK0sx/vqJrOqW3rDd0v9ZAhDrLUlaIJeAie4 jUOVg6SYk9ASZ1CtVHVxbnY3gaORrZZw6kReX2m/nLQKvMzSxgGycCqr2SVnHdIjn7cP kVb+YmzRnCIfOzKEkpxcemnp5nggX3cQwQxtYYnZ3/YQ/Xciy87nhvieE0GjaUY3U1GB dxvy9AlWsu0KZtud9Y25m+3ASPTI3uxPaH8tigJ7ZAVn92X6yt6aj5rdYMzxaYy9A84P 4O3w== X-Gm-Message-State: AAQBX9c3h3Fg/dPecH6f/TN6O+u/z14MGwPjQgPWd9G1nmqAaRdXOfFw bFDDbHrH2aCmy5Zhg1sEXV1FtVPS+tbQpG+iWE4j1ovrGVNVIsb1k9nOp3KE X-Google-Smtp-Source: AKy350YaUfP7XURPSTPxB3KsSW/r8T8g5bvnW476Yb/HEfE+TPQI1qTy8FVNF7Wbw9nsNRrdh085R3h9wf7eKuHhx/U= X-Received: by 2002:a17:906:5fca:b0:930:310:abcf with SMTP id k10-20020a1709065fca00b009300310abcfmr1045648ejv.2.1679649009467; Fri, 24 Mar 2023 02:10:09 -0700 (PDT) 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 References: In-Reply-To: From: Warner Losh Date: Fri, 24 Mar 2023 03:09:58 -0600 Message-ID: Subject: Re: byteswap.h not found on 12 and 13 To: Yuri Cc: Nuno Teixeira , FreeBSD CURRENT , FreeBSD Mailing List Content-Type: multipart/alternative; boundary="0000000000008e93e405f7a1c264" X-Spamd-Result: default: False [-2.97 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.97)[-0.967]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20210112.gappssmtp.com:s=20210112]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::529:from]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MIME_TRACE(0.00)[0:+,1:+,2:~]; R_SPF_NA(0.00)[no SPF record]; ARC_NA(0.00)[]; TO_DN_ALL(0.00)[]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCPT_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20210112.gappssmtp.com:+]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DMARC_NA(0.00)[bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4PjbyV3ghyz3KGf X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N --0000000000008e93e405f7a1c264 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable one last reply, if this is for a port, then byteswap.h can usually be implemented as #include #define __bswap_16(x) __bswap16(x) #define __bswap_32(x) __bswap32(x) #define __bswap_64(x) __bswap64(x) #define bswap_16(x) __bswap16(x) #define bswap_32(x) __bswap32(x) #define bswap_64(x) __bswap64(x) in older versions of FreeBSD, but some tricky software will hate the bswap16 (no underscore) etc defines. You could likely put that into the port. Warner On Fri, Mar 24, 2023 at 3:01=E2=80=AFAM Warner Losh wrote: > And I just looked it up... unlike endian.h, byteswap.h is not in the draf= t > I have of issue 8 posix (due out this year or next, give or take). > > Warner > > On Fri, Mar 24, 2023 at 2:57=E2=80=AFAM Warner Losh wrot= e: > >> Yea, I just committed this >> >> commit 1761b09bf42d2842e82c1ac614c23d31c4d4c0dc >> Author: Warner Losh >> Date: Fri Jan 20 16:33:37 2023 -0700 >> >> byteswap.h: Add a glibc/linux compatible byteswap.h >> >> For endian.h to work instead of sys/endian.h, some software needs >> byteswap.h available. It must define {__,}byteswap_{16,32,64}. >> Included sys/_endian.h to get an appropriate __byteswap16, etc >> and defines the new macros in terms of them. Enhance _endian.h >> to allow it to be included from here too. >> >> Sponsored by: Netflix >> Reviewed by: markj >> Differential Revision: https://reviews.freebsd.org/D32051 >> >> which I MFC'd to 13, but after 13.1R and this isn't a good EN candidate. >> I've not bothered with stable/12 because I'm lame and have stopped MFCin= g >> stuff to it except critical fixes. >> >> Long term: this will make life better. Short term, it's less good since >> we have to still do old-school compatibility. >> >> I likely should write a man page for endian.h and byteswap.h >> >> Warner >> >> On Fri, Mar 24, 2023 at 2:48=E2=80=AFAM Yuri wrote: >> >>> Nuno Teixeira wrote: >>> > Hello Warner, >>> > >>> > My poudriere jails: >>> > --- >>> > 124amd64 12.4-RELEASE-p2 amd64 http 2023-03-17 >>> > 08:04:15 /usr/local/poudriere/jails/124amd64 >>> > 124i386 12.4-RELEASE-p2 i386 http 2023-03-17 >>> > 08:04:38 /usr/local/poudriere/jails/124i386 >>> > 131amd64 13.1-RELEASE-p7 amd64 http 2023-03-17 >>> > 08:05:03 /usr/local/poudriere/jails/131amd64 >>> > --- >>> > >>> > The strange thing is that 5.08 (old version) have #include >>> > too and compiles fine|: >>> > | >>> > https://github.com/sflow/sflowtool/issues/41 >>> > >>> >>> 5.08 seems to have it commented out: >>> >>> sflowtool-5.08/src/sflowtool.c: >>> >>> /* >>> #ifdef DARWIN >>> #include >>> #define bswap_16(x) NXSwapShort(x) >>> #define bswap_32(x) NXSwapInt(x) >>> #else >>> #include >>> #endif >>> */ >>> >>> >>> > Warner Losh > escreveu no dia >>> > sexta, 24/03/2023 =C3=A0(s) 08:30: >>> > >>> > >>> > >>> > On Fri, Mar 24, 2023, 9:23 AM Nuno Teixeira >> > > wrote: >>> > >>> > Hello all, >>> > >>> > I'm getting a file not found on 12 and 13 compiling >>> > net/sflowtool latest update: >>> > It compile fine on 14. >>> > >>> > I've searched 14 src and found: >>> > --- >>> > ./include/byteswap.h >>> > ./contrib/ofed/include/byteswap.h >>> > ./contrib/llvm-project/libcxx/include/__bit/byteswap.h >>> > --- >>> > Any clues? >>> > >>> > >>> > >>> > I added it a short time ago. I thought I mfc'd it to 13 but not 1= 2. >>> > How recent a 13? It's a non standard glibc extension that may be = in >>> > the next posix standard though. I've not looked at the draft for = it >>> > yet to see if it complies or not. >>> > >>> > Warner >>> > >>> > Thanks, >>> > >>> > --- >>> > =3D=3D=3D> Building for sflowtool-6.01 >>> > --- all --- >>> > /usr/bin/make all-recursive >>> > --- all-recursive --- >>> > Making all in src >>> > --- sflowtool.o --- >>> > cc -DHAVE_CONFIG_H -I. -I.. -O2 -pipe >>> > -fstack-protector-strong -fno-strict-aliasing -MT sflowtool.= o >>> > -MD -MP -MF .deps/sflowtool.Tpo -c -o sflowtool.o sflowtool.c >>> > sflowtool.c:32:10: fatal error: 'byteswap.h' file not found >>> > #include >>> > ^~~~~~~~~~~~ >>> > 1 error generated. >>> > *** [sflowtool.o] Error code 1 >>> > --- >>> > >>> > >>> > -- >>> > Nuno Teixeira >>> > FreeBSD Committer (ports) >>> > >>> > >>> > >>> > -- >>> > Nuno Teixeira >>> > FreeBSD Committer (ports) >>> >>> --0000000000008e93e405f7a1c264 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
one last reply, if this is for a port, then byteswap.h can= usually be implemented as

#include <sys/endian.h>=
#define __bswap_16(x) __bswap16(x)
#define __bswap_32(x) __bs= wap32(x)
#define __bswap_64(x) __bswap64(x)

#define bswap_16(x) _= _bswap16(x)
#define bswap_32(x) __bswap32(x)
#define bswap_64(x) __bs= wap64(x)

in older versions of FreeBSD, but som= e tricky software will hate the bswap16 (no underscore) etc defines. You co= uld likely put that into the port.

Warner

On = Fri, Mar 24, 2023 at 3:01=E2=80=AFAM Warner Losh <imp@bsdimp.com> wrote:
And I just looked it up... = unlike endian.h, byteswap.h is not in the draft I have of issue 8 posix (du= e out this year or next, give or take).

Warner
On F= ri, Mar 24, 2023 at 2:57=E2=80=AFAM Warner Losh <imp@bsdimp.com> wrote:
Yea, I just com= mitted this

commit 1761b09bf42d2842e82c1ac614c23d31c4d4c= 0dc
Author: Warner Losh <imp@FreeBSD.org>
Date: =C2=A0 Fri Jan = 20 16:33:37 2023 -0700

=C2=A0 =C2=A0 byteswap.h: Add a glibc/linux c= ompatible byteswap.h

=C2=A0 =C2=A0 For endian.h to work instead of s= ys/endian.h, some software needs
=C2=A0 =C2=A0 byteswap.h available. It = must define {__,}byteswap_{16,32,64}.
=C2=A0 =C2=A0 Included sys/_endian= .h to get an appropriate __byteswap16, etc
=C2=A0 =C2=A0 and defines the= new macros in terms of them. Enhance _endian.h
=C2=A0 =C2=A0 to allow i= t to be included from here too.

=C2=A0 =C2=A0 Sponsored by: =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 Netflix
=C2=A0 =C2=A0 Reviewed by: =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0markj
=C2=A0 =C2=A0 Differential Revis= ion: =C2=A0https://reviews.freebsd.org/D32051

which = I MFC'd to 13, but after 13.1R and this isn't a good EN candidate. = I've not bothered with stable/12 because I'm lame and have stopped = MFCing stuff to it except critical fixes.

Long ter= m: this will make life better. Short term, it's less good since we have= to still do old-school compatibility.

I likely sh= ould write a man page for endian.h and byteswap.h

= Warner

On Fri, Mar 24, 2023 at 2:48=E2=80=AFAM Yuri <yuri@aetern.org> wrote:
Nuno Teixeira wrote:<= br> > Hello Warner,
>
> My poudriere jails:
> ---
> 124amd64 =C2=A0 12.4-RELEASE-p2 =C2=A0 =C2=A0 =C2=A0amd64 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 http =C2=A0 =C2=A0 =C2=A0 =C2=A0 2023-03-17
> 08:04:15 /usr/local/poudriere/jails/124amd64
> 124i386 =C2=A0 =C2=A012.4-RELEASE-p2 =C2=A0 =C2=A0 =C2=A0i386 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0http =C2=A0 =C2=A0 =C2=A0 =C2=A0 2023-03-17
> 08:04:38 /usr/local/poudriere/jails/124i386
> 131amd64 =C2=A0 13.1-RELEASE-p7 =C2=A0 =C2=A0 =C2=A0amd64 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 http =C2=A0 =C2=A0 =C2=A0 =C2=A0 2023-03-17
> 08:05:03 /usr/local/poudriere/jails/131amd64
> ---
>
> The strange thing is that 5.08 (old version) have #include <byteswa= p.h>
> too and compiles fine|:
> |
> https://github.com/sflow/sflowtool/issues/41 > <https://github.com/sflow/sflowtool/issues/41>

5.08 seems to have it commented out:

sflowtool-5.08/src/sflowtool.c:

/*
#ifdef DARWIN
#include <architecture/byte_order.h>
#define bswap_16(x) NXSwapShort(x)
#define bswap_32(x) NXSwapInt(x)
#else
#include <byteswap.h>
#endif
*/


> Warner Losh <
im= p@bsdimp.com <mailto:imp@bsdimp.com>> escreveu no dia
> sexta, 24/03/2023 =C3=A0(s) 08:30:
>
>
>
>=C2=A0 =C2=A0 =C2=A0On Fri, Mar 24, 2023, 9:23 AM Nuno Teixeira <eduardo@freebsd.org
>=C2=A0 =C2=A0 =C2=A0<mailto:
eduardo@freebsd.org>> wrote:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Hello all,
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0I'm getting a file not found on 1= 2 and 13 compiling
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0net/sflowtool latest update:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0It compile fine on 14.
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0I've searched 14 src and found: >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0---
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0./include/byteswap.h
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0./contrib/ofed/include/byteswap.h
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0./contrib/llvm-project/libcxx/include= /__bit/byteswap.h
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0---
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Any clues?
>
>
>
>=C2=A0 =C2=A0 =C2=A0I added it a short time ago. I thought I mfc'd = it to 13 but not 12.
>=C2=A0 =C2=A0 =C2=A0How recent a 13? It's a non standard glibc exte= nsion that may be in
>=C2=A0 =C2=A0 =C2=A0the next posix standard though. I've not looked= at the draft for it
>=C2=A0 =C2=A0 =C2=A0yet to see if it complies or not.
>
>=C2=A0 =C2=A0 =C2=A0Warner
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Thanks,
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0---
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D=3D=3D> =C2=A0Building for sflo= wtool-6.01
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0--- all ---
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/usr/bin/make =C2=A0all-recursive
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0--- all-recursive ---
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Making all in src
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0--- sflowtool.o ---
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cc -DHAVE_CONFIG_H -I. -I.. =C2=A0 = =C2=A0 =C2=A0-O2 -pipe
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0-fstack-protector-strong -fno-s= trict-aliasing -MT sflowtool.o
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-MD -MP -MF .deps/sflowtool.Tpo -c -o= sflowtool.o sflowtool.c
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sflowtool.c:32:10: fatal error: '= byteswap.h' file not found
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0#include <byteswap.h>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^~~= ~~~~~~~~~
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A01 error generated.
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*** [sflowtool.o] Error code 1
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0---
>
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0--
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Nuno Teixeira
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0FreeBSD Committer (ports)
>
>
>
> --
> Nuno Teixeira
> FreeBSD Committer (ports)

--0000000000008e93e405f7a1c264--