Bug 196142 - [MAINTAINER] sysutils/lsof update to 4.89B: fix i386 10.1
Summary: [MAINTAINER] sysutils/lsof update to 4.89B: fix i386 10.1
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Thomas Zander
URL:
Keywords:
: 196103 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-12-19 19:25 UTC by Larry Rosenman
Modified: 2015-01-13 01:55 UTC (History)
6 users (show)

See Also:


Attachments
patch to upgrade to 4.89B (881 bytes, patch)
2014-12-19 19:25 UTC, Larry Rosenman
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Larry Rosenman freebsd_committer 2014-12-19 19:25:44 UTC
Created attachment 150787 [details]
patch to upgrade to 4.89B

upgrade to Vic's official fix for the 10.x bool issue.
Comment 1 Larry Rosenman freebsd_committer 2014-12-19 19:45:39 UTC
NOTE: this fix is specific to i386.

If we get reports on other arch's please let me <ler@lerctr.org> know.
Comment 2 Po-Chuan Hsieh freebsd_committer 2014-12-20 06:19:53 UTC
I got same failure on amd64.

% uname -mr
10.1-STABLE amd64
% make
...
--- dnode.o ---
In file included from dnode.c:39:
In file included from ./lsof.h:195:
In file included from ./dlsof.h:208:
In file included from /usr/src/sys/ufs/ufs/ufsmount.h:36:
In file included from /usr/src/sys/sys/buf.h:260:
/usr/src/sys/sys/proc.h:950:1: error: unknown type name 'bool'
bool    thread_suspend_check_needed(void);
^
--- dmnt.o ---
In file included from dmnt.c:39:
In file included from ./lsof.h:195:
In file included from ./dlsof.h:208:
In file included from /usr/src/sys/ufs/ufs/ufsmount.h:36:
In file included from /usr/src/sys/sys/buf.h:260:
/usr/src/sys/sys/proc.h:950:1: error: unknown type name 'bool'
bool    thread_suspend_check_needed(void);
^
...
Comment 3 Po-Chuan Hsieh freebsd_committer 2014-12-20 06:33:53 UTC
I could build 4.89B on amd64 with quick hack as follows.

--- Makefile    (revision 374990)
+++ Makefile    (working copy)
@@ -45,6 +45,10 @@
 BROKEN=                Does not compile on arm
 .endif

+.if ${OSVERSION} >= 1000000
+CFLAGS+=       -DNEEDS_BOOL_TYPEDEF
+.endif
+
 CONFIGURE_SCRIPT=      Configure
 CONFIGURE_ARGS=        -n freebsd
 CONFIGURE_ENV= LSOF_CC="${CC}" FREEBSD_SYS="${SRC_BASE}/sys"
Comment 4 Thomas Zander freebsd_committer 2014-12-20 16:54:26 UTC
*** Bug 196103 has been marked as a duplicate of this bug. ***
Comment 5 commit-hook freebsd_committer 2014-12-20 16:57:15 UTC
A commit references this bug:

Author: riggs
Date: Sat Dec 20 16:56:41 UTC 2014
New revision: 375011
URL: https://svnweb.freebsd.org/changeset/ports/375011

Log:
  Fix build on 10-STABLE

  PR:		196142
  Submitted by:	ler@lerctr.org (maintainer)
  Reviewed by:	sunpoet

Changes:
  head/sysutils/lsof/Makefile
  head/sysutils/lsof/distinfo
Comment 6 Thomas Zander freebsd_committer 2014-12-20 17:03:53 UTC
Committed minimal patch fusing the updates by Larry and Sunpoet.
Tested on 9.3 and 10.1, both i386 and amd64.

@Larry: It's broken on armv6. Since arm is not tier-1, we can live with it being broken here for now, but if you have time, could you take a look into the arm build failure:

...
In file included from /usr/include/machine/pcpu.h:35:
/usr/include/machine/cpuconf.h:103:2: error: ARM_NARCH is 0
#error ARM_NARCH is 0
 ^
/usr/include/machine/cpuconf.h:161:2: error: ARM_NMMUS is 0
#error ARM_NMMUS is 0
...
Comment 7 david 2014-12-21 16:55:47 UTC
Update to lsof-4.89.b,8 Just Worked for me:
g1-253(10.1-S)[1] pkg info lsof-\*
lsof-4.89.b,8
g1-253(10.1-S)[2] uname -a
FreeBSD g1-253.catwhisker.org 10.1-STABLE FreeBSD 10.1-STABLE #1419  r276001M/276001:1001504: Sun Dec 21 05:05:22 PST 2014     root@g1-254.catwhisker.org:/common/S1/obj/usr/src/sys/CANARY  i386

My ports tree is a working copy of ports/head at r375155.
Comment 8 diffie 2014-12-21 18:03:33 UTC
(In reply to Larry Rosenman from comment #1)
> NOTE: this fix is specific to i386.
> 
> If we get reports on other arch's please let me <ler@lerctr.org> know.

Build fails on amd64 (10.1-STABLE FreeBSD 10.1-STABLE #0 r275973: Sat Dec 20 21:53:21 EST 2014 amd64)

snip from make in /usr/ports/sysutils/lsof:

 --> make MAKE_JOBS_UNSAFE=yes
===>  Building for lsof-4.89.b,8
(cd lib; /usr/bin/make DEBUG="-O2" CFGF="-pipe -DHASTASKS -DHAS_PAUSE_SBT -DHASEFFNLINK=i_effnlink -DHASF_VNODE -DHAS_FILEDESCENT -DHAS_TMPFS -DHASWCTYPE_H -DHASSBSTATE -DHAS_KVM_VNODE -DHAS_UFS1_2 -DHAS_VM_MEMATTR_T -DHAS_CDEV2PRIV -DHAS_NO_SI_UDEV -DHAS_SYS_SX_H -DHAS_ZFS -DHAS_V_LOCKF -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT -DHAS_NO_6PPCB -DNEEDS_BOOLEAN_T -DFREEBSDV=10000 -DHASFDESCFS=2 -DHASPSEUDOFS -DHASNULLFS -DHASIPv6 -DHASUTMPX -DHAS_STRFTIME -DLSOF_VSTR=\"10.1-STABLE\"")
cc  -pipe -DHASTASKS -DHAS_PAUSE_SBT -DHASEFFNLINK=i_effnlink -DHASF_VNODE -DHAS_FILEDESCENT -DHAS_TMPFS -DHASWCTYPE_H -DHASSBSTATE -DHAS_KVM_VNODE -DHAS_UFS1_2 -DHAS_VM_MEMATTR_T -DHAS_CDEV2PRIV -DHAS_NO_SI_UDEV -DHAS_SYS_SX_H -DHAS_ZFS -DHAS_V_LOCKF -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT -DHAS_NO_6PPCB -DNEEDS_BOOLEAN_T -DFREEBSDV=10000 -DHASFDESCFS=2 -DHASPSEUDOFS -DHASNULLFS -DHASIPv6 -DHASUTMPX -DHAS_STRFTIME -DLSOF_VSTR="10.1-STABLE" -I/usr/src/sys -O2 -c ckkv.c
In file included from ckkv.c:43:
In file included from ./../lsof.h:195:
In file included from ./../dlsof.h:208:
In file included from /usr/src/sys/ufs/ufs/ufsmount.h:36:
In file included from /usr/src/sys/sys/buf.h:260:
/usr/src/sys/sys/proc.h:950:1: error: unknown type name 'bool'
bool    thread_suspend_check_needed(void);
^
1 error generated.
*** Error code 1

so clearly this bug is not FIXED.
Comment 9 Thomas Zander freebsd_committer 2014-12-22 12:28:03 UTC
(In reply to diffie from comment #8)

...
> cc  -pipe -DHASTASKS -DHAS_PAUSE_SBT -DHASEFFNLINK=i_effnlink -DHASF_VNODE
> -DHAS_FILEDESCENT -DHAS_TMPFS -DHASWCTYPE_H -DHASSBSTATE -DHAS_KVM_VNODE
> -DHAS_UFS1_2 -DHAS_VM_MEMATTR_T -DHAS_CDEV2PRIV -DHAS_NO_SI_UDEV
> -DHAS_SYS_SX_H -DHAS_ZFS -DHAS_V_LOCKF -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT
> -DHAS_NO_6PPCB -DNEEDS_BOOLEAN_T -DFREEBSDV=10000 -DHASFDESCFS=2
> -DHASPSEUDOFS -DHASNULLFS -DHASIPv6 -DHASUTMPX -DHAS_STRFTIME
> -DLSOF_VSTR="10.1-STABLE" -I/usr/src/sys -O2 -c ckkv.c
> In file included from ckkv.c:43:
> In file included from ./../lsof.h:195:
> In file included from ./../dlsof.h:208:
> In file included from /usr/src/sys/ufs/ufs/ufsmount.h:36:
> In file included from /usr/src/sys/sys/buf.h:260:
> /usr/src/sys/sys/proc.h:950:1: error: unknown type name 'bool'
> bool    thread_suspend_check_needed(void);
> ^
> 1 error generated.
> *** Error code 1
> 
> so clearly this bug is not FIXED.

Your cc command like is wrong. After r375011, it should look like this:
cc  -pipe -DNEEDS_BOOL_TYPEDEF -fstack-protector -fno-strict-aliasing -DHASTASKS -DHAS_PAUSE_SBT -DHASEFFNLINK=i_effnlink -DHASF_VNODE -DHAS_FILEDESCENT -DHAS_TMPFS -DHASWCTYPE_H -DHASSBSTATE -DHAS_KVM_VNODE -DHAS_UFS1_2 -DHAS_VM_MEMATTR_T -DHAS_CDEV2PRIV -DHAS_NO_SI_UDEV -DHAS_SYS_SX_H -DHAS_ZFS -DHAS_V_LOCKF -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT -DHAS_NO_6PPCB -DNEEDS_BOOLEAN_T -DFREEBSDV=10000 -DHASFDESCFS=2 -DHASPSEUDOFS -DHASNULLFS -DHASIPv6 -DHASUTMPX -DHAS_STRFTIME -DLSOF_VSTR="10.1-STABLE" -I/usr/src/sys -O2 -c ckkv.c

Notice the -DNEEDS_BOOL_TYPEDEF that is not present in your case, but the port Makefile adds it to CFLAGS. Also you are missing -fstack-protector -fno-strict-aliasing which are default flags on amd64. Are you enforcing CFLAGS in make.conf? If so, please do it with CFLAGS+=. A port Makefile has to be able to set CFLAGS.
Comment 10 diffie 2014-12-23 19:18:30 UTC
Thomas,

Yes you are correct, i had old remnants of SSP flags set in /etc/make.conf from 9-STABLE days. Once i had reorganized my make.conf the port had built successfully using the correct flags picked by the system just like your example demonstrated. 

Thanks again for your help on this. 

Cheers!
Comment 11 Thomas Zander freebsd_committer 2014-12-23 19:43:29 UTC
(In reply to diffie from comment #10)

> Yes you are correct, i had old remnants of SSP flags set in /etc/make.conf
> from 9-STABLE days. Once i had reorganized my make.conf the port had built
> successfully using the correct flags picked by the system just like your
> example demonstrated. 
> Thanks again for your help on this. 

No worries, I'm glad we found the reason for your trouble. Best regards!
Comment 12 Terry Kennedy 2015-01-05 07:00:15 UTC
I'm running into the same thing on 10-STABLE amd64. My kernel is r276691, my ports tree is at r376280, I have an empty /etc/make.conf, the port makefile is r375011, and I'm getting:

===>  Building for lsof-4.89.b,8
(cd lib; /usr/bin/make DEBUG="-O" CFGF="-DHASTASKS -DHAS_PAUSE_SBT -DHASEFFNLINK
=i_effnlink -DHASF_VNODE -DHAS_FILEDESCENT -DHAS_TMPFS -DHASWCTYPE_H -DHASSBSTAT
E -DHAS_KVM_VNODE -DHAS_UFS1_2 -DHAS_VM_MEMATTR_T -DHAS_CDEV2PRIV -DHAS_NO_SI_UD
EV -DHAS_SYS_SX_H -DHAS_ZFS -DHAS_V_LOCKF -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT -DHAS
_NO_6PPCB -DNEEDS_BOOLEAN_T -DFREEBSDV=10000 -DHASFDESCFS=2 -DHASPSEUDOFS -DHASN
ULLFS -DHASIPv6 -DHASUTMPX -DHAS_STRFTIME -DLSOF_VSTR=\"10.1-STABLE\"")
cc  -DHASTASKS -DHAS_PAUSE_SBT -DHASEFFNLINK=i_effnlink -DHASF_VNODE -DHAS_FILED
ESCENT -DHAS_TMPFS -DHASWCTYPE_H -DHASSBSTATE -DHAS_KVM_VNODE -DHAS_UFS1_2 -DHAS
_VM_MEMATTR_T -DHAS_CDEV2PRIV -DHAS_NO_SI_UDEV -DHAS_SYS_SX_H -DHAS_ZFS -DHAS_V_
LOCKF -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT -DHAS_NO_6PPCB -DNEEDS_BOOLEAN_T -DFREEBS
DV=10000 -DHASFDESCFS=2 -DHASPSEUDOFS -DHASNULLFS -DHASIPv6 -DHASUTMPX -DHAS_STR
FTIME -DLSOF_VSTR="10.1-STABLE" -I/usr/src/sys -O -c ckkv.c
In file included from ckkv.c:43:
In file included from ./../lsof.h:195:
In file included from ./../dlsof.h:208:
In file included from /usr/src/sys/ufs/ufs/ufsmount.h:36:
In file included from /usr/src/sys/sys/buf.h:260:
/usr/src/sys/sys/proc.h:909:46: error: unknown type name 'bool'
void    reaper_abandon_children(struct proc *p, bool exiting);
                                                ^
/usr/src/sys/sys/proc.h:962:1: error: unknown type name 'bool'
bool    thread_suspend_check_needed(void);
^
/usr/src/sys/sys/proc.h:909:46: error: unknown type name 'bool'
void    reaper_abandon_children(struct proc *p, bool exiting);
                                                ^
/usr/src/sys/sys/proc.h:962:1: error: unknown type name 'bool'
bool    thread_suspend_check_needed(void);
^
2 errors generated.
*** Error code 1

Stop.
Comment 13 Thomas Zander freebsd_committer 2015-01-05 09:42:17 UTC
ports.conf?
Somewhere the non-standard CFLAGS must be set. You are missing the stack-protector flags as well.
Comment 14 Terry Kennedy 2015-01-05 14:56:10 UTC
Nope. This is on a vanilla install of 10.1. I just did a "make -d v MAKE_JOBS_UNSAFE=yes" and looked for CFLAGS. The next-to-last instance is as expected:
Global:CFLAGS = -O2 -pipe  -DNEEDS_BOOL_TYPEDEF -fstack-protector -fno-strict-aliasing ${_CPUCFLAGS} ${CFLAGS.${MACHINE_ARCH}}

but the next instance stomps on everything:
Global:CFLAGS = ${CDEFS} ${INCL} ${DEBUG}

I have put the script file of this run on my server at http://www.tmk.com/transient/lsof-build.txt since I think it is too big (600KB) to attach here.

Let me know if you need additional information.
Comment 15 Thomas Zander freebsd_committer 2015-01-06 19:19:01 UTC
(In reply to terry from comment #14)

> but the next instance stomps on everything:
> Global:CFLAGS = ${CDEFS} ${INCL} ${DEBUG}

Actually, that is quite alright, and looks the same way here. The difference I observe is before that. This is your CFGF:

> Global:CFGF = -DHASTASKS -DHAS_PAUSE_SBT -DHASEFFNLINK=i_effnlink -DHASF_VNODE -DHAS_FILEDESCENT -DHAS_TMPFS -DHASWCTYPE_H -DHASSBSTATE -DHAS_KVM_VNODE -DHAS_UFS1_2 -DHAS_VM_MEMATTR_T -DHAS_CDEV2PRIV -DHAS_NO_SI_UDEV -DHAS_SYS_SX_H -DHAS_ZFS -DHAS_V_LOCKF -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT -DHAS_NO_6PPCB -DNEEDS_BOOLEAN_T -DFREEBSDV=10000 -DHASFDESCFS=2 -DHASPSEUDOFS -DHASNULLFS -DHASIPv6 -DHASUTMPX -DHAS_STRFTIME -DLSOF_VSTR=\"10.1-STABLE\"

This is mine:
Global:CFGF = -pipe -DNEEDS_BOOL_TYPEDEF -fstack-protector -fno-strict-aliasing -DHASTASKS -DHAS_PAUSE_SBT -DHASEFFNLINK=i_effnlink -DHASF_VNODE -DHAS_FILEDESCENT -DHAS_TMPFS -DHASWCTYPE_H -DHASSBSTATE -DHAS_KVM_VNODE -DHAS_UFS1_2 -DHAS_VM_MEMATTR_T -DHAS_CDEV2PRIV -DHAS_NO_SI_UDEV -DHAS_SYS_SX_H -DHAS_ZFS -DHAS_V_LOCKF -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT -DHAS_NO_6PPCB -DNEEDS_BOOLEAN_T -DFREEBSDV=10000 -DHASFDESCFS=2 -DHASPSEUDOFS -DHASNULLFS -DHASIPv6 -DHASUTMPX -DHAS_STRFTIME -DLSOF_VSTR=\"10.1-STABLE\"


Construction of CFGF happens right after parsing the Makefiles:
Global:.MAKE.MAKEFILES = /usr/share/mk/sys.mk /etc/make.conf /usr/share/mk/bsd.cpu.mk Makefile
Global:.PARSEDIR = /vcache/portbuild/usr/ports/sysutils/lsof/work/lsof_4.89B.freebsd
Global:.PARSEFILE = Makefile
Global:CC = cc
Global:LIB = lib/liblsof.a
Global:CFGF .....

Also I noticed a slight (although probably not relevant) difference in DEBUG flags.
Your system: Global:DEBUG = -O
My system: Global:DEBUG = -O2

Are you really really really certain that:
- Your kernel and userland is in sync
- Your ports tree is updated
- Your make.conf, src.conf, ports.conf are not messing with the flags
- Your port build directory was empty before you updated and rebuild the port

There must be a reason for your CFGF to look different. As you see, it's not only -DNEEDS_BOOL_TYPEDEF. You are also lacking the -pipe and -fstack-protector -fno-strict-aliasing. Somewhere you must have something that alters CFLAGS.
Comment 16 Terry Kennedy 2015-01-07 06:55:43 UTC
I just did:

rm -Rf /usr/ports
rm -Rf /usr/src
rm -Rf /usr/obj/*

svnlite checkout svn://svn.freebsd.org/ports/head /usr/ports
svnlite checkout svn://svn.freebsd.org/base/stable/10 /usr/src

which got me r376454 and r276774 ,respectively.

I have no /etc/make.conf, /etc/src.conf, or /etc/ports.conf.

I then did:

make buildworld
make installworld
mergemaster
make kernel
shutdown -r now

and after the reboot I did:

cd /usr/ports/sysutils/lsof
make clean
make

and I get the same error.

Note that if I cd /usr/ports/sysutils/lookat (random port, chosen because it is alphabetically one before lsof), I get:

cc -DHAVE_CONFIG_H -I.     -O2 -pipe  -fstack-protector -fno-strict-aliasing -MT get_dir.o -MD -MP -MF .deps/get_dir.Tpo -c -o get_dir.o get_dir.c

meaning that the flags are correct in this port.

Digging deeper into what happens when trying to build lsof, I find the following in /usr/ports/sysutils/lsof/work/lsof_4.89B.freebsd/Makefile:

(0:34) test2:/usr/ports/sysutils/lsof/work/lsof_4.89B.freebsd# more Makefile
# freebsd Makefile for lsof revision 4.89

CC=     cc

LIB=    lib/liblsof.a

CFGF=    -DHASTASKS -DHAS_PAUSE_SBT -DHASEFFNLINK=i_effnlink -DHASF_VNODE -DHAS_
FILEDESCENT -DHAS_TMPFS -DHASWCTYPE_H -DHASSBSTATE -DHAS_KVM_VNODE -DHAS_UFS1_2 
-DHAS_VM_MEMATTR_T -DHAS_CDEV2PRIV -DHAS_NO_SI_UDEV -DHAS_SYS_SX_H -DHAS_ZFS -DH
AS_V_LOCKF -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT -DHAS_NO_6PPCB -DNEEDS_BOOLEAN_T -DF
REEBSDV=10000 -DHASFDESCFS=2 -DHASPSEUDOFS -DHASNULLFS -DHASIPv6 -DHASUTMPX -DHA
S_STRFTIME -DLSOF_VSTR=\"10.1-STABLE\"

CFGL=    -L./lib -llsof  -lkvm

DEBUG=  -O

DINC=   -I/usr/src/sys

# FreeBSD Makefile remainder
#
# $Id: Makefile,v 1.12 2009/03/25 19:23:06 abe Exp $

Note the definition of CFGF there.

If there are more tests you want me to run, or if you'd like access to the system to look around for yourself, let me know.
Comment 17 Terry Kennedy 2015-01-13 01:55:37 UTC
I was wondering if you you got a chance to look at this. I know Bugzilla was down over the weekend, so I'm not sure you saw my previous comment?