# Make buildkernel error with 8.0



## ctaranotte (Nov 25, 2009)

I tried to build a customized kernel against 8.0 but I got the following error: 


```
MAKE=make sh /usr/src/sys/conf/newvers.sh kernel80c
/usr/local/libexec/ccache/world-cc -c -O2 -pipe -fno-strict-aliasing -march=pentium4 -std=c99  
-Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith 
-Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc  -I. -I/usr/src/sys 
-I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common 
-finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 
-mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 
-ffreestanding -fstack-protector -Werror  vers.c
linking kernel
clock.o(.text+0x635): In function `clkintr':
: undefined reference to `lapic_cyclic_clock_func'
*** Error code 1
```

I should also mention that the sources were grabbed from cvs.freebsd.org.

Any idea or suggestion?


----------



## LateNiteTV (Nov 26, 2009)

have you tried disabling ccache?


----------



## ctaranotte (Nov 26, 2009)

I disabled ccache and got the same error.


```
MAKE=make sh /usr/src/sys/conf/newvers.sh kernel80c
cc -c -O2 -pipe -fno-strict-aliasing -march=pentium4 -std=c99  -Wall -Wredundant
 -decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith 
-Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc
 -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS 
-include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 
--param large-function-growth=1000  -mno-align-long-strings -mpreferred-stack-boundary=2  
-mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -fstack-protector -Werror  vers.c
linking kernel
clock.o(.text+0x635): In function `clkintr':
: undefined reference to `lapic_cyclic_clock_func'
*** Error code 1
```


----------



## zeiz (Nov 26, 2009)

I had similar stuff couple of times when I made a mistake with options in the configfile. After reviewing of my "job" and making corrections everything was built smoothly.


----------



## SirDice (Nov 26, 2009)

Not sure which part is missing, could you post your kernel config please?


----------



## ctaranotte (Nov 26, 2009)

Here is my kernel config:


```
cpu             I486_CPU
cpu             I586_CPU
cpu		I686_CPU
ident		kernel80c

options 	SCHED_ULE		# ULE scheduler
options 	PREEMPTION		# Enable kernel thread preemption
options 	INET			# InterNETworking
options 	INET6			# IPv6 communications protocols
options 	SCTP			# Stream Control Transmission Protocol
options 	FFS			# Berkeley Fast Filesystem
options 	SOFTUPDATES		# Enable FFS soft updates support
options 	UFS_ACL			# Support for access control lists
options 	UFS_DIRHASH		# Improve performance on big directories
options 	UFS_GJOURNAL		# Enable gjournal-based UFS journaling
options 	MD_ROOT			# MD is a potential root device
options 	NFSCLIENT		# Network Filesystem Client
options 	NFSSERVER		# Network Filesystem Server
options 	NFSLOCKD		# Network Lock Manager
options 	NFS_ROOT		# NFS usable as /, requires NFSCLIENT
options 	MSDOSFS			# MSDOS Filesystem
options 	CD9660			# ISO 9660 Filesystem
options 	PROCFS			# Process filesystem (requires PSEUDOFS)
options 	PSEUDOFS		# Pseudo-filesystem framework
options 	GEOM_PART_GPT		# GUID Partition Tables.
options 	GEOM_LABEL		# Provides labelization
options 	COMPAT_43TTY		# BSD 4.3 TTY compat (sgtty)
options 	COMPAT_FREEBSD4		# Compatible with FreeBSD4
options 	COMPAT_FREEBSD5		# Compatible with FreeBSD5
options 	COMPAT_FREEBSD6		# Compatible with FreeBSD6
options 	COMPAT_FREEBSD7		# Compatible with FreeBSD7
options 	SCSI_DELAY=5000		# Delay (in ms) before probing SCSI
options 	KTRACE			# ktrace(1) support
options 	STACK			# stack(9) support
options 	SYSVSHM			# SYSV-style shared memory
options 	SYSVMSG			# SYSV-style message queues
options 	SYSVSEM			# SYSV-style semaphores
options 	P1003_1B_SEMAPHORES	# POSIX-style semaphores
options 	_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
options 	PRINTF_BUFR_SIZE=128	# Prevent printf output being interspersed.
options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev
options 	HWPMC_HOOKS		# Necessary kernel hooks for hwpmc(4)
options 	AUDIT			# Security event auditing
options 	MAC			# TrustedBSD MAC Framework
options		FLOWTABLE		# per-cpu routing cache
options 	KDTRACE_HOOKS		# Kernel DTrace hooks

options 	NETGRAPH
options 	NETGRAPH_ETHER
options 	NETGRAPH_SOCKET
options 	NETGRAPH_PPPOE

device        	pf
device        	pflog
device        	pfsync

options 	ALTQ
options 	ALTQ_CBQ # Class Bases Queueing
options 	ALTQ_RED # Random Early Drop
options 	ALTQ_RIO # RED In/Out
options 	ALTQ_HFSC # Hierarchical Packet Scheduler
options 	ALTQ_CDNR # Traffic conditioner
options 	ALTQ_PRIQ # Priority Queueing

# CPU frequency control
device		cpufreq

# Bus support.
device		acpi
device		eisa
device		pci

# Floppy drives
device		fdc

# ATA and ATAPI devices
device		ata
device		atadisk		# ATA disk drives
device		ataraid		# ATA RAID drives
device		atapicd		# ATAPI CDROM drives
device		atapifd		# ATAPI floppy drives
device		atapist		# ATAPI tape drives
options 	ATA_STATIC_ID	# Static device numbering

# SCSI peripherals
device		scbus		# SCSI bus (required for SCSI)
device		ch		# SCSI media changers
device		da		# Direct Access (disks)
device		sa		# Sequential Access (tape etc)
device		cd		# CD
device		pass		# Passthrough device (direct SCSI access)
device		ses		# SCSI Environmental Services (and SAF-TE)

# atkbdc0 controls both the keyboard and the PS/2 mouse
device		atkbdc		# AT keyboard controller
device		atkbd		# AT keyboard
device		psm		# PS/2 mouse
device		kbdmux		# keyboard multiplexer
device		vga		# VGA video card driver
device		splash		# Splash screen and screen saver support

# syscons is the default console driver, resembling an SCO console
device		sc

device		agp		# support several AGP chipsets

# Add suspend/resume support for the i8254.
device		pmtimer

# Serial (COM) ports
device		uart		# Generic UART driver

# Parallel port
device		ppc
device		ppbus		# Parallel port bus (required)
device		lpt		# Printer
device		plip		# TCP/IP over parallel
device		ppi		# Parallel port interface device
device		vpo		# Requires scbus and da

# PCI Ethernet NICs that use the common MII bus controller code.
# NOTE: Be sure to keep the 'device miibus' line in order to use these NICs!
device		miibus		# MII bus support
device		dc		# DEC/Intel 21143 and various workalikes
device		fxp		# Intel EtherExpress PRO/100B (82557, 82558)
device		rl		# RealTek 8129/8139
device		xl		# 3Com 3c90x (``Boomerang'', ``Cyclone'')
device  	rlphy  		

# Pseudo devices.
device		loop		# Network loopback
device		random		# Entropy device
device		ether		# Ethernet support
device		tun		# Packet tunnel.
device		pty		# BSD-style compatibility pseudo ttys
device		md		# Memory "disks"
device		gif		# IPv6 and IPv4 tunneling
device		faith		# IPv6-to-IPv4 relaying (translation)
device		firmware	# firmware assist module

# The `bpf' device enables the Berkeley Packet Filter.
# Be aware of the administrative consequences of enabling this!
# Note that 'bpf' is required for DHCP.
device		bpf		# Berkeley packet filter

# USB support
device		uhci		# UHCI PCI->USB interface
device		ohci		# OHCI PCI->USB interface
device		ehci		# EHCI PCI->USB interface (USB 2.0)
device		usb		# USB Bus (required)
#device		udbp		# USB Double Bulk Pipe devices
device		uhid		# "Human Interface Devices"
device		ukbd		# Keyboard
device		ulpt		# Printer
device		umass		# Disks/Mass storage - Requires scbus and da
device		ums		# Mouse
device		urio		# Diamond Rio 500 MP3 player
```


----------



## ctaranotte (Nov 26, 2009)

And my system message buffer:


```
FreeBSD 7.2-STABLE #1: Wed Jun 10 16:25:17 CEST 2009
    root@daffy.utopia:/usr/obj/usr/src/sys/kernel72c
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Pentium(R) 4 CPU 3.00GHz (2992.71-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0xf41  Stepping = 1
  Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0x441d<SSE3,DTES64,MON,DS_CPL,CNXT-ID,xTPR>
  Logical CPUs per core: 2
real memory  = 2147418112 (2047 MB)
avail memory = 2095894528 (1998 MB)
kbd1 at kbdmux0
acpi0: <COMPAQ CPQ0064> on motherboard
acpi0: [ITHREAD]
acpi0: Power Button (fixed)
acpi0: reservation of 0, a0000 (3) failed
acpi0: reservation of 100000, 7ff00000 (3) failed
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0xf808-0xf80b on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
agp0: <Intel 82865 host to AGP bridge> on hostb0
pcib1: <PCI-PCI bridge> at device 1.0 on pci0
pci1: <PCI bus> on pcib1
vgapci0: <VGA-compatible display> mem 0xfd000000-0xfdffffff,0xf0000000-0xf7ffffff irq 10 at device 0.0 on pci1
pci0: <serial bus, USB> at device 29.0 (no driver attached)
pci0: <serial bus, USB> at device 29.1 (no driver attached)
pci0: <serial bus, USB> at device 29.7 (no driver attached)
pcib2: <ACPI PCI-PCI bridge> at device 30.0 on pci0
pci5: <ACPI PCI bus> on pcib2
pci5: <network, ethernet> at device 2.0 (no driver attached)
rl0: <RealTek 8139 10/100BaseTX> port 0x1000-0x10ff mem 0xf8511000-0xf85110ff irq 10 at device 9.0 on pci5
miibus0: <MII bus> on rl0
rlphy0: <RealTek internal media interface> PHY 0 on miibus0
rlphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
rl0: Ethernet address: 00:50:bf:93:43:eb
rl0: [ITHREAD]
fxp0: <Intel 82559 Pro/100 Ethernet> port 0x1400-0x143f mem 0xf8510000-0xf8510fff,0xf8400000-0xf84fffff irq 11 at device 10.0 on pci5
miibus1: <MII bus> on fxp0
inphy0: <i82555 10/100 media interface> PHY 1 on miibus1
inphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
fxp0: Ethernet address: 00:50:8b:b8:e3:81
fxp0: [ITHREAD]
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel ICH5 UDMA100 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x24a0-0x24af irq 10 at device 31.1 on pci0
ata0: <ATA channel 0> on atapci0
ata0: [ITHREAD]
ata1: <ATA channel 1> on atapci0
ata1: [ITHREAD]
atapci1: <Intel ICH5 SATA150 controller> port 0x24d0-0x24d7,0x24e8-0x24eb,0x24d8-0x24df,0x24ec-0x24ef,0x24b0-0x24bf irq 10 at device 31.2 on pci0
atapci1: [ITHREAD]
ata2: <ATA channel 0> on atapci1
ata2: [ITHREAD]
ata3: <ATA channel 1> on atapci1
ata3: [ITHREAD]
pci0: <multimedia, audio> at device 31.5 (no driver attached)
acpi_button0: <Power Button> 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]
sio0: <Standard PC COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
sio0: type 16550A
sio0: [FILTER]
fdc0: <floppy drive controller> port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0
fdc0: [FILTER]
cpu0: <ACPI CPU> on acpi0
p4tcc0: <CPU Frequency Thermal Control> on cpu0
orm0: <ISA Option ROMs> at iomem 0xc0000-0xcb7ff,0xcb800-0xcd7ff,0xcd800-0xcefff pnpid ORM0000 on isa0
ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0
ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/13 bytes threshold
ppbus0: <Parallel port bus> on ppc0
ppbus0: [ITHREAD]
plip0: <PLIP network interface> on ppbus0
plip0: WARNING: using obsoleted IFF_NEEDSGIANT flag
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
ppc0: [GIANT-LOCKED]
ppc0: [ITHREAD]
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
sio1: [FILTER]
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
Timecounter "TSC" frequency 2992707682 Hz quality 800
Timecounters tick every 1.000 msec
acd0: CDRW <SAMSUNG CD-R/RW SW-240B/R403> at ata0-slave PIO4
ad2: DMA limited to UDMA33, controller found non-ATA66 cable
ad2: 117246MB <Maxtor 6Y120L0 YAR41BW0> at ata1-master UDMA33
```


----------



## SirDice (Nov 26, 2009)

You seem to be missing "device apic". 

You can safely remove "device eisa", not a lot of people have that, it's also a relatively old bus type.


----------



## ctaranotte (Nov 26, 2009)

The faulty line is :
	
	



```
options 	KDTRACE_HOOKS		# Kernel DTrace hooks
```

Once this line commented out, the kernel builds just fine.

For the record, I was looking to enable Dtrace support. Even, with the following lines and the WITH_CTF=1 flag as per Dtrace, make stumbles on the same error.


```
options KDTRACE_HOOKS        # all architectures - enable general DTrace hooks
options DDB_CTF              # all architectures - kernel ELF linker loads CTF data
```

Any idea or suggestion to enable Dtrace support?


----------

