From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Nov 1 20:03:59 2009 Return-Path: Delivered-To: freebsd-ports-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13C751065697 for ; Sun, 1 Nov 2009 20:03:59 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp02.sth.basefarm.net (ch-smtp02.sth.basefarm.net [80.76.149.213]) by mx1.freebsd.org (Postfix) with ESMTP id 907C28FC2F for ; Sun, 1 Nov 2009 20:03:58 +0000 (UTC) Received: from c83-255-48-78.bredband.comhem.se ([83.255.48.78]:49621 helo=falcon.midgard.homeip.net) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1N4gPd-0002OP-78 for freebsd-ports-bugs@freebsd.org; Sun, 01 Nov 2009 20:48:31 +0100 Received: (qmail 59042 invoked from network); 1 Nov 2009 20:48:26 +0100 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with ESMTP; 1 Nov 2009 20:48:26 +0100 Received: (qmail 70309 invoked by uid 1001); 1 Nov 2009 20:48:26 +0100 Date: Sun, 1 Nov 2009 20:48:26 +0100 From: Erik Trulsson To: Larry Rosenman Message-ID: <20091101194826.GA69806@owl.midgard.homeip.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Originating-IP: 83.255.48.78 X-Scan-Result: No virus found in message 1N4gPd-0002OP-78. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1N4gPd-0002OP-78 61537f18e61ae297486c5aad27695a17 Cc: freebsd-ports-bugs , James Chang , freebsd-ports@freebsd.org Subject: Re: lsof build failed under FreeBSD 7.2-STABLE AMD64 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Nov 2009 20:03:59 -0000 [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 needs * the definition of vm_memattr_t for a pointer, but that definition is only * available under _KERNEL in . Defining _KERNEL before * including causes many compilation problems, so this * expedient (hack) is used. */ #define vm_memattr_t void # endif /* FREEBSDV>=9000 */ #include # 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. -- Erik Trulsson ertr1013@student.uu.se