kern/52764: Impossible to build kernel with COPTFLAGS=-O0 and without INET6

Artem 'Zazoobr' Ignatjev timon at memphis.mephi.ru
Mon Jun 9 12:00:30 PDT 2003


The following reply was made to PR kern/52764; it has been noted by GNATS.

From: "Artem 'Zazoobr' Ignatjev" <timon at memphis.mephi.ru>
To: freebsd-gnats-submit at freebsd.org
Cc:  
Subject: Re: kern/52764: Impossible to build kernel with COPTFLAGS=-O0 and
	without INET6
Date: 09 Jun 2003 22:57:45 +0400

 --=-HpuLBCbRsckjuxTS3YTY
 Content-Type: text/plain
 Content-Transfer-Encoding: 7bit
 
 Yar Tikhiy wrote:
 > >Synopsis:       Impossible to build kernel with COPTFLAGS=-O0 and without INET6
 > >Description:
 > 	It appears that the FreeBSD kernel will have unresolved
 > 	references to INET6 functions if its files are compiled
 > 	with "-O0", but without INET6.
 > 
 > 	The root of the problem is in tcp_input.c.  There are places
 > 	in that file where a C if() operator is used as though it
 > 	were #if.  That is, the condition in the operator will be
 > 	a compile-time constant depending on whether INET6 is
 > 	defined.  In all optimization cases but "-O0", gcc(1) will
 > 	just ignore the code since it appears inside dead "if (0) {}"
 > 	blocks if INET6 is undefined.  But with "-O0", gcc(1) will
 > 	include the code into the object file; and the linker will
 > 	consequently fail to link the kernel.
 > 
 > >How-To-Repeat:
 > 	Add "makeoptions COPTFLAGS=-O0" to a kernel configuration file
 > 	and make sure there is no "options INET6" in it.  Try to build
 > 	such a kernel.  
 Yesterday I've cvsupped to RELENG_5, and I'm confirming the bug is still
 there.
 Below are my kernel config and make.conf
 
 
 --=-HpuLBCbRsckjuxTS3YTY
 Content-Disposition: inline; filename=TIMON
 Content-Type: text/plain; name=TIMON; charset=KOI8-R
 Content-Transfer-Encoding: 7bit
 
 #
 # GENERIC -- Generic kernel configuration file for FreeBSD/i386
 #
 # For more information on this file, please read the handbook section on
 # Kernel Configuration Files:
 #
 #    http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
 #
 # The handbook is also available locally in /usr/share/doc/handbook
 # if you've installed the doc distribution, otherwise always see the
 # FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
 # latest information.
 #
 # An exhaustive list of options and more detailed explanations of the
 # device lines is also present in the ../../conf/NOTES and NOTES files. 
 # If you are in doubt as to the purpose or necessity of a line, check first 
 # in NOTES.
 #
 # $FreeBSD: src/sys/i386/conf/GENERIC,v 1.369 2002/10/19 16:54:07 rwatson Exp $
 
 machine		i386
 cpu		I586_CPU
 cpu		I686_CPU
 ident		TIMON
 maxusers	0
 
 #To statically compile in device wiring instead of /boot/device.hints
 #hints		"GENERIC.hints"		#Default places to look for devices.
 
 #makeoptions	DEBUG=-g		#Build kernel with gdb(1) debug symbols
 
 options 	INET			#InterNETworking
 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 	NFSCLIENT		#Network Filesystem Client
 options 	NFSSERVER		#Network Filesystem Server
 options 	MSDOSFS			#MSDOS Filesystem
 options 	CD9660			#ISO 9660 Filesystem
 options 	PROCFS			#Process filesystem (requires PSEUDOFS)
 options 	PSEUDOFS		#Pseudo-filesystem framework
 options 	COMPAT_43		#Compatible with BSD 4.3 [KEEP THIS!]
 options 	COMPAT_FREEBSD4		#Compatible with FreeBSD4
 options 	SCSI_DELAY=15000	#Delay (in ms) before probing SCSI
 options 	KTRACE			#ktrace(1) support
 options 	SYSVSHM			#SYSV-style shared memory
 options 	SYSVMSG			#SYSV-style message queues
 options 	SYSVSEM			#SYSV-style semaphores
 options 	_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
 options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev
 #options		SCHED_ULE
 options		SCHED_4BSD
 
 # Debugging for use in -current
 #options 	DDB			#Enable the kernel debugger
 #options 	INVARIANTS		#Enable calls of extra sanity checking
 #options 	INVARIANT_SUPPORT	#Extra sanity checks of internal structures, required by INVARIANTS
 #options 	WITNESS			#Enable checks to detect deadlocks and cycles
 #options 	WITNESS_SKIPSPIN	#Don't run witness on spinlocks for speed
 
 
 device		isa
 device		pci
 
 # Floppy drives
 device		fdc
 
 # ATA and ATAPI devices
 device		ata
 device		atadisk			# ATA disk drives
 device		atapicd			# ATAPI CDROM drives
 options 	ATA_STATIC_ID		#Static device numbering
 
 # SCSI peripherals
 device		scbus		# SCSI bus (required)
 device		da		# Direct Access (disks)
 device		pass		# Passthrough device (direct SCSI access)
 #device		ses		# SCSI Environmental Services (and SAF-TE)
 
 device		atkbdc		# AT keyboard controller
 device		atkbd		# AT keyboard
 device		psm		# PS/2 mouse
 
 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
 
 # Floating point support - do not disable.
 device		npx
 
 # Power management support (see NOTES for more options)
 device		apm
 # Add suspend/resume support for the i8254.
 device		pmtimer
 
 # Serial (COM) ports
 device		sio		# 8250, 16[45]50 based serial ports
 
 # 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
 
 
 device		miibus		# MII bus support
 device		fxp		# Intel EtherExpress PRO/100B (82557, 82558)
 device		rl		# RealTek 8129/8139
 
 # Pseudo devices - the number indicates how many units to allocate.
 device		random		# Entropy device
 device		loop		# Network loopback
 device		ether		# Ethernet support
 device		tun		# Packet tunnel.
 device		pty		# Pseudo-ttys (telnet etc)
 device		md		# Memory "disks"
 device		gif		# IPv6 and IPv4 tunneling
 
 # The `bpf' device enables the Berkeley Packet Filter.
 # Be aware of the administrative consequences of enabling this!
 device		bpf		# Berkeley packet filter
 
 # USB support
 device		uhci		# UHCI PCI->USB interface
 device		ohci		# OHCI PCI->USB interface
 device		usb		# USB Bus (required)
 device		udbp		# USB Double Bulk Pipe devices
 device		ugen		# Generic
 #device		uhid		# "Human Interface Devices"
 #device		ukbd		# Keyboard
 #device		ulpt		# Printer
 device		umass		# Disks/Mass storage - Requires scbus and da
 device		ums		# Mouse
 device		pcm
 device		midi
 device		seq
 options NETGRAPH
 options NETSMB
 options NETSMBCRYPTO
 options LIBMCHAIN
 options LIBICONV
 options SMBFS
 options FB_INSTALL_CDEV
 options	NTFS
 options EXT2FS
 options SC_PIXEL_MODE
 options SC_MOUSE_CHAR="0x03"
 options VESA
 options UFS_EXTATTR
 options	UFS_EXTATTR_AUTOSTART
 
 device	smbus
 device	iicbb
 device	iicbus
 device	bktr
 options 	NETGRAPH
 options 	NETGRAPH_BPF
 options 	NETGRAPH_ECHO
 options 	NETGRAPH_ETHER
 options 	NETGRAPH_GIF
 options 	NETGRAPH_GIF_DEMUX
 options 	NETGRAPH_HOLE
 options 	NETGRAPH_IFACE
 options 	NETGRAPH_IP_INPUT
 options 	NETGRAPH_KSOCKET
 options 	NETGRAPH_L2TP
 options 	NETGRAPH_LMI
 options 	NETGRAPH_MPPC_ENCRYPTION
 options 	NETGRAPH_ONE2MANY
 options 	NETGRAPH_PPP
 options 	NETGRAPH_PPPOE
 options 	NETGRAPH_PPTPGRE
 options 	NETGRAPH_RFC1490
 options 	NETGRAPH_SOCKET
 options 	NETGRAPH_SPLIT
 options 	NETGRAPH_TEE
 options 	GEOM_BSD
 options 	GEOM_MBR
 #options 	GEOM_SUNLABEL
 #options 	GEOM_SUNLABEL_X86
 device		ichsmb
 device		acpi
 device		ic
 device		iic
 device		iicsmb
 
 --=-HpuLBCbRsckjuxTS3YTY
 Content-Disposition: inline; filename=make.conf
 Content-Type: text/plain; name=make.conf; charset=KOI8-R
 Content-Transfer-Encoding: 7bit
 
 CPUTYPE=i686
 MASTER_SITES_OVERRIDE=ftp://ftp.gamma.ru/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/ ftp://ftp.chg.ru/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/
 FETCH_CMD="/usr/local/bin/portfetch"
 NO_FORTRAN=	true
 NO_I4B= true
 NO_IPFILTER= true
 NO_PERL= true
 NOUUCP=	true
 MAKE_KERBEROS4= false
 MAKE_KERBEROS5= false
 #NO_CPU_CFLAGS=true
 #NO_CPU_COPTFLAGS=true
 COPTFLAGS=
 NO_KERBEROS5=true
 #NO_SHAREDOCS=	true	# do not build the 4.4BSD legacy docs
 # -- use.perl generated deltas -- #
 # Created: Mon May 19 21:12:51 2003
 # Setting to use base perl from ports:
 PERL_VER=5.6.1
 PERL_VERSION=5.6.1
 PERL_ARCH=mach
 NOPERL=yo
 NO_PERL=yo
 NO_PERL_WRAPPER=yo
 KERNCONF=TIMON
 
 --=-HpuLBCbRsckjuxTS3YTY--
 


More information about the freebsd-bugs mailing list