Re: git: 84bf2bbbecc3 - main - stand: constrain zlib/gzip CFLAGS better

From: Warner Losh <imp_at_bsdimp.com>
Date: Wed, 20 Jul 2022 18:05:33 UTC
Yea, I know. I proposed a change to jhb when he spotted this yesterday.

The problem is that the universe building tool didn't build w/o boot.

The problem is that anything at all uses stand/common as its include path.
I'll fix that bigger problem later.

And ZFS shouldn't unconditionally include CFLAGS, but should only do it for
ZFS files. I'll fix that later.

Warner

On Wed, Jul 20, 2022 at 11:24 AM 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
>
>
>
>
> > +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
>