From nobody Wed Jul 20 18:06:59 2022 X-Original-To: dev-commits-src-main@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 4Lp3Z74L1bz4WZgf for ; Wed, 20 Jul 2022 18:07:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-vs1-xe36.google.com (mail-vs1-xe36.google.com [IPv6:2607:f8b0:4864:20::e36]) (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 4Lp3Z73qB1z3D6N for ; Wed, 20 Jul 2022 18:07:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-vs1-xe36.google.com with SMTP id s1so17029912vsr.12 for ; Wed, 20 Jul 2022 11:07:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3oPYLr3JCaICeN5g+f2hJWoIBXKISnt2OYy0lCNLLXM=; b=Uxe6OOP2cWRliGro8Iz+3lPQToE59Z08qj2EpPuQ1qgDErbnJCFMIjQGfyL5vCGMVz 0bI4SGw9N+XPkkBLx21eoawioAkXgw2U6opGSn/givNn2bHTCsh8t8tWtfXTi5ncIFi+ iJU7J6gqPlc2JZAMLBJOXtLIDYajzKmo4CuPsusXkIPZSy04QuBqWIiSTBZyReG439Vp 3WY/dQd3cybJJ9hQn8TH7v/zZuCNEsiE9cFgkPYaAOXBDzEHwiPGZrRyUokW7aAr1RFo 4m3U/cZWbttaIrkODTYuJlUkd3aAyiUtb/1tzeFebyUCs+P3Ci6tYtaZWfzSOhABlQ9C GtkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3oPYLr3JCaICeN5g+f2hJWoIBXKISnt2OYy0lCNLLXM=; b=Vmzpb/SCAxFoNL9yG0QlIbxvpbxIiE1DIEE/8hk3oFjjnsMXSVipp6iJ6T/cxTXAmN opobZA8ACfGqmzZ1PxTmdfqrPxfi1DLsqomP0xNsNW68lqIKXWBDpyT5vw9y/srcHsEE TY1JtoYaiynf2TZZ7tbJWw6tDHovDdonzzOw5yEmNW65xYvJ0VkGx/Hlhfh7x81wJwnJ 4VdyKD5nehe1TOr6rhBm6KcWxMmgTb2hWKqQs1rrWd+cjS+GmYnVhBiGEovSMxBQ2E/n TZvSC0I9FZO5MqBS6EOJWqNW1Dzw5pGjt++8GITg3wl6WyHyzS1P4V1+3v5oZuLuOg9L XglQ== X-Gm-Message-State: AJIora+4JcUsaSrKCBJMIOsXfoq8CNUc+OGZq9L7Mb9nAVyIP6fePtjv HRP9hQk3fYsS+GsrHmHBvURJbx/+Xf10sXO5M6cU4Q== X-Google-Smtp-Source: AGRyM1v3gfAKqRf/4kIxKi98Mr6hYZC/rrmuI5Au5SJWQv9vjfjP5daYhWXcfoSv38VBkm6lbCqT79aEYQGvpLDgxR8= X-Received: by 2002:a67:e9cf:0:b0:357:6d9e:d2fb with SMTP id q15-20020a67e9cf000000b003576d9ed2fbmr13376602vso.41.1658340430210; Wed, 20 Jul 2022 11:07:10 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202207081750.268Ho5kZ066824@gitrepo.freebsd.org> <244CD526-C7D0-4D42-9DAB-6EA690DFD3A7@me.com> In-Reply-To: <244CD526-C7D0-4D42-9DAB-6EA690DFD3A7@me.com> From: Warner Losh Date: Wed, 20 Jul 2022 12:06:59 -0600 Message-ID: Subject: Re: git: 84bf2bbbecc3 - main - stand: constrain zlib/gzip CFLAGS better To: Toomas Soome Cc: Dmitry Chagin , Warner Losh , src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="00000000000042817b05e4407856" X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Rspamd-Queue-Id: 4Lp3Z73qB1z3D6N X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --00000000000042817b05e4407856 Content-Type: text/plain; charset="UTF-8" On Wed, Jul 20, 2022 at 11:44 AM Toomas Soome wrote: > > > > On 20. Jul 2022, at 20:24, Dmitry Chagin 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 > >> AuthorDate: 2022-07-08 16:29:25 +0000 > >> Commit: Warner Losh > >> 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. 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 > > --00000000000042817b05e4407856 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Jul 20, 2022 at 11:44 AM Toom= as Soome <tsoome@me.com> wrote:<= br>


> 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: http= s://cgit.FreeBSD.org/src/commit/?id=3D84bf2bbbecc369cea6095bed7a738674b27f8= d13
>>
>> commit 84bf2bbbecc369cea6095bed7a738674b27f8d13
>> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
>> AuthorDate: 2022-07-08 16:29:25 +0000
>> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
>> CommitDate: 2022-07-08 17:47:37 +0000
>>
>>=C2=A0 =C2=A0 stand: constrain zlib/gzip CFLAGS better
>>
>>=C2=A0 =C2=A0 Define ZLIB_CFLAGS and use it only for the sources th= at are in ZLIB or
>>=C2=A0 =C2=A0 that include it.
>>
>>=C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0Netflix
>> ---
>> 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+=3D${i}
>>
>> # decompression functionality from zlib
>> .PATH: ${SRCTOP}/sys/contrib/zlib
>> -CFLAGS+=3D-DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib
>> -SRCS+=3D=C2=A0 =C2=A0 =C2=A0 adler32.c crc32.c
>> -SRCS+=3D=C2=A0 =C2=A0 =C2=A0 infback.c inffast.c inflate.c inftre= es.c zutil.c
>> +ZLIB_CFLAGS=3D-DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib
>> +.for i in adler32.c crc32.c infback.c inffast.c inflate.c inftree= s.c zutil.c
>> +CFLAGS.${i}+=3D${ZLIB_CFLAGS}
>> +SRCS+=3D=C2=A0 =C2=A0 =C2=A0 ${i}
>> +.endfor
>>
>> # lz4 decompression functionality
>> .PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4
>> @@ -168,9 +170,8 @@ SRCS+=3D=C2=A0 =C2=A0time.c
>> .PATH: ${SRCTOP}/sys/ufs/ffs
>> SRCS+=3Dffs_subr.c ffs_tables.c
>>
>> -CFLAGS.dosfs.c+=3D -I${LDRSRC}
>> -CFLAGS.tftp.c+=3D -I${LDRSRC}
>> -CFLAGS.ufs.c+=3D -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 cor= rect, theoretically. However, there's a layering violation that means t= hey are needed so it was premature.

I'll fix a= bandaide=C2=A0and do it better when I return from vacation.

=
Warner
=C2=A0
rgds,
toomas


>
>
>> +CFLAGS.gzipfs.c+=3D ${ZLIB_CFLAGS}
>> +CFLAGS.pkgfs.c+=3D ${ZLIB_CFLAGS}
>> CFLAGS.bzipfs.c+=3D -I${SRCTOP}/contrib/bzip2=C2=A0 -DBZ_NO_STDIO = -DBZ_NO_COMPRESS
>>
>> # explicit_bzero and calculate_crc32c

--00000000000042817b05e4407856--