Bug 242833 - sysutils/lsof does'nt link on ppc64 on freebsd 11.3-RELEASE
Summary: sysutils/lsof does'nt link on ppc64 on freebsd 11.3-RELEASE
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: powerpc Any
: --- Affects Only Me
Assignee: Larry Rosenman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-23 14:30 UTC by Luciano Mannucci
Modified: 2020-01-21 16:47 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luciano Mannucci 2019-12-23 14:30:13 UTC
make build stops with:

cc -o lsof  -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=11000 -DHASFDESCFS=2 -DHASPSEUDOFS -DHASNULLFS -DHASIPv6 -DHASUTMPX -DHAS_STRFTIME -DLSOF_VSTR=\"11.3-RELEASE-p3\" -I/usr/src/sys -O2 dmnt.o dnode.o dnode1.o dnode2.o dproc.o dsock.o dstore.o  arg.o main.o misc.o node.o print.o proc.o store.o usage.o  util.o -L./lib -llsof  -lkvm
dnode2.o:(.text+0x190): undefined reference to `abd_zero_off'
dnode2.o:(.text+0x1c8): undefined reference to `abd_cmp_buf_off'
dnode2.o:(.text+0x200): undefined reference to `abd_copy_to_buf_off'
dnode2.o:(.text+0x238): undefined reference to `abd_copy_from_buf_off'
dnode2.o:(.text+0x274): undefined reference to `abd_copy_off'
*** [lsof] Error code 1

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

adding LSOF_CFGL="-lzpool" to

CONFIGURE_ENV=  LSOF_CC="${CC}" FREEBSD_SYS="${SRC_BASE}/sys"

Solves the problem for me.
Comment 1 Larry Rosenman freebsd_committer 2019-12-23 14:43:30 UTC
That seems wrong somehow needing to add -lzpool.

Can any of the PPC folks help here?
Comment 2 Luciano Mannucci 2020-01-10 13:40:20 UTC
(In reply to Larry Rosenman from comment #1)

I agree entirely. It seems quite odd.

While waiting for the PPC folks help we might just add to the Makefile

.if ${ARCH} == powerpc64
CONFIGURE_ENV+= LSOF_CFGL="-lzpool"
. endif

after the CONFIGURE_ENV=...

I just did it and it seems to work.

I know this solution is not elegant.
Comment 3 Piotr Kubaj freebsd_committer 2020-01-10 15:54:08 UTC
(In reply to Luciano Mannucci from comment #2)
This doesn't fix the problem on head:
dnode.c:563:9: error: no member named 'v_tag' in 'struct vnode'
        if (v->v_tag && !kread((KA_T)v->v_tag, (char *)&vtbuf, sizeof(vtbuf)))
            ~  ^
dnode.c:563:34: error: no member named 'v_tag' in 'struct vnode'
        if (v->v_tag && !kread((KA_T)v->v_tag, (char *)&vtbuf, sizeof(vtbuf)))
                                     ~  ^
2 errors generated.
Comment 4 Larry Rosenman freebsd_committer 2020-01-10 18:00:36 UTC
@pkubaj: Tha v_tag issue was fixed yesterday.
Comment 5 Larry Rosenman freebsd_committer 2020-01-10 18:35:51 UTC
@luciano: I made that change, we'll see
Comment 6 commit-hook freebsd_committer 2020-01-10 18:36:08 UTC
A commit references this bug:

Author: ler
Date: Fri Jan 10 18:35:21 UTC 2020
New revision: 522582
URL: https://svnweb.freebsd.org/changeset/ports/522582

Log:
  sysutils/lsof: add a PPC64 work around for needing -lzpool

  PR:		242833
  Submitted by:	luciano@vespaperitivo.it

Changes:
  head/sysutils/lsof/Makefile
Comment 7 commit-hook freebsd_committer 2020-01-21 16:47:32 UTC
A commit references this bug:

Author: ler
Date: Tue Jan 21 16:46:44 UTC 2020
New revision: 523728
URL: https://svnweb.freebsd.org/changeset/ports/523728

Log:
  MFH: r522273 r522545 r522582 r523727

  sysutils/lsof: fix build following base r356337.

  I took the patch from 243122 as it was more correct.

  PR:		243122, 243083
  Submitted by:	cy, yasu@utahime.org

  sysutils/lsof: fix after  base r356432.

  PR:		243172
  Submitted by:	mjg
  Reported by:	yasu@utahime.org

  sysutils/lsof: add a PPC64 work around for needing -lzpool

  PR:		242833
  Submitted by:	luciano@vespaperitivo.it

  sysutils/lsof: fix build on powerpc, powerpc64, powerpcse

  PR:		242758
  Submitted by:	pkubaj

  Approved by:	ports-secteam (joneum)

Changes:
_U  branches/2020Q1/
  branches/2020Q1/sysutils/lsof/Makefile
  branches/2020Q1/sysutils/lsof/files/patch-dialects_freebsd_dnode.c
  branches/2020Q1/sysutils/lsof/files/patch-dialects_freebsd_dnode2.c