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
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-28 14:57 UTC by clbuisson
Modified: 2021-11-29 14:16 UTC (History)
3 users (show)

See Also:


Attachments
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

<https://cgit.freebsd.org/src/commit/?id=9e9c651caceb9ecd17131e8bb29791ba4cf1cec7>

> 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.

<https://cgit.freebsd.org/src/commit/?id=9fae47666>
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

#WITHOUT_CDDL=
WITHOUT_ZFS=

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.
amd64/tmp/usr/lib/libspl.a
...

but succeed with

#WITHOUT_ZFS=

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.