Bug 240349 - sysutils/lsof: Build fails on 13-CURRENT after base r351594
Summary: sysutils/lsof: Build fails on 13-CURRENT after base r351594
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Larry Rosenman
URL:
Keywords: needs-qa, regression
Depends on:
Blocks:
 
Reported: 2019-09-05 09:59 UTC by Yasuhiro KIMURA
Modified: 2019-09-11 09:51 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (ler)


Attachments
Patch file (795 bytes, patch)
2019-09-11 09:51 UTC, Yasuhiro KIMURA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yasuhiro KIMURA 2019-09-05 09:59:27 UTC
After base r351594 build fails on 13-CURRENT as following.

===>  Building for lsof-4.93.2_4,8                                                                                           (cd lib; /usr/bin/make DEBUG="-O2" CFGF="-pipe -fstack-protector-strong -fno-strict-aliasing -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=13000 -DHASFDESCFS=2 -DHASPSEUDOFS -DHASNULLFS -DHASIPv6 -DHASUTMPX -DHAS_STRFTIME -DLSOF_VSTR=\"13.0-CURRENT\"")                                                                                                       cc   -pipe -fstack-protector-strong -fno-strict-aliasing -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=13000 -DHASFDESCFS=2 -DHASPSEUDOFS -DHASNULLFS -DHASIPv6 -DHASUTMPX -DHAS_STRFTIME -DLSOF_VSTR="13.0-CURRENT" -I/usr/src/sys -O2 -c ckkv.c -o ckkv.o
In file included from ckkv.c:43:
In file included from ./../lsof.h:221:
In file included from ./../dlsof.h:412:
In file included from /usr/src/sys/sys/file.h:44:
In file included from /usr/src/sys/sys/refcount.h:36:
In file included from /usr/src/sys/sys/systm.h:126:
In file included from /usr/src/sys/sys/pcpu.h:223:
/usr/include/machine/pcpu_aux.h:55:55: error: expected expression
        __asm("movq %%gs:%P1,%0" : "=r" (td) : "n" (offsetof(struct pcpu,
                                                             ^ 
/usr/include/machine/pcpu_aux.h:56:6: error: use of undeclared identifier 'pc_curthread'; did you mean '__curthread'?
            pc_curthread)));
            ^
/usr/include/machine/pcpu_aux.h:51:1: note: '__curthread' declared here
__curthread(void)
^
/usr/include/machine/pcpu_aux.h:66:56: error: expected expression
        __asm("movq %%gs:%P1,%0" : "=r" (pcb) : "n" (offsetof(struct pcpu,
                                                              ^
/usr/include/machine/pcpu_aux.h:67:6: error: use of undeclared identifier 'pc_curpcb'; did you mean '__curpcb'?
            pc_curpcb)));
            ^
/usr/include/machine/pcpu_aux.h:62:1: note: '__curpcb' declared here
__curpcb(void)
^
4 errors generated.
*** Error code 1

Stop.
make[2]: stopped in /usr0/freebsd/ports/work/net/freebsd/ports/head/sysutils/lsof/work/lsof-4.93.2/lib
*** Error code 1

Stop.
make[1]: stopped in /usr0/freebsd/ports/work/net/freebsd/ports/head/sysutils/lsof/work/lsof-4.93.2
*** Error code 1

Stop.
make: stopped in /net/freebsd/ports/head/sysutils/lsof
Comment 1 Peter Jeremy freebsd_committer 2019-09-11 01:40:35 UTC
offsetof() is referenced from the #include chain starting at dlsof.h:412 but is only defined in <stddef.h>, which is included at dlsof.h:698

Adding a #include <stddef.h> to the #include block near the top of dlsof.h appeals to fix the problem.
Comment 2 Larry Rosenman freebsd_committer 2019-09-11 01:49:01 UTC
Feel free to submit a PR to https://github.com/lsof-org/lsof.

I'm done fighting this battle and getting ZERO help to modernize the KPI/API/etc.
Comment 3 Yasuhiro KIMURA 2019-09-11 09:51:28 UTC
Created attachment 207374 [details]
Patch file

(In reply to Peter Jeremy from comment #1)

Thanks for suggestion. I applied attached patch and build completed successfully.