Bug 260094 - git 9e9c651caceb is too ZFS specific
Summary: git 9e9c651caceb is too ZFS specific
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Mark Johnston
Depends on:
Reported: 2021-11-28 14:57 UTC by clbuisson
Modified: 2021-11-29 14:16 UTC (History)
3 users (show)

See Also:

proposed pach to build without zfs (1.73 KB, patch)
2021-11-28 15:08 UTC, clbuisson
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description clbuisson 2021-11-28 14:57:33 UTC

Comment 1 Graham Perrin 2021-11-28 15:01:55 UTC
Let's flesh this out. 

> 9e9c651caceb


> cddl: fix missing ZFS library dependencies
> In 9fae47666 zfsd got a libspl dependency to avoid undefined references.
> However that workaround did not help external consumers of libzfs_core.
> Fix all missing dependencies lld 13 and the rtld complain about.

Comment 2 clbuisson 2021-11-28 15:08:07 UTC
Created attachment 229765 [details]
proposed pach to build without zfs
Comment 3 clbuisson 2021-11-28 15:13:24 UTC
Compiling head with


buildworld is stopped by

building shared library libnvpair.so.2
ld: error: relocation R_X86_64_PC32 cannot be used against symbol __stderrp; rec
ompile with -fPIC
>>> defined in /home/obj/home/src/amd64.amd64/tmp/lib/libc.so.7
>>> referenced by assert.c
>>>               assert.o:(libspl_assertf) in archive /home/obj/home/src/amd64.

but succeed with


I traced the problem to git 9e9c651caceb "cddl: fix missing ZFS library dependencies" (2021/11/15)

builworld succeeds after applying the attached patch
Comment 5 Bjoern A. Zeeb freebsd_committer 2021-11-28 15:19:43 UTC
Looking at your patch however I wonder if these libraries are really not needed for anything else and if they are not then someone should probably indeed hide them behind more #ifdef.
Comment 6 Mark Johnston freebsd_committer 2021-11-29 14:16:38 UTC
I believe this is already fixed by the commit referenced in comment 5.  Please re-open if that does not appear to be the case.

Indeed some of the cddl libraries are, I believe, used only when ZFS is enabled.  That is, dtrace does not make use of libavl, for instance.  I *think* we could disable at least libavl, libnvpair and libuutil when MK_ZFS="no", but I don't have any immediate plan to fix that.