Bug 205822 - `options GZIP` and `options ZFS` collide due to inconsistently defined symbols
Summary: `options GZIP` and `options ZFS` collide due to inconsistently defined symbols
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Xin LI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-03 08:54 UTC by Enji Cooper
Modified: 2022-04-10 05:00 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Enji Cooper freebsd_committer freebsd_triage 2016-01-03 08:54:40 UTC
I tried adding `options ZFS` to sys/conf/NOTES as part of r293070 [1], and unfortunately caused build errors with `LINT` because of name collisions between zfs(4) and zlib(9). I reverted the change in r293091 [2].

This bug is being filed to track the issue and (eventually) fix it.

This will likely need to be fixed by consolidating the two copies of zlib into one copy, and might require upgrading zlib in the kernel to something more recent..

1. https://lists.freebsd.org/pipermail/svn-src-head/2016-January/080712.html
2. https://lists.freebsd.org/pipermail/svn-src-head/2016-January/080715.html
Comment 1 Xin LI freebsd_committer freebsd_triage 2019-07-29 06:30:06 UTC
The current plan is to remove the gzipped a.out support which will make this go away.
Comment 2 commit-hook freebsd_committer freebsd_triage 2019-07-30 05:14:03 UTC
A commit references this bug:

Author: delphij
Date: Tue Jul 30 05:13:17 UTC 2019
New revision: 350436
URL: https://svnweb.freebsd.org/changeset/base/350436

Log:
  Remove gzip'ed a.out support.

  The current implementation of gzipped a.out support was based
  on a very old version of InfoZIP which ships with an ancient
  modified version of zlib, and was removed from the GENERIC
  kernel in 1999 when we moved to an ELF world.

  PR:		205822
  Reviewed by:	imp, kib, emaste, Yoshihiro Ota <ota at j.email.ne.jp>
  Relnotes:	yes
  Differential Revision:	https://reviews.freebsd.org/D21099

Changes:
  head/sys/amd64/conf/NOTES
  head/sys/arm/arm/elf_trampoline.c
  head/sys/conf/files
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/i386/conf/NOTES
  head/sys/kern/imgact_gzip.c
  head/sys/kern/subr_inflate.c
  head/sys/sys/inflate.h
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-04-10 05:00:30 UTC
A commit in branch stable/12 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=254a1740cde85300587fcf4e3ad3b91453fa5d09

commit 254a1740cde85300587fcf4e3ad3b91453fa5d09
Author:     Xin LI <delphij@FreeBSD.org>
AuthorDate: 2019-08-25 17:13:00 +0000
Commit:     Xin LI <delphij@FreeBSD.org>
CommitDate: 2022-04-10 04:16:24 +0000

    Unify zlib instances into one.

    This is a cumulative update that consists 14 commits on main by
    Yoshihiro Ota and myself to stable/12:

    Remove gzip'ed a.out support.

    (cherry picked from commit d4565741c6b4b256bd30aea8eb74e8a267cf6b60)

    Delete unneeded #include <sys/inflate.h> from sys/mips.

    (cherry picked from commit 880c6c1b06d203fd6b628d313b5b2658fb7135cb)

    cryptodeflate: Drop z_stream zbuf.state->dummy from SDT probe.

    (cherry picked from commit a49818787d7cff34b9ea9878e37c1c1ba221f081)

    Remove kgzip and kgzldr.

    (cherry picked from commit 5e86bd6073a2fb107318691aaa27b7e19bd45c24)

    Separate kernel crc32() implementation to its own header (gsb_crc32.h) and
    rename the source to gsb_crc32.c.

    (cherry picked from commit f89d2072795407d7c3afff865b988e021c1451a2)

    Allow Kernel to link in both legacy libkern/zlib and new sys/contrib/zlib.

    (cherry picked from commit 0ed1d6fb00b8f22c82c3f9054c6dd16eb12469d2)

    if_mxge: update zlib version 1.0.4 to 1.2.12.

    (cherry picked from commit 1dbf944a91cfccba2c18fa273f69985cd15a5081)

    Expose zlib's utility functions in Z_SOLO library when building kernel.
    This allows kernel code to reuse zlib's implementation.

    (cherry picked from commit a15cb219c6f2b8ed16179c2fce882a2ff327b753)

    Update geom_uzip to use new zlib.

    (cherry picked from commit 2b0cabbdaeac61bdb07909cb0ec995aba36e06b0)

    Update bxe(4) to use new zlib.

    (cherry picked from commit 92e9c0608bf161df04d14160084da2d50bcad30e)

    Convert DDB_CTF to use newer version of ZLIB.

    (cherry picked from commit 22bbc4b24270ec55c267a5b4ca4530991c3da408)

    Convert ng_deflate to use new zlib.

    (cherry picked from commit 34ff55b662d62adea206cb2b77bb064110f68e6d)

    GZIO: Update to use zlib 1.2.12.

    (cherry picked from commit 4e8671dd78cc77b31c598e83354fa6722acd4e3f)

    Remove zlib 1.0.4 from kernel.

    (cherry picked from commit 21aae72489aba9f1711c51672b3003cf8d54965d)

    PR:             205822
    PR:             229763

 ObsoleteFiles.inc                                  |    8 +
 lib/libufs/Makefile                                |    3 +-
 share/man/man4/mxge.4                              |    3 +-
 stand/i386/Makefile                                |    4 -
 stand/i386/kgzldr/Makefile (gone)                  |   20 -
 stand/i386/kgzldr/Makefile.depend (gone)           |   12 -
 stand/i386/kgzldr/boot.c (gone)                    |  129 -
 stand/i386/kgzldr/crt.s (gone)                     |   83 -
 stand/i386/kgzldr/kgzldr.h (gone)                  |   41 -
 stand/i386/kgzldr/lib.c (gone)                     |   88 -
 stand/i386/kgzldr/sio.s (gone)                     |   44 -
 stand/i386/kgzldr/start.s (gone)                   |   45 -
 stand/libsa/crc32_libkern.c                        |    2 +-
 sys/amd64/conf/NOTES                               |    1 -
 sys/arm/arm/elf_trampoline.c (gone)                |  557 --
 .../opensolaris/uts/common/fs/zfs/zfs_ioctl.c      |    1 +
 .../opensolaris/uts/common/zmod/adler32.c (gone)   |  149 -
 .../opensolaris/uts/common/zmod/crc32.h (gone)     |  443 --
 .../opensolaris/uts/common/zmod/deflate.c (gone)   | 1742 -------
 .../opensolaris/uts/common/zmod/deflate.h (gone)   |  331 --
 .../opensolaris/uts/common/zmod/inffast.c (gone)   |  320 --
 .../opensolaris/uts/common/zmod/inffast.h (gone)   |   13 -
 .../opensolaris/uts/common/zmod/inffixed.h (gone)  |   96 -
 .../opensolaris/uts/common/zmod/inflate.c (gone)   | 1395 -----
 .../opensolaris/uts/common/zmod/inflate.h (gone)   |  117 -
 .../opensolaris/uts/common/zmod/inftrees.c (gone)  |  331 --
 .../opensolaris/uts/common/zmod/inftrees.h (gone)  |   57 -
 .../uts/common/zmod/opensolaris_crc32.c (gone)     |  428 --
 .../opensolaris/uts/common/zmod/trees.c (gone)     | 1219 -----
 .../opensolaris/uts/common/zmod/zconf.h (gone)     |  117 -
 .../opensolaris/uts/common/zmod/zlib.h (gone)      | 1359 -----
 .../contrib/opensolaris/uts/common/zmod/zmod.c     |   46 +-
 .../opensolaris/uts/common/zmod/zmod_subr.c (gone) |   66 -
 .../opensolaris/uts/common/zmod/zutil.c (gone)     |  324 --
 .../opensolaris/uts/common/zmod/zutil.h (gone)     |  274 -
 sys/conf/NOTES                                     |    2 +
 sys/conf/files                                     |   41 +-
 sys/conf/files.amd64                               |    1 -
 sys/conf/files.i386                                |    1 -
 sys/contrib/zlib/deflate.c                         |    6 +-
 sys/contrib/zlib/infback.c                         |    4 +-
 sys/contrib/zlib/inflate.c                         |    4 +-
 sys/contrib/zlib/zconf.h                           |   15 +-
 sys/contrib/zlib/zlib.h                            |    5 +-
 sys/contrib/zlib/zutil.h                           |    2 +-
 sys/dev/bxe/bxe.h                                  |    2 +-
 sys/dev/iscsi/icl_soft.c                           |    1 +
 sys/dev/iscsi_initiator/isc_subr.c                 |    1 +
 sys/dev/liquidio/lio_bsd.h                         |    1 +
 sys/dev/mxge/if_mxge.c                             |   23 +-
 sys/dev/usb/net/if_cdce.c                          |    1 +
 sys/dev/usb/net/if_cdceem.c                        |    1 +
 sys/dev/zlib/zcalloc.c (new)                       |   39 +
 sys/dev/zlib/zcalloc.h (new)                       |   14 +
 sys/dev/zlib/zlib_mod.c (new)                      |   53 +
 sys/fs/ext2fs/ext2_csum.c                          |    1 +
 sys/fs/nandfs/nandfs_segment.c                     |    1 +
 sys/fs/nandfs/nandfs_subr.c                        |    1 +
 sys/fs/nandfs/nandfs_vfsops.c                      |    1 +
 sys/geom/part/g_part_bsd64.c                       |    1 +
 sys/geom/part/g_part_gpt.c                         |    1 +
 sys/geom/raid/md_ddf.c                             |    1 +
 sys/geom/uzip/g_uzip_zlib.c                        |   35 +-
 sys/i386/conf/NOTES                                |    1 -
 sys/kern/imgact_gzip.c (gone)                      |  394 --
 sys/kern/kern_ctf.c                                |   18 +-
 sys/kern/link_elf.c                                |    4 -
 sys/kern/link_elf_obj.c                            |    2 +-
 sys/kern/subr_compressor.c                         |    9 +-
 sys/kern/subr_inflate.c (gone)                     | 1084 ----
 sys/libkern/{crc32.c => gsb_crc32.c}               |    1 +
 sys/libkern/x86/crc32_sse42.c                      |    9 +-
 sys/libkern/zlib.c (gone)                          | 5414 --------------------
 sys/mips/mips/elf_trampoline.c                     |    1 -
 sys/modules/geom/geom_uzip/Makefile                |    2 +-
 sys/modules/zfs/Makefile                           |    9 -
 sys/modules/zlib/Makefile                          |   19 +-
 sys/netgraph/ng_deflate.c                          |   97 +-
 sys/netinet/libalias/alias_sctp.c                  |    1 +
 sys/netinet/sctp_crc32.c                           |    1 +
 sys/netpfil/pf/pf.c                                |    1 +
 sys/opencrypto/cryptodeflate.c                     |   97 +-
 sys/opencrypto/deflate.h                           |    4 -
 sys/sys/gsb_crc32.h (new)                          |   47 +
 sys/sys/inflate.h (gone)                           |   53 -
 sys/sys/libkern.h                                  |   33 -
 sys/sys/zlib.h (gone)                              | 1020 ----
 sys/sys/zutil.h (gone)                             |  228 -
 sys/ufs/ffs/ffs_alloc.c                            |    1 +
 sys/ufs/ffs/ffs_snapshot.c                         |    1 +
 sys/ufs/ffs/ffs_subr.c                             |    1 +
 sys/ufs/ffs/ffs_vfsops.c                           |    1 +
 targets/pseudo/userland/Makefile.depend            |    1 -
 targets/pseudo/userland/misc/Makefile.depend       |    2 +-
 tests/sys/kern/Makefile                            |    1 -
 tests/sys/kern/libkern_crc32.c                     |    7 +-
 usr.sbin/Makefile.amd64                            |    1 -
 usr.sbin/Makefile.i386                             |    1 -
 usr.sbin/kgzip/Makefile (gone)                     |    9 -
 usr.sbin/kgzip/Makefile.depend (gone)              |   15 -
 usr.sbin/kgzip/aouthdr.c (gone)                    |   81 -
 usr.sbin/kgzip/aouthdr.h (gone)                    |   61 -
 usr.sbin/kgzip/elfhdr.c (gone)                     |  166 -
 usr.sbin/kgzip/elfhdr.h (gone)                     |   86 -
 usr.sbin/kgzip/kgz.h (gone)                        |   59 -
 usr.sbin/kgzip/kgzcmp.c (gone)                     |  239 -
 usr.sbin/kgzip/kgzip.8 (gone)                      |  156 -
 usr.sbin/kgzip/kgzip.c (gone)                      |  178 -
 usr.sbin/kgzip/kgzip.h (gone)                      |   53 -
 usr.sbin/kgzip/kgzld.c (gone)                      |  103 -
 usr.sbin/kgzip/xio.c (gone)                        |  123 -
 111 files changed, 423 insertions(+), 19599 deletions(-)