Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jul 2022 12:20:08 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Toomas Soome <tsoome@me.com>
Cc:        Dmitry Chagin <dchagin@heemeyer.club>, Warner Losh <imp@freebsd.org>,  src-committers <src-committers@freebsd.org>,  "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>, dev-commits-src-main@freebsd.org
Subject:   Re: git: 84bf2bbbecc3 - main - stand: constrain zlib/gzip CFLAGS better
Message-ID:  <CANCZdfpc14U4sA2eX-SYSUC6zY7-0_nSF6AvLOH%2BLiEg08KD-w@mail.gmail.com>
In-Reply-To: <CANCZdfo%2BzQuyr3M0uuBGXEE%2BMp4hiChyzqSAF8icxQwdpeWQyw@mail.gmail.com>
References:  <202207081750.268Ho5kZ066824@gitrepo.freebsd.org> <Ytg6Noc7T8R6sLNy@heemeyer.club> <244CD526-C7D0-4D42-9DAB-6EA690DFD3A7@me.com> <CANCZdfpdKV0%2BaAKUbdVmmCaOjvKPccE1LwUGc8VDjzYVeV-sew@mail.gmail.com> <CANCZdfo%2BzQuyr3M0uuBGXEE%2BMp4hiChyzqSAF8icxQwdpeWQyw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--00000000000056056705e440a765
Content-Type: text/plain; charset="UTF-8"

On Wed, Jul 20, 2022 at 12:12 PM Warner Losh <imp@bsdimp.com> wrote:

>
>
> On Wed, Jul 20, 2022 at 12:06 PM Warner Losh <imp@bsdimp.com> wrote:
>
>>
>>
>> On Wed, Jul 20, 2022 at 11:44 AM Toomas Soome <tsoome@me.com> wrote:
>>
>>>
>>>
>>> > On 20. Jul 2022, at 20:24, Dmitry Chagin <dchagin@heemeyer.club>
>>> wrote:
>>> >
>>> > On Fri, Jul 08, 2022 at 05:50:05PM +0000, Warner Losh wrote:
>>> >> The branch main has been updated by imp:
>>> >>
>>> >> URL:
>>> https://cgit.FreeBSD.org/src/commit/?id=84bf2bbbecc369cea6095bed7a738674b27f8d13
>>> >>
>>> >> commit 84bf2bbbecc369cea6095bed7a738674b27f8d13
>>> >> Author:     Warner Losh <imp@FreeBSD.org>
>>> >> AuthorDate: 2022-07-08 16:29:25 +0000
>>> >> Commit:     Warner Losh <imp@FreeBSD.org>
>>> >> CommitDate: 2022-07-08 17:47:37 +0000
>>> >>
>>> >>    stand: constrain zlib/gzip CFLAGS better
>>> >>
>>> >>    Define ZLIB_CFLAGS and use it only for the sources that are in
>>> ZLIB or
>>> >>    that include it.
>>> >>
>>> >>    Sponsored by:           Netflix
>>> >> ---
>>> >> stand/libsa/Makefile | 13 +++++++------
>>> >> 1 file changed, 7 insertions(+), 6 deletions(-)
>>> >>
>>> >> diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile
>>> >> index b5d800c26295..09637bd5e9d4 100644
>>> >> --- a/stand/libsa/Makefile
>>> >> +++ b/stand/libsa/Makefile
>>> >> @@ -96,9 +96,11 @@ SRCS+=${i}
>>> >>
>>> >> # decompression functionality from zlib
>>> >> .PATH: ${SRCTOP}/sys/contrib/zlib
>>> >> -CFLAGS+=-DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib
>>> >> -SRCS+=      adler32.c crc32.c
>>> >> -SRCS+=      infback.c inffast.c inflate.c inftrees.c zutil.c
>>> >> +ZLIB_CFLAGS=-DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib
>>> >> +.for i in adler32.c crc32.c infback.c inffast.c inflate.c inftrees.c
>>> zutil.c
>>> >> +CFLAGS.${i}+=${ZLIB_CFLAGS}
>>> >> +SRCS+=      ${i}
>>> >> +.endfor
>>> >>
>>> >> # lz4 decompression functionality
>>> >> .PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4
>>> >> @@ -168,9 +170,8 @@ SRCS+=   time.c
>>> >> .PATH: ${SRCTOP}/sys/ufs/ffs
>>> >> SRCS+=ffs_subr.c ffs_tables.c
>>> >>
>>> >> -CFLAGS.dosfs.c+= -I${LDRSRC}
>>> >> -CFLAGS.tftp.c+= -I${LDRSRC}
>>> >> -CFLAGS.ufs.c+= -I${LDRSRC}
>>> > ^^^^^^^^^^^^ is this correct? at least it breaks builds with
>>> > WITHOUT_LOADER_ZFS and WITHOUT_BOOT probably, see PR/260083
>>> >
>>> >
>>>
>>> No, it is not correct.
>>>
>>
>> My change is correct, theoretically. However, there's a layering
>> violation that means they are needed so it was premature.
>>
>> I'll fix a bandaide and do it better when I return from vacation.
>>
>
> Doh! I don't have the right keys loaded in my ssh-agent, so I can't push
> the change because the port forwarding on my router is broken and I can't
> remotely login :(
>
> If someone could commit the change I suggested in
> https://reviews.freebsd.org/D35860 that would be great!
>

The changes were needed, btw, to limit the scope of CFLAGS for the OpenZFS
blake3.c support. However, this one scope limiting shouldn't break that.

Warner


> Warner
>
>
>> Warner
>>
>>
>>> rgds,
>>> toomas
>>>
>>>
>>> >
>>> >
>>> >> +CFLAGS.gzipfs.c+= ${ZLIB_CFLAGS}
>>> >> +CFLAGS.pkgfs.c+= ${ZLIB_CFLAGS}
>>> >> CFLAGS.bzipfs.c+= -I${SRCTOP}/contrib/bzip2  -DBZ_NO_STDIO
>>> -DBZ_NO_COMPRESS
>>> >>
>>> >> # explicit_bzero and calculate_crc32c
>>>
>>>

--00000000000056056705e440a765
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Wed, Jul 20, 2022 at 12:12 PM Warn=
er Losh &lt;<a href=3D"mailto:imp@bsdimp.com">imp@bsdimp.com</a>&gt; wrote:=
<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8=
ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr=
"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote"><div dir=3D"ltr=
" class=3D"gmail_attr">On Wed, Jul 20, 2022 at 12:06 PM Warner Losh &lt;<a =
href=3D"mailto:imp@bsdimp.com" target=3D"_blank">imp@bsdimp.com</a>&gt; wro=
te:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px =
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"=
ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote"><div dir=3D"=
ltr" class=3D"gmail_attr">On Wed, Jul 20, 2022 at 11:44 AM Toomas Soome &lt=
;<a href=3D"mailto:tsoome@me.com" target=3D"_blank">tsoome@me.com</a>&gt; w=
rote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0p=
x 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
&gt; On 20. Jul 2022, at 20:24, Dmitry Chagin &lt;dchagin@heemeyer.club&gt;=
 wrote:<br>
&gt; <br>
&gt; On Fri, Jul 08, 2022 at 05:50:05PM +0000, Warner Losh wrote:<br>
&gt;&gt; The branch main has been updated by imp:<br>
&gt;&gt; <br>
&gt;&gt; URL: <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3D84bf2bbb=
ecc369cea6095bed7a738674b27f8d13" rel=3D"noreferrer" target=3D"_blank">http=
s://cgit.FreeBSD.org/src/commit/?id=3D84bf2bbbecc369cea6095bed7a738674b27f8=
d13</a><br>
&gt;&gt; <br>
&gt;&gt; commit 84bf2bbbecc369cea6095bed7a738674b27f8d13<br>
&gt;&gt; Author:=C2=A0 =C2=A0 =C2=A0Warner Losh &lt;imp@FreeBSD.org&gt;<br>
&gt;&gt; AuthorDate: 2022-07-08 16:29:25 +0000<br>
&gt;&gt; Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh &lt;imp@FreeBSD.org&gt;<br>
&gt;&gt; CommitDate: 2022-07-08 17:47:37 +0000<br>
&gt;&gt; <br>
&gt;&gt;=C2=A0 =C2=A0 stand: constrain zlib/gzip CFLAGS better<br>
&gt;&gt; <br>
&gt;&gt;=C2=A0 =C2=A0 Define ZLIB_CFLAGS and use it only for the sources th=
at are in ZLIB or<br>
&gt;&gt;=C2=A0 =C2=A0 that include it.<br>
&gt;&gt; <br>
&gt;&gt;=C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0Netflix<br>
&gt;&gt; ---<br>
&gt;&gt; stand/libsa/Makefile | 13 +++++++------<br>
&gt;&gt; 1 file changed, 7 insertions(+), 6 deletions(-)<br>
&gt;&gt; <br>
&gt;&gt; diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile<br>
&gt;&gt; index b5d800c26295..09637bd5e9d4 100644<br>
&gt;&gt; --- a/stand/libsa/Makefile<br>
&gt;&gt; +++ b/stand/libsa/Makefile<br>
&gt;&gt; @@ -96,9 +96,11 @@ SRCS+=3D${i}<br>
&gt;&gt; <br>
&gt;&gt; # decompression functionality from zlib<br>
&gt;&gt; .PATH: ${SRCTOP}/sys/contrib/zlib<br>
&gt;&gt; -CFLAGS+=3D-DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib<br>
&gt;&gt; -SRCS+=3D=C2=A0 =C2=A0 =C2=A0 adler32.c crc32.c<br>
&gt;&gt; -SRCS+=3D=C2=A0 =C2=A0 =C2=A0 infback.c inffast.c inflate.c inftre=
es.c zutil.c<br>
&gt;&gt; +ZLIB_CFLAGS=3D-DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib<br>
&gt;&gt; +.for i in adler32.c crc32.c infback.c inffast.c inflate.c inftree=
s.c zutil.c<br>
&gt;&gt; +CFLAGS.${i}+=3D${ZLIB_CFLAGS}<br>
&gt;&gt; +SRCS+=3D=C2=A0 =C2=A0 =C2=A0 ${i}<br>
&gt;&gt; +.endfor<br>
&gt;&gt; <br>
&gt;&gt; # lz4 decompression functionality<br>
&gt;&gt; .PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4<br>
&gt;&gt; @@ -168,9 +170,8 @@ SRCS+=3D=C2=A0 =C2=A0time.c<br>
&gt;&gt; .PATH: ${SRCTOP}/sys/ufs/ffs<br>
&gt;&gt; SRCS+=3Dffs_subr.c ffs_tables.c<br>
&gt;&gt; <br>
&gt;&gt; -CFLAGS.dosfs.c+=3D -I${LDRSRC}<br>
&gt;&gt; -CFLAGS.tftp.c+=3D -I${LDRSRC}<br>
&gt;&gt; -CFLAGS.ufs.c+=3D -I${LDRSRC}<br>
&gt; ^^^^^^^^^^^^ is this correct? at least it breaks builds with<br>
&gt; WITHOUT_LOADER_ZFS and WITHOUT_BOOT probably, see PR/260083<br>
&gt; <br>
&gt; <br>
<br>
No, it is not correct.<br></blockquote><div><br></div><div>My change is cor=
rect, theoretically. However, there&#39;s a layering violation that means t=
hey are needed so it was premature.</div><div><br></div><div>I&#39;ll fix a=
 bandaide=C2=A0and do it better when I return from vacation.</div></div></d=
iv></blockquote><div><br></div><div>Doh! I don&#39;t have the right keys lo=
aded in my ssh-agent, so I can&#39;t push the change because the port forwa=
rding on my router is broken and I can&#39;t remotely login :(</div><div><b=
r></div><div>If someone could commit the change I suggested in=C2=A0<a href=
=3D"https://reviews.freebsd.org/D35860" target=3D"_blank">https://reviews.f=
reebsd.org/D35860</a> that would be great!</div></div></div></blockquote><d=
iv><br></div><div>The changes were needed, btw, to limit the scope of CFLAG=
S for the OpenZFS blake3.c support. However, this one scope limiting should=
n&#39;t break that.</div><div><br></div><div>Warner</div><div>=C2=A0</div><=
blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l=
eft:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div clas=
s=3D"gmail_quote"><div>Warner</div><div>=C2=A0</div><blockquote class=3D"gm=
ail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,=
204,204);padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_quote"><div=
>Warner</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:=
1ex">
rgds,<br>
toomas<br>
<br>
<br>
&gt; <br>
&gt; <br>
&gt;&gt; +CFLAGS.gzipfs.c+=3D ${ZLIB_CFLAGS}<br>
&gt;&gt; +CFLAGS.pkgfs.c+=3D ${ZLIB_CFLAGS}<br>
&gt;&gt; CFLAGS.bzipfs.c+=3D -I${SRCTOP}/contrib/bzip2=C2=A0 -DBZ_NO_STDIO =
-DBZ_NO_COMPRESS<br>
&gt;&gt; <br>
&gt;&gt; # explicit_bzero and calculate_crc32c<br>
<br>
</blockquote></div></div>
</blockquote></div></div>
</blockquote></div></div>

--00000000000056056705e440a765--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfpc14U4sA2eX-SYSUC6zY7-0_nSF6AvLOH%2BLiEg08KD-w>