From: Robert Huff on

James Chang writes:
> Dear Sir,
> I tru to build lsof (/usr/ports/sysutils/lsof) under FreeBSD
> 7.2-STABLE(AMD X64).
> It show me the following ERROR messages.

Does the code in /usr/src match the running system? If not,
you may need to build/install a new kernel?
(lsof uses headers from /usr/src that aren't installed in
/usr/include. If the two don't match, it won't build.)


Robert "been there, got the bite scars" Huff

_______________________________________________
freebsd-ports(a)freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscribe(a)freebsd.org"

From: "Larry Rosenman" on
Are your system sources current? and do they match the running system?

it compiles file for me on:

# uname -a
FreeBSD thebighonker.lerctr.org 7.2-STABLE FreeBSD 7.2-STABLE #31: Tue Oct
27 17:56:57 CDT 2009
root(a)thebighonker.lerctr.org:/usr/obj/usr/src/sys/THEBIGHONKER amd64
#

On Sun, November 1, 2009 7:32 am, James Chang wrote:
> Dear Sir,
> I tru to build lsof (/usr/ports/sysutils/lsof) under FreeBSD
> 7.2-STABLE(AMD X64).
> It show me the following ERROR messages.
>
> ===> Vulnerability check disabled, database not found
> ===> Extracting for lsof-4.83B,4
> => MD5 Checksum OK for lsof_4.83B.freebsd.tar.bz2.
> => SHA256 Checksum OK for lsof_4.83B.freebsd.tar.bz2.
> ===> Patching for lsof-4.83B,4
> ===> Configuring for lsof-4.83B,4
> Creating ./lockf_owner.h from /usr/src/sys/kern/kern_lockf.c
> ./lockf_owner.h creation succeeded.
> rm -f ddev.c dfile.c dlsof.h dmnt.c dnode*.c dproc.c dproto.h dsock.c
> dstore.c dzfs.h kernelbase.h machine.h machine.h.old new_machine.h
> __lseek.s Makefile Makefile.zfs ./tests/config.cflags
> rm -f ./tests/config.cc ./tests/config.xobj ./tests/config.ldflags
> Testing C library for localtime() and strftime(), using cc ... present
> ln -s dialects/freebsd/dlsof.h dlsof.h
> ln -s dialects/freebsd/dmnt.c dmnt.c
> ln -s dialects/freebsd/dnode.c dnode.c
> ln -s dialects/freebsd/dnode1.c dnode1.c
> ln -s dialects/freebsd/dnode2.c dnode2.c
> ln -s dialects/freebsd/dproc.c dproc.c
> ln -s dialects/freebsd/dproto.h dproto.h
> ln -s dialects/freebsd/dsock.c dsock.c
> ln -s dialects/freebsd/dstore.c dstore.c
> ln -s dialects/freebsd/dzfs.h dzfs.h
> ln -s dialects/freebsd/machine.h machine.h
> Makefile and lib/Makefile created.
> Makefile.zfs created.
> ./tests/config.cc created
> ./tests/config.cflags created
> ./tests/config.ldflags created
> ./tests/config.xobj created
> ===> Building for lsof-4.83B,4
> (cd lib; make DEBUG="-O2" CFGF="-fno-strict-aliasing -pipe
> -march=nocona -DHASRPCV2H -DHASEFFNLINK=i_effnlink -DHASF_VNODE
> -DHASSBSTATE -DHAS_KVM_VNODE -DHAS_UFS1_2 -DHAS_NO_SI_UDEV
> -DHAS_SI_PRIV -DHAS_SYS_SX_H -DHAS_ZFS -DHAS_V_LOCKF -DHAS_LOCKF_ENTRY
> -DFREEBSDV=7020 -DHASFDESCFS=2 -DHASPSEUDOFS -DHASNULLFS -DHASIPv6
> -DHAS_STRFTIME -DLSOF_VSTR=\"7.2-STABLE\"")
> cc -fno-strict-aliasing -pipe -march=nocona -DHASRPCV2H
> -DHASEFFNLINK=i_effnlink -DHASF_VNODE -DHASSBSTATE -DHAS_KVM_VNODE
> -DHAS_UFS1_2 -DHAS_NO_SI_UDEV -DHAS_SI_PRIV -DHAS_SYS_SX_H -DHAS_ZFS
> -DHAS_V_LOCKF -DHAS_LOCKF_ENTRY -DFREEBSDV=7020 -DHASFDESCFS=2
> -DHASPSEUDOFS -DHASNULLFS -DHASIPv6 -DHAS_STRFTIME
> -DLSOF_VSTR="7.2-STABLE" -I/usr/src/sys -O2 -c ckkv.c
> In file included from ../dlsof.h:81,
> from ../lsof.h:195,
> from ckkv.c:43:
> /usr/src/sys/sys/conf.h:144: error: expected declaration specifiers or
> '...' before 'vm_memattr_t'
> *** Error code 1
>
> Stop in /usr/ports/sysutils/lsof/work/lsof_4.83B.freebsd/lib.
> *** Error code 1
>
> Stop in /usr/ports/sysutils/lsof/work/lsof_4.83B.freebsd.
> *** Error code 1
>
> Stop in /usr/ports/sysutils/lsof.
>
> Best Regards
>
>
> James Chang
>


--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 512-248-2683 E-Mail: ler(a)lerctr.org
US Mail: 430 Valona Loop, Round Rock, TX 78681-3893


_______________________________________________
freebsd-ports(a)freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscribe(a)freebsd.org"

From: Erik Trulsson on
[lsof maintainer added to Cc:]

On Sun, Nov 01, 2009 at 12:10:07PM -0600, Larry Rosenman wrote:
> Are your system sources current? and do they match the running system?
>
> it compiles file for me on:

But if you update your FreeBSD system to the very latest (or at least after
Oct 29) it will not compile fine for you either.

The following commit to 7-stable broke lsof compilation:

Author: jhb
Date: Thu Oct 29 15:10:38 2009
New Revision: 198595
URL: http://svn.freebsd.org/changeset/base/198595

Log:
MFC 196615:
Extend the device pager to support different memory attributes on different
pages in an object.
- Add a new variant of d_mmap() currently called d_mmap2() which accepts
an additional in/out parameter that is the memory attribute to use for
the requested page.
- A driver either uses d_mmap() or d_mmap2() for all requests but not
- both.
The current implementation uses a flag in the cdevsw (D_MMAP2) to indicate
that the driver provides a d_mmap2() handler instead of d_mmap(). This
is done to make the change ABI compatible with existing drivers and
MFC'able to 7 and 8.

The lsof source code contains code to handle the problem for -CURRENT. The
following part from dialects/freebsd/dlsof.h is the relevant part which
describes the problem and contains a solution for 9-CURRENT.

# if FREEBSDV>=9000
/*
* The FreeBSD 9 and above d_mmap2_t function typedef in <sys/conf.h> needs
* the definition of vm_memattr_t for a pointer, but that definition is only
* available under _KERNEL in <sys/types.h>. Defining _KERNEL before
* including <sys/types.h> causes many compilation problems, so this
* expedient (hack) is used.
*/
#define vm_memattr_t void
# endif /* FREEBSDV>=9000 */

#include <sys/conf.h>

# if FREEBSDV>=9000
#undef vm_memattr_t
# endif /* FREEBSDV>=9000 */


The 'if FREEBSDV>=9000' parts need to be mofified to make it work for older
releases too now that the d_mmap2_t function has been MFC'd.






--
<Insert your favourite quote here.>
Erik Trulsson
ertr1013(a)student.uu.se
_______________________________________________
freebsd-ports(a)freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscribe(a)freebsd.org"

From: "Larry Rosenman" on
I'm in contact with Vic Abell (LSOF author), and will get an update out soon.

Thanks!

On Sun, November 1, 2009 1:48 pm, Erik Trulsson wrote:
> [lsof maintainer added to Cc:]
>
> On Sun, Nov 01, 2009 at 12:10:07PM -0600, Larry Rosenman wrote:
>> Are your system sources current? and do they match the running system?
>>
>> it compiles file for me on:
>
> But if you update your FreeBSD system to the very latest (or at least
> after
> Oct 29) it will not compile fine for you either.
>
> The following commit to 7-stable broke lsof compilation:
>
> Author: jhb
> Date: Thu Oct 29 15:10:38 2009
> New Revision: 198595
> URL: http://svn.freebsd.org/changeset/base/198595
>
> Log:
> MFC 196615:
> Extend the device pager to support different memory attributes on
> different
> pages in an object.
> - Add a new variant of d_mmap() currently called d_mmap2() which
> accepts
> an additional in/out parameter that is the memory attribute to use
> for
> the requested page.
> - A driver either uses d_mmap() or d_mmap2() for all requests but not
> - both.
> The current implementation uses a flag in the cdevsw (D_MMAP2) to
> indicate
> that the driver provides a d_mmap2() handler instead of d_mmap().
> This
> is done to make the change ABI compatible with existing drivers and
> MFC'able to 7 and 8.
>
> The lsof source code contains code to handle the problem for -CURRENT. The
> following part from dialects/freebsd/dlsof.h is the relevant part which
> describes the problem and contains a solution for 9-CURRENT.
>
> # if FREEBSDV>=9000
> /*
> * The FreeBSD 9 and above d_mmap2_t function typedef in <sys/conf.h>
> needs
> * the definition of vm_memattr_t for a pointer, but that definition is
> only
> * available under _KERNEL in <sys/types.h>. Defining _KERNEL before
> * including <sys/types.h> causes many compilation problems, so this
> * expedient (hack) is used.
> */
> #define vm_memattr_t void
> # endif /* FREEBSDV>=9000 */
>
> #include <sys/conf.h>
>
> # if FREEBSDV>=9000
> #undef vm_memattr_t
> # endif /* FREEBSDV>=9000 */
>
>
> The 'if FREEBSDV>=9000' parts need to be mofified to make it work for
> older
> releases too now that the d_mmap2_t function has been MFC'd.
>
>
>
>
>
>
> --
> <Insert your favourite quote here.>
> Erik Trulsson
> ertr1013(a)student.uu.se
>


--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 512-248-2683 E-Mail: ler(a)lerctr.org
US Mail: 430 Valona Loop, Round Rock, TX 78681-3893


_______________________________________________
freebsd-ports(a)freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscribe(a)freebsd.org"

From: "Larry Rosenman" on

On Sun, November 1, 2009 1:48 pm, Erik Trulsson wrote:
> [lsof maintainer added to Cc:]
>
> On Sun, Nov 01, 2009 at 12:10:07PM -0600, Larry Rosenman wrote:
>> Are your system sources current? and do they match the running system?
>>
>> it compiles file for me on:
>
> But if you update your FreeBSD system to the very latest (or at least
> after
> Oct 29) it will not compile fine for you either.
>
I've submitted ports/140183 to update to the 4.83C version which handles
this change in RELENG_7, RELENG_8, and HEAD.

Thanks for the reports.

LER



--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 512-248-2683 E-Mail: ler(a)lerctr.org
US Mail: 430 Valona Loop, Round Rock, TX 78681-3893


_______________________________________________
freebsd-ports(a)freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscribe(a)freebsd.org"