opnsense / ports

OPNsense ports on top of FreeBSD
https://opnsense.org/
Other
163 stars 116 forks source link

Unable to build lsof (and therefore htop) #81

Closed bradleeedmondson closed 4 years ago

bradleeedmondson commented 4 years ago

Running opnsense 19.7.6 on a JBC313U591W-3160-B (Celeron N3160):

OPNsense 19.7.6-amd64
FreeBSD 11.2-RELEASE-p14-HBSD
OpenSSL 1.0.2t 10 Sep 2019 

I'm unable to build lsof:

# /usr/ports/sysutils/lsof
# make install

===>  Building for lsof-4.93.2_5,8
--- version.h ---
--- lib/liblsof.a ---
--- dnode2.o ---
Constructing version.h
--- lib/liblsof.a ---
(cd lib; /usr/bin/make DEBUG="-O2" CFGF="-pipe -DHARDENEDBSD -fPIE -fPIC -fsanitize=safe-stack -fstack-protector-all -fno-strict-aliasing -DHARDENEDBSD -DNEEDS_BOOL_TYPEDEF -DHASTASKS -DHAS_PAUSE_SBT -DHAS_DUP2 -DHAS_CLOSEFROM -DHASEFFNLINK=i_effnlink -DHASF_VNODE -DHAS_FILEDESCENT -DHAS_TMPFS -DHASWCTYPE_H -DHASSBSTATE -DHAS_KVM_VNODE -DHAS_UFS1_2 -DHAS_NO_IDEV -DHAS_VM_MEMATTR_T -DNEEDS_DEVICE_T -DHAS_CDEV2PRIV -DHAS_NO_SI_UDEV -DHAS_SYS_SX_H -DHASFUSEFS -DHAS_ZFS -DHAS_V_LOCKF -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT -DHAS_NO_6PPCB -DNEEDS_BOOLEAN_T -DHAS_SB_CCC -DHAS_FDESCENTTBL -DFREEBSDV=11000 -DHASFDESCFS=2 -DHASPSEUDOFS -DHASNULLFS -DHASIPv6 -DHASUTMPX -DHAS_STRFTIME -DLSOF_VSTR=\"11.2-RELEASE-p14-HBSD\"")
--- usage.o ---
cc  -pipe -DHARDENEDBSD -fPIE -fPIC -fsanitize=safe-stack -fstack-protector-all -fno-strict-aliasing -DHARDENEDBSD -DNEEDS_BOOL_TYPEDEF -DHASTASKS -DHAS_PAUSE_SBT -DHAS_DUP2 -DHAS_CLOSEFROM -DHASEFFNLINK=i_effnlink -DHASF_VNODE -DHAS_FILEDESCENT -DHAS_TMPFS -DHASWCTYPE_H -DHASSBSTATE -DHAS_KVM_VNODE -DHAS_UFS1_2 -DHAS_NO_IDEV -DHAS_VM_MEMATTR_T -DNEEDS_DEVICE_T -DHAS_CDEV2PRIV -DHAS_NO_SI_UDEV -DHAS_SYS_SX_H -DHASFUSEFS -DHAS_ZFS -DHAS_V_LOCKF -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT -DHAS_NO_6PPCB -DNEEDS_BOOLEAN_T -DHAS_SB_CCC -DHAS_FDESCENTTBL -DFREEBSDV=11000 -DHASFDESCFS=2 -DHASPSEUDOFS -DHASNULLFS -DHASIPv6 -DHASUTMPX -DHAS_STRFTIME -DLSOF_VSTR=\"11.2-RELEASE-p14-HBSD\" -I/usr/src/sys -O2 -c usage.c -o usage.o
--- dnode2.o ---
--- dnode2.o ---
cc -pipe -DHARDENEDBSD -fPIE -fPIC -fsanitize=safe-stack -fstack-protector-all -fno-strict-aliasing -DHARDENEDBSD -DNEEDS_BOOL_TYPEDEF -DFREEBSDV=11000 -DHAS_ZFS -DHAS_CV_TIMEDWAIT_SBT -DHAS_V_LOCKF -D_SOLARIS_C_SOURCE -O2 -I/usr/src/sys/cddl/compat/opensolaris -I/usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs -I/usr/src/sys/cddl/contrib/opensolaris/uts/common/zmod -I/usr/src/sys/cddl/contrib/opensolaris/uts/common -I/usr/src/sys/cddl/contrib/opensolaris/common/zfs -I/usr/src/sys/cddl/contrib/opensolaris/common -I/usr/obj/usr/ports/sysutils/lsof/work/lsof-4.93.2/usr/src/include -I`pwd` -c dnode2.c -o dnode2.o
In file included from dnode2.c:56:
In file included from /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h:33:
In file included from /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h:47:
In file included from /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h:72:
/usr/src/sys/cddl/compat/opensolaris/sys/file.h:57:27: error: use of undeclared identifier 'cap_no_rights'; did you mean 'cap_rights'?
        if (fget(curthread, fd, &cap_no_rights, &fp) == 0) {
                                 ^~~~~~~~~~~~~
                                 cap_rights
/usr/include/sys/capsicum.h:365:15: note: 'cap_rights' declared here
cap_rights_t    *cap_rights(struct filedesc *fdp, int fd);
                 ^
In file included from dnode2.c:56:
In file included from /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h:33:
In file included from /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h:47:
In file included from /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h:73:
In file included from /usr/src/sys/cddl/compat/opensolaris/sys/vfs.h:37:
/usr/src/sys/cddl/compat/opensolaris/sys/vnode.h:243:10: warning: implicit declaration of function 'VOP_FSYNC' is invalid in C99 [-Wimplicit-function-declaration]
        error = VOP_FSYNC(vp, MNT_WAIT, curthread);
                ^
1 warning and 1 error generated.
*** [dnode2.o] Error code 1

make[2]: stopped in /usr/obj/usr/ports/sysutils/lsof/work/lsof-4.93.2
1 error

make[2]: stopped in /usr/obj/usr/ports/sysutils/lsof/work/lsof-4.93.2
*** [dnode2.o] Error code 2

make[1]: stopped in /usr/obj/usr/ports/sysutils/lsof/work/lsof-4.93.2
1 error

make[1]: stopped in /usr/obj/usr/ports/sysutils/lsof/work/lsof-4.93.2
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/sysutils/lsof

It looks like lsof is a dependency of htop too (also in sysutils), which is what I'm ultimately trying to build. Is there any way around this?

fichtner commented 4 years ago
# cd /usr/src; git checkout stable/19.7

That should do the trick :)

bradleeedmondson commented 4 years ago

Awesome, that worked. Thank you!

fichtner commented 3 years ago

Due to IRC question about this the canonical way to install lsof nowadays is:

# opnsense-code ports src && cd /usr/ports/sysutils/lsof && make install