Date: Fri, 24 Mar 2023 02:57:43 -0600 From: Warner Losh <imp@bsdimp.com> To: Yuri <yuri@aetern.org> Cc: Nuno Teixeira <eduardo@freebsd.org>, FreeBSD CURRENT <freebsd-current@freebsd.org>, FreeBSD Mailing List <freebsd-ports@freebsd.org> Subject: Re: byteswap.h not found on 12 and 13 Message-ID: <CANCZdfrvHQTZqgGdZjm5Z_fa53g92c_6EHtKZpyRAsKwRsDcLw@mail.gmail.com> In-Reply-To: <ef18fee5-358b-3c19-467b-2fd980dff797@aetern.org> References: <CAFDf7UKq3bMgd3XA0=U10%2BLhOCY7fZCHds9DdBcrSuNidOityw@mail.gmail.com> <CANCZdfpT3nbZ%2BzHHtdsMDa88JsWr7Frw%2BRPGcy6B=P60DZL2_g@mail.gmail.com> <CAFDf7UL=av0KDAw2O3Fmf=x5wThezBokCQ2KHtW6wOZnn43bxQ@mail.gmail.com> <ef18fee5-358b-3c19-467b-2fd980dff797@aetern.org>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
Yea, I just committed this
commit 1761b09bf42d2842e82c1ac614c23d31c4d4c0dc
Author: Warner Losh <imp@FreeBSD.org>
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 MFCing
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 AM Yuri <yuri@aetern.org> 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 <byteswap.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 <imp@bsdimp.com <mailto:imp@bsdimp.com>> escreveu no dia
> > sexta, 24/03/2023 à(s) 08:30:
> >
> >
> >
> > On Fri, Mar 24, 2023, 9:23 AM Nuno Teixeira <eduardo@freebsd.org
> > <mailto:eduardo@freebsd.org>> 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 12.
> > 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,
> >
> > ---
> > ===> 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 <byteswap.h>
> > ^~~~~~~~~~~~
> > 1 error generated.
> > *** [sflowtool.o] Error code 1
> > ---
> >
> >
> > --
> > Nuno Teixeira
> > FreeBSD Committer (ports)
> >
> >
> >
> > --
> > Nuno Teixeira
> > FreeBSD Committer (ports)
>
>
[-- Attachment #2 --]
<div dir="ltr">Yea, I just committed this<div><br></div><div>commit 1761b09bf42d2842e82c1ac614c23d31c4d4c0dc<br>Author: Warner Losh <imp@FreeBSD.org><br>Date: Fri Jan 20 16:33:37 2023 -0700<br><br> byteswap.h: Add a glibc/linux compatible byteswap.h<br><br> For endian.h to work instead of sys/endian.h, some software needs<br> byteswap.h available. It must define {__,}byteswap_{16,32,64}.<br> Included sys/_endian.h to get an appropriate __byteswap16, etc<br> and defines the new macros in terms of them. Enhance _endian.h<br> to allow it to be included from here too.<br><br> Sponsored by: Netflix<br> Reviewed by: markj<br> Differential Revision: <a href="https://reviews.freebsd.org/D32051">https://reviews.freebsd.org/D32051</a><br></div><div><br></div><div>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.</div><div><br></div><div>Long term: this will make life better. Short term, it's less good since we have to still do old-school compatibility.</div><div><br></div><div>I likely should write a man page for endian.h and byteswap.h</div><div><br></div><div>Warner</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 24, 2023 at 2:48 AM Yuri <<a href="mailto:yuri@aetern.org">yuri@aetern.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Nuno Teixeira wrote:<br>
> Hello Warner,<br>
> <br>
> My poudriere jails:<br>
> ---<br>
> 124amd64 12.4-RELEASE-p2 amd64 http 2023-03-17<br>
> 08:04:15 /usr/local/poudriere/jails/124amd64<br>
> 124i386 12.4-RELEASE-p2 i386 http 2023-03-17<br>
> 08:04:38 /usr/local/poudriere/jails/124i386<br>
> 131amd64 13.1-RELEASE-p7 amd64 http 2023-03-17<br>
> 08:05:03 /usr/local/poudriere/jails/131amd64<br>
> ---<br>
> <br>
> The strange thing is that 5.08 (old version) have #include <byteswap.h><br>
> too and compiles fine|:<br>
> |<br>
> <a href="https://github.com/sflow/sflowtool/issues/41" rel="noreferrer" target="_blank">https://github.com/sflow/sflowtool/issues/41</a><br>
> <<a href="https://github.com/sflow/sflowtool/issues/41" rel="noreferrer" target="_blank">https://github.com/sflow/sflowtool/issues/41</a>><br>
<br>
5.08 seems to have it commented out:<br>
<br>
sflowtool-5.08/src/sflowtool.c:<br>
<br>
/*<br>
#ifdef DARWIN<br>
#include <architecture/byte_order.h><br>
#define bswap_16(x) NXSwapShort(x)<br>
#define bswap_32(x) NXSwapInt(x)<br>
#else<br>
#include <byteswap.h><br>
#endif<br>
*/<br>
<br>
<br>
> Warner Losh <<a href="mailto:imp@bsdimp.com" target="_blank">imp@bsdimp.com</a> <mailto:<a href="mailto:imp@bsdimp.com" target="_blank">imp@bsdimp.com</a>>> escreveu no dia<br>
> sexta, 24/03/2023 à(s) 08:30:<br>
> <br>
> <br>
> <br>
> On Fri, Mar 24, 2023, 9:23 AM Nuno Teixeira <<a href="mailto:eduardo@freebsd.org" target="_blank">eduardo@freebsd.org</a><br>
> <mailto:<a href="mailto:eduardo@freebsd.org" target="_blank">eduardo@freebsd.org</a>>> wrote:<br>
> <br>
> Hello all,<br>
> <br>
> I'm getting a file not found on 12 and 13 compiling<br>
> net/sflowtool latest update:<br>
> It compile fine on 14.<br>
> <br>
> I've searched 14 src and found:<br>
> ---<br>
> ./include/byteswap.h<br>
> ./contrib/ofed/include/byteswap.h<br>
> ./contrib/llvm-project/libcxx/include/__bit/byteswap.h<br>
> ---<br>
> Any clues?<br>
> <br>
> <br>
> <br>
> I added it a short time ago. I thought I mfc'd it to 13 but not 12.<br>
> How recent a 13? It's a non standard glibc extension that may be in<br>
> the next posix standard though. I've not looked at the draft for it<br>
> yet to see if it complies or not.<br>
> <br>
> Warner<br>
> <br>
> Thanks,<br>
> <br>
> ---<br>
> ===> Building for sflowtool-6.01<br>
> --- all ---<br>
> /usr/bin/make all-recursive<br>
> --- all-recursive ---<br>
> Making all in src<br>
> --- sflowtool.o ---<br>
> cc -DHAVE_CONFIG_H -I. -I.. -O2 -pipe<br>
> -fstack-protector-strong -fno-strict-aliasing -MT sflowtool.o<br>
> -MD -MP -MF .deps/sflowtool.Tpo -c -o sflowtool.o sflowtool.c<br>
> sflowtool.c:32:10: fatal error: 'byteswap.h' file not found<br>
> #include <byteswap.h><br>
> ^~~~~~~~~~~~<br>
> 1 error generated.<br>
> *** [sflowtool.o] Error code 1<br>
> ---<br>
> <br>
> <br>
> -- <br>
> Nuno Teixeira<br>
> FreeBSD Committer (ports)<br>
> <br>
> <br>
> <br>
> -- <br>
> Nuno Teixeira<br>
> FreeBSD Committer (ports)<br>
<br>
</blockquote></div>
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrvHQTZqgGdZjm5Z_fa53g92c_6EHtKZpyRAsKwRsDcLw>
