Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Mar 2019 00:09:56 -0400
From:      Yoshihiro Ota <ota@j.email.ne.jp>
To:        freebsd-arch@freebsd.org
Cc:        ota@j.email.ne.jp
Subject:   Trying to upgrade zlib in kernel
Message-ID:  <20190326000956.83bd72411661511656ea1b5d@j.email.ne.jp>

next in thread | raw e-mail | index | archive | help
Hello,

Our zlib in kernel has been quite out-dated.
I looked in and started updating.

I use contrib/zlib files and sys/contrib/zstd to compile zlib with least amount of changes to zlib side.
I split crc32 functions and also added few compile options to distinguish zlib calls.
I have to relocate current one as netgraph uses FreeBSD specific implementation.

I started wondering if I should move contrib/zlib to sys/contrib/zlib and wanted to get some feed back on some of coding policies.

I created https://reviews.freebsd.org/D19706, and noted in new sys/sys/zlib.h:
/*
* #1 - sys/crc32.h is split out of sys/libkern.h to avoid conflicts
*      between zlib's crc32 and system crc32.
* #2 - Use contrib/zstd/lib/freebsd's stdlib compatible includes.
* #3 - ZLIB_C is created con/kern.pre.mk to share compile paths.
*        -I contrib/zlib
*        -I sys/contrib/zstd/lib/freebsd
* #4 - sys/zlib.h defines these.
*        Z_PREIFX
*        NO_GZIP
*        Z_SOLO - this is for libkern/zlib.c and not needed for clients of zlib.
* #5 - opencryptodeflate.c
*        zfs.state->dummy is an address and doesn't seem to be useful.
*      Its DTRACE probe is removed.
* #6 - netgraph/deflate.c needs and uses FreeBSD enhancements to zlib.
*        Moved sys/zlib.h to netgraph/zlib.h, sys/libkern/zlib.c to
*      netgraph/zlib.c, and netgraph/deflate.c includes netgraph/zlib.c
*      to compile as a part of deflate.c.
*/

Regards,
Hiro



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190326000956.83bd72411661511656ea1b5d>