# lsof : Unknown architecture



## burkoff (Jul 11, 2010)

Hi, I use the following configuration


```
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 8.1-PRERELEASE #0: Tue Jun 22 10:57:15 EEST 2010
    root@mania:/usr/obj/usr/src/sys/V1P3R amd64
module_register: module nfe/miibus already exists!
Module nfe/miibus failed to register: 17
module_register: module pci/nfe already exists!
Module pci/nfe failed to register: 17
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: AMD Athlon(tm) II X2 250 Processor (3013.73-MHz K8-class CPU)
  Origin = "AuthenticAMD"  Id = 0x100f62  Family = 10  Model = 6  Stepping = 2
  Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT>
  Features2=0x802009<SSE3,MON,CX16,POPCNT>
  AMD Features=0xee500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM,3DNow!+,3DNow!>
  AMD Features2=0x37ff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW,IBS,SKINIT,WDT>
  TSC: P-state invariant
real memory  = 2147483648 (2048 MB)
avail memory = 1914433536 (1825 MB)
ACPI APIC Table: <082509 APIC1312>
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
FreeBSD/SMP: 1 package(s) x 2 core(s)
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP): APIC ID:  1
ioapic0 <Version 1.1> irqs 0-23 on motherboard
kbd1 at kbdmux0
acpi0: <082509 RSDT1312> on motherboard
acpi0: [ITHREAD]
acpi0: Power Button (fixed)
acpi0: reservation of fec00000, 1000 (3) failed
acpi0: reservation of 0, a0000 (3) failed
acpi0: reservation of 100000, 77f00000 (3) failed
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x508-0x50b on acpi0
cpu0: <ACPI CPU> on acpi0
cpu1: <ACPI CPU> on acpi0
acpi_hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 25000000 Hz quality 900
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pci0: <memory, RAM> at device 0.0 (no driver attached)
isab0: <PCI-ISA bridge> port 0x900-0x9ff at device 1.0 on pci0
isa0: <ISA bus> on isab0
pci0: <serial bus, SMBus> at device 1.1 (no driver attached)
pci0: <memory, RAM> at device 1.2 (no driver attached)
pci0: <serial bus, USB> at device 2.0 (no driver attached)
pci0: <serial bus, USB> at device 2.1 (no driver attached)
pcib1: <ACPI PCI-PCI bridge> at device 4.0 on pci0
pci1: <ACPI PCI bus> on pcib1
hdac0: <NVidia MCP61 High Definition Audio Controller> mem 0xdfff8000-0xdfffbfff irq 23 at device 5.0 on pci0
hdac0: HDA Driver Revision: 20100226_0142
hdac0: [ITHREAD]
atapci0: <nVidia nForce MCP61 UDMA133 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xffa0-0xffaf at device 6.0 on pci0
ata0: <ATA channel 0> on atapci0
ata0: [ITHREAD]
ata1: <ATA channel 1> on atapci0
ata1: [ITHREAD]
nfe0: <NVIDIA nForce MCP61 Networking Adapter> port 0xe480-0xe487 mem 0xdfffd000-0xdfffdfff irq 20 at device 7.0 on pci0
miibus0: <MII bus> on nfe0
rlphy0: <RTL8201L 10/100 media interface> PHY 1 on miibus0
rlphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
nfe0: Ethernet address: 00:26:18:e8:ad:94
nfe0: [FILTER]
nfe0: [FILTER]
nfe0: [FILTER]
nfe0: [FILTER]
nfe0: [FILTER]
nfe0: [FILTER]
nfe0: [FILTER]
nfe0: [FILTER]
atapci1: <nVidia nForce MCP61 SATA300 controller> port 0xe400-0xe407,0xe080-0xe083,0xe000-0xe007,0xdc00-0xdc03,0xd880-0xd88f mem 0xdfffc000-
0xdfffcfff irq 21 at device 8.0 on pci0
atapci1: [ITHREAD]
ata2: <ATA channel 0> on atapci1
ata2: [ITHREAD]
ata3: <ATA channel 1> on atapci1
ata3: [ITHREAD]
pcib2: <ACPI PCI-PCI bridge> at device 9.0 on pci0
pci2: <ACPI PCI bus> on pcib2
pcib3: <ACPI PCI-PCI bridge> at device 11.0 on pci0
pci3: <ACPI PCI bus> on pcib3
pcib4: <ACPI PCI-PCI bridge> at device 12.0 on pci0
pci4: <ACPI PCI bus> on pcib4
vgapci0: <VGA-compatible display> mem 0xde000000-0xdeffffff,0xc0000000-0xcfffffff,0xdd000000-0xddffffff irq 22 at device 13.0 on pci0
nvidia0: <GeForce 7025 / nForce 630a> on vgapci0
vgapci0: child nvidia0 requested pci_enable_busmaster
vgapci0: child nvidia0 requested pci_enable_io
vgapci0: child nvidia0 requested pci_enable_io
nvidia0: [ITHREAD]
acpi_button0: <Power Button> on acpi0
atrtc0: <AT realtime clock> port 0x70-0x71 irq 8 on acpi0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
atkbd0: [ITHREAD]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: [ITHREAD]
psm0: model MouseMan+, device ID 0
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: [FILTER]
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
ppc0: cannot reserve I/O port range
hwpstate0: <Cool`n'Quiet 2.0> on cpu0
Timecounters tick every 1.000 msec
ad4: 476940MB <WDC WD5000AAKS-22V1A0 05.01D05> at ata2-master UDMA100 SATA 3Gb/s
acd0: DVDR <HL-DT-ST DVDRAM GH22NS40/NL02> at ata3-master UDMA100 SATA 1.5Gb/s
hdac0: HDA Codec #0: Realtek ALC662
pcm0: <HDA Realtek ALC662 PCM #0 Analog> at cad 0 nid 1 on hdac0
pcm1: <HDA Realtek ALC662 PCM #1 Analog> at cad 0 nid 1 on hdac0
SMP: AP CPU #1 Launched!
Trying to mount root from ufs:/dev/ad4s1a
```
------------------------------------------------------------
bsd is apdeytnato, and src also ports ...
after portupgrade-a gives me that can not frequently updated lsof
lo error:



```
--->  Upgrading 'lsof-4.83B,4' to 'lsof-4.84A,5' (sysutils/lsof)
--->  Building '/usr/ports/sysutils/lsof'
===>  Cleaning for lsof-4.84A,5
===>  Vulnerability check disabled, database not found
===>  License check disabled, port has not defined LICENSE
===>  Extracting for lsof-4.84A,5
=> MD5 Checksum OK for lsof_4.84A.freebsd.tar.bz2.
=> SHA256 Checksum OK for lsof_4.84A.freebsd.tar.bz2.
===>  Patching for lsof-4.84A,5
===>  Configuring for lsof-4.84A,5
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.84A,5
(cd lib; make DEBUG="-O2" CFGF="-pipe -march=athlon64 -fno-strict-aliasing -march=athlon64 -DHASEFFNLINK=i_effnlink -DHASF_VNODE -DHASSBSTATE -
DHAS_KVM_VNODE -DHAS_UFS1_2 -DHAS_CDEV2PRIV -DHAS_NO_SI_UDEV -DHAS_SYS_SX_H -DHAS_ZFS -DHAS_V_LOCKF -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT -
DHAS_NO_6PPCB -DFREEBSDV=8000 -DHASFDESCFS=2 -DHASPSEUDOFS -DHASNULLFS -DHASIPv6 -DHAS_STRFTIME -DLSOF_VSTR=\"8.1-PRERELEASE\"")
cc  -pipe -march=athlon64 -fno-strict-aliasing -march=athlon64 -DHASEFFNLINK=i_effnlink -DHASF_VNODE -DHASSBSTATE -DHAS_KVM_VNODE -DHAS_UFS1_2 
-DHAS_CDEV2PRIV -DHAS_NO_SI_UDEV -DHAS_SYS_SX_H -DHAS_ZFS -DHAS_V_LOCKF -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT -DHAS_NO_6PPCB -DFREEBSDV=8000 -
DHASFDESCFS=2 -DHASPSEUDOFS -DHASNULLFS -DHASIPv6 -DHAS_STRFTIME -DLSOF_VSTR="8.1-PRERELEASE" -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:141: error: expected declaration specifiers or '...' before 'vm_memattr_t'
In file included from ../dlsof.h:412,
                 from ../lsof.h:195,
                 from ckkv.c:43:
/usr/src/sys/sys/user.h:92:2: error: #error "Unknown architecture"
*** Error code 1

Stop in /usr/tmp/usr/ports/sysutils/lsof/work/lsof_4.84A.freebsd/lib.
*** Error code 1

Stop in /usr/tmp/usr/ports/sysutils/lsof/work/lsof_4.84A.freebsd.
*** Error code 1

Stop in /usr/ports/sysutils/lsof.
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20100711-2462-118ozi8-0 env UPGRADE_TOOL=portupgrade UPGRADE_PORT=lsof-
4.83B,4 UPGRADE_PORT_VER=4.83B,4 make
** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        - net/skype (marked as IGNORE)
        ! sysutils/lsof (lsof-4.83B,4)  (unknown build error)
```
please help.


----------



## SirDice (Jul 11, 2010)

Do you have any CFLAGS or CPUTYPE in make.conf? Try removing those.


----------



## burkoff (Jul 11, 2010)

cat /etc/make.conf

```
CPUTYPE?=athlon64
KERNCONF?=V1P3R
#BATCH=YES
PACKAGEROOT=ftp://ftp.de.freebsd.org
PERL_VERSION=5.10.1
WITH_MOZILLA=xulrunner
WIHT_GECKO=libxul
WORKDIRPREFIX=/usr/tmp

OVERRIDE_LINUX_BASE_PORT=f10
OVERRIDE_LINUX_NONBASE_PORTS=f10
```
after coment CPUTYPE?=athlon64
after portupgrade -f /var/db/pkg/lsof-4.83B,4/
the same error


----------



## zeiz (Jul 11, 2010)

It could be a temporary problem connected with 8-STABLE moving. I used to have a similar very seldom, more often on 9-CURRENT though.
To fix I wait till Tuesday, update src and rebuild world+kernel.


----------



## wblock@ (Jul 12, 2010)

burkoff said:
			
		

> cat /etc/make.conf
> 
> ```
> WORKDIRPREFIX=/usr/tmp
> ```



Why?  Maybe okay, but I'd remove that unless there's good reason.


> ```
> OVERRIDE_LINUX_BASE_PORT=f10
> OVERRIDE_LINUX_NONBASE_PORTS=f10
> ```


Pretty sure those are obsolete and not a great idea in the first place.  But shouldn't interfere with lsof.

4.84_5 builds here (i386) without complaints on 8-stable as of today.

PS: you appear to have nfe(4) built into your kernel and loading from /boot/loader.conf.  Only one is needed.


----------



## fronclynne (Jul 12, 2010)

wblock said:
			
		

> Why?  Maybe okay, but I'd remove that unless there's good reason.
> 
> Pretty sure those are obsolete and not a great idea in the first place.  But shouldn't interfere with lsof.



(nested quoting sucks here, huh?)

No, it builds fine here with *WORKDIRPREFIX=* set on amd64.

And yes, you definitely need those linux version bits for things like linux-opera.  Don't mislead the poor man.


But it looks to my untrained eye that it's pulling the error from /usr/src/sys/sys/user.h

```
#ifndef _KERNEL
#ifndef KINFO_PROC_SIZE
#error "Unknown architecture"
#endif
#endif /* !_KERNEL */
```

I don't know anything, really, though.  You might ask on the lists or contact the maintainer.


----------



## wblock@ (Jul 13, 2010)

fronclynne said:
			
		

> (nested quoting sucks here, huh?)
> 
> No, it builds fine here with *WORKDIRPREFIX=* set on amd64.
> 
> And yes, you definitely need those linux version bits for things like linux-opera.  Don't mislead the poor man.



linux_base-f10 is the default for FreeBSD 8.x, although I admit I haven't tested linux-opera with it.


----------



## fronclynne (Jul 13, 2010)

wblock said:
			
		

> linux_base-f10 is the default for FreeBSD 8.x, although I admit I haven't tested linux-opera with it.



Ah, my apologies.  Last time I looked -f6 was the default, and you had to specify -f8 (or -f10) if you wanted to install certain programs.  I'll admit I set the variable in early 2009, I think.  I haven't bothered to change it.


----------



## burkoff (Jul 14, 2010)

*Thanks to all*
FreeBSD mania 8.1-PRERELEASE FreeBSD 8.1-PRERELEASE #0: Wed Jul 14 22:04:10 EEST 2010     root@mania:/usr/obj/usr/src/sys/V1P3R  amd64

now everything is ok


----------



## ssoorruu (Jan 11, 2012)

*same issue here with FreeBSD 8.0*

Hi all, may I know what the solution is? Maybe I misread above description without being careful. FYI, mine is: 
	
	



```
FreeBSD 8.0-RELEASE FreeBSD 8.0-RELEASE #1: Wed May 12 14:54:32 WIT 2010 i386
```

Thanks in advance.


----------



## SirDice (Jan 11, 2012)

ssoorruu said:
			
		

> ```
> FreeBSD 8.0-RELEASE FreeBSD 8.0-RELEASE #1: Wed May 12 14:54:32 WIT 2010 i386
> ```



8.0 went end-of-life on 30 November 2010 and thus isn't supported anymore.


----------

