Bug 252353 - usr.sbin/bhyve: fail to link WITHOUT_CAPSICUM & WITHOUT_CASPER
Summary: usr.sbin/bhyve: fail to link WITHOUT_CAPSICUM & WITHOUT_CASPER
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Mariusz Zaborski
URL: https://reviews.freebsd.org/D10335
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-02 18:24 UTC by rozhuk.im
Modified: 2021-01-10 15:58 UTC (History)
6 users (show)

See Also:


Attachments
patch (561 bytes, patch)
2021-01-02 19:23 UTC, Mariusz Zaborski
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description rozhuk.im 2021-01-02 18:24:48 UTC
In src.conf:
WITHOUT_CAPSICUM=
WITHOUT_CASPER=


...
===> usr.bin/newkey (all)
ld: error: unable to find library -lcasper
ld: error: unable to find library -lcap_pwd
ld: error: unable to find library -lcap_grp
cc: error: linker command failed with exit code 1 (use -v to see invocation)
--- bhyve ---
*** [bhyve] Error code 1

make[4]: stopped in /usr/src/usr.sbin/bhyve
Comment 1 Mariusz Zaborski freebsd_committer 2021-01-02 19:23:37 UTC
Created attachment 221203 [details]
patch

Hello,

Could you please verify this patch?

Thank you,
Mariusz
Comment 2 commit-hook freebsd_committer 2021-01-03 16:22:39 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=966026246e62769f3bcd8247a47fe0f4f0433aba

commit 966026246e62769f3bcd8247a47fe0f4f0433aba
Author:     Mariusz Zaborski <oshogbo@FreeBSD.org>
AuthorDate: 2021-01-03 16:18:22 +0000
Commit:     Mariusz Zaborski <oshogbo@FreeBSD.org>
CommitDate: 2021-01-03 16:21:28 +0000

    bhyve: fix build without casper/capsicum support

    PR:             252353

 usr.sbin/bhyve/Makefile | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
Comment 3 rozhuk.im 2021-01-04 08:40:44 UTC
Sorry for delay, system was busy by rebuilding all ports.

This is with current main:

===> usr.sbin/wpa/wpa_supplicant (all)
ld: error: /tmp/obj.world/usr/src/amd64.amd64/tmp/usr/lib/lib9p.so: undefined reference to cap_getgrgid_r [--no-allow-shlib-undefined]
ld: error: /tmp/obj.world/usr/src/amd64.amd64/tmp/usr/lib/lib9p.so: undefined reference to cap_getpwuid_r [--no-allow-shlib-undefined]
ld: error: /tmp/obj.world/usr/src/amd64.amd64/tmp/usr/lib/lib9p.so: undefined reference to cap_close [--no-allow-shlib-undefined]
ld: error: /tmp/obj.world/usr/src/amd64.amd64/tmp/usr/lib/lib9p.so: undefined reference to cap_getpwnam [--no-allow-shlib-undefined]
ld: error: /tmp/obj.world/usr/src/amd64.amd64/tmp/usr/lib/lib9p.so: undefined reference to cap_init [--no-allow-shlib-undefined]
ld: error: /tmp/obj.world/usr/src/amd64.amd64/tmp/usr/lib/lib9p.so: undefined reference to cap_service_open [--no-allow-shlib-undefined]
ld: error: /tmp/obj.world/usr/src/amd64.amd64/tmp/usr/lib/lib9p.so: undefined reference to cap_setgroupent [--no-allow-shlib-undefined]
ld: error: /tmp/obj.world/usr/src/amd64.amd64/tmp/usr/lib/lib9p.so: undefined reference to cap_setpassent [--no-allow-shlib-undefined]
cc: error: linker command failed with exit code 1 (use -v to see invocation)
--- bhyve ---
*** [bhyve] Error code 1

make[4]: stopped in /usr/src/usr.sbin/bhyve
Comment 4 commit-hook freebsd_committer 2021-01-04 19:57:43 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=381073282961af9d11d6225fcf9dfdf650915acf

commit 381073282961af9d11d6225fcf9dfdf650915acf
Author:     Mariusz Zaborski <oshogbo@FreeBSD.org>
AuthorDate: 2021-01-04 19:48:48 +0000
Commit:     Mariusz Zaborski <oshogbo@FreeBSD.org>
CommitDate: 2021-01-04 19:48:48 +0000

    lib9p: fix building on systems without capser

    PR:             252353

 lib/lib9p/Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Comment 5 Mariusz Zaborski freebsd_committer 2021-01-04 20:03:03 UTC
Hello,

I just pushed almost are changes that make it possible to build system without Capsicum/Casper (we should remove this options).

The last missing part is in libp9 which is in contrib.
I created a pull request (https://github.com/conclusiveeng/lib9p/pull/16).
I'm not sure if I should commit this change or wait for upstream.

Thanks,
Mariusz

PS. Can I ask why you are building without it?
Comment 6 Ed Maste freebsd_committer 2021-01-04 20:42:15 UTC
> I'm not sure if I should commit this change or wait for upstream.

Generally speaking I think it's fair to commit a change to contrib/ for a build fix as long as there's an upstream report/pull request/patch in the pipeline.
Comment 7 rozhuk.im 2021-01-04 22:06:06 UTC
(In reply to Mariusz Zaborski from comment #5)

Thanks, looks like all OK at this time, no error.

I am prefer to not build staff that I do not use, don't know or don't understand why it may be used for my purposes.
As bonus - less build time required.
My kernel is only 14mb, with all modules - 18mb for server and 45mb for desktop.
Configs: http://www.netlab.linkpc.net/download/software/os_cfg/FBSD/

Capsicum - gives nothing. It is used in few apps that I do not use or that no need to some "extended protection".
I like MAC, but use it time to times, with my custom kernel module to allow raw sockets/broadcasts for unprivileged users (requires for some games under wine).
May be I am wrong, but IMHO MAC can do same and even more than capsicum.
Comment 8 rozhuk.im 2021-01-10 15:56:28 UTC
As I understand all fixes are committed in current and this can be closed.
Do I miss something?
Comment 9 Mariusz Zaborski freebsd_committer 2021-01-10 15:58:14 UTC
Yes. Everything should work.
Thank you for reporting :)