Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Nov 2009 20:48:26 +0100
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        Larry Rosenman <ler@lerctr.org>
Cc:        freebsd-ports-bugs <freebsd-ports-bugs@freebsd.org>, James Chang <james.technew@gmail.com>, freebsd-ports@freebsd.org
Subject:   Re: lsof build failed under FreeBSD 7.2-STABLE AMD64
Message-ID:  <20091101194826.GA69806@owl.midgard.homeip.net>
In-Reply-To: <f746f9883ccfd790be30700f880e4f3e.squirrel@webmail.lerctr.org>
References:  <a951c2910911010532neb33bdeye5a26603f11b8cef@mail.gmail.com> <f746f9883ccfd790be30700f880e4f3e.squirrel@webmail.lerctr.org>

next in thread | previous in thread | raw e-mail | index | archive | help
[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@student.uu.se



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091101194826.GA69806>