[Bug 258496] Buildkernel fails with DEBUGNET and without VIMAGE

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 14 Sep 2021 12:51:17 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258496

            Bug ID: 258496
           Summary: Buildkernel fails with DEBUGNET and without VIMAGE
           Product: Base System
           Version: CURRENT
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: ktullavik@gmail.com

I'm on git hash: 29545986bdf6c949671e61fc46ee3f2440b1535b 

Adding VIMAGE to the kernel config (or removing DEBUGNET) fixes the following
error.

# make -j1 KERNCONF=VBsd make buildkernel

...
cc -target x86_64-unknown-freebsd14.0
--sysroot=/usr/obj/usr/src/amd64.amd64/tmp
-B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -c -O2 -pipe  -fno-strict-aliasing 
-g -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include
-I/usr/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include
opt_global.h -fno-common    -fno-omit-frame-pointer
-mno-omit-leaf-frame-pointer -MD  -MF.depend.debugnet.o -MTdebugnet.o
-fdebug-prefix-map=./machine=/usr/src/sys/amd64/include
-fdebug-prefix-map=./x86=/usr/src/sys/x86/include -mcmodel=kernel -mno-red-zone
-mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding
-fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef
-Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs
-fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error=tautological-compare
-Wno-error=empty-body -Wno-error=parentheses-equality
-Wno-error=unused-function -Wno-error=pointer-sign
-Wno-error=shift-negative-value -Wno-address-of-packed-member
-Wno-format-zero-length   -mno-aes -mno-avx  -std=iso9899:1999 -Werror
/usr/src/sys/net/debugnet.c
/usr/src/sys/net/debugnet.c:783:1: error: expected identifier
MTX_SYSINIT(debugnet_hwm_lock, &dn_hwm_lk, "Debugnet HWM lock", MTX_DEF);
^
/usr/src/sys/sys/mutex.h:533:19: note: expanded from macro 'MTX_SYSINIT'
            mtx_sysinit, &name##_args);                                 \
                         ^
/usr/src/sys/net/debugnet.c:783:1: error: type specifier missing, defaults to
'int' [-Werror,-Wimplicit-int]
/usr/src/sys/sys/mutex.h:532:2: note: expanded from macro 'MTX_SYSINIT'
        SYSINIT(name##_mtx_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE,       \
        ^
/usr/src/sys/net/debugnet.c:783:1: error: this function declaration is not a
prototype [-Werror,-Wstrict-prototypes]
/usr/src/sys/sys/mutex.h:532:9: note: expanded from macro 'MTX_SYSINIT'
        SYSINIT(name##_mtx_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE,       \
               ^
/usr/src/sys/net/debugnet.c:783:1: error: expected identifier
/usr/src/sys/sys/mutex.h:535:20: note: expanded from macro 'MTX_SYSINIT'
            _mtx_destroy, __DEVOLATILE(void *, &(mtx)->mtx_lock))
                          ^
/usr/src/sys/sys/cdefs.h:627:33: note: expanded from macro '__DEVOLATILE'
#define __DEVOLATILE(type, var) ((type)(__uintptr_t)(volatile void *)(var))
                                ^
/usr/src/sys/net/debugnet.c:783:1: error: type specifier missing, defaults to
'int' [-Werror,-Wimplicit-int]
/usr/src/sys/sys/mutex.h:534:2: note: expanded from macro 'MTX_SYSINIT'
        SYSUNINIT(name##_mtx_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE,   \
        ^
/usr/src/sys/net/debugnet.c:783:1: error: this function declaration is not a
prototype [-Werror,-Wstrict-prototypes]
/usr/src/sys/sys/mutex.h:534:11: note: expanded from macro 'MTX_SYSINIT'
        SYSUNINIT(name##_mtx_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE,   \
                 ^
/usr/src/sys/net/debugnet.c:873:42: error: expected ')'
SYSINIT(dn_evh_init, SI_SUB_EVENTHANDLER + 1, SI_ORDER_ANY, dn_evh_init, NULL);
                                         ^
/usr/src/sys/net/debugnet.c:873:8: note: to match this '('
SYSINIT(dn_evh_init, SI_SUB_EVENTHANDLER + 1, SI_ORDER_ANY, dn_evh_init, NULL);
       ^
/usr/src/sys/net/debugnet.c:873:1: error: type specifier missing, defaults to
'int' [-Werror,-Wimplicit-int]
SYSINIT(dn_evh_init, SI_SUB_EVENTHANDLER + 1, SI_ORDER_ANY, dn_evh_init, NULL);
^
/usr/src/sys/net/debugnet.c:873:9: error: a parameter list without types is
only allowed in a function definition
SYSINIT(dn_evh_init, SI_SUB_EVENTHANDLER + 1, SI_ORDER_ANY, dn_evh_init, NULL);
        ^
9 errors generated.
*** [debugnet.o] Error code 1

make[2]: stopped in /usr/obj/usr/src/amd64.amd64/sys/VBsd
1 error

make[2]: stopped in /usr/obj/usr/src/amd64.amd64/sys/VBsd
     1205.97 real       784.44 user       412.24 sys

make[1]: stopped in /usr/src

make: stopped in /usr/src



KERNCONF:

cpu             HAMMER
ident           GENERIC

makeoptions     DEBUG=-g                # Build kernel with gdb(1) debug
symbols
makeoptions     WITH_CTF=1              # Run ctfconvert(1) for DTrace support

options         SCHED_ULE               # ULE scheduler
options         NUMA                    # Non-Uniform Memory Architecture
support
options         PREEMPTION              # Enable kernel thread preemption
#options         VIMAGE
options         INET                    # InterNETworking
options         INET6
options         FIB_ALGO                # Modular fib lookups
options         TCP_OFFLOAD             # TCP offload
options         TCP_BLACKBOX            # Enhanced TCP event logging
options         TCP_HHOOK               # hhook(9) framework for TCP
options         TCP_RFC7413             # TCP Fast Open
options         KERN_TLS                # TLS transmit & receive offload
options         FFS                     # Berkeley Fast Filesystem
options         SOFTUPDATES             # Enable FFS soft updates support
options         UFS_DIRHASH             # Improve performance on big
directories
options         UFS_GJOURNAL            # Enable gjournal-based UFS journaling
options         NFSCL                   # Network Filesystem Client
options         NFSD                    # Network Filesystem Server
options         NFSLOCKD                # Network Lock Manager
options         MSDOSFS                 # MSDOS Filesystem
options         CD9660                  # ISO 9660 Filesystem
options         PROCFS                  # Process filesystem (requires
PSEUDOFS)
options         PSEUDOFS                # Pseudo-filesystem framework
options         TMPFS                   # Efficient memory filesystem
options         GEOM_RAID               # Soft RAID functionality.
options         GEOM_LABEL              # Provides labelization
options         EFIRT                   # EFI Runtime Services support
options         COMPAT_FREEBSD32        # Compatible with i386 binaries
options         COMPAT_FREEBSD10        # Compatible with FreeBSD10
options         COMPAT_FREEBSD11        # Compatible with FreeBSD11
options         COMPAT_FREEBSD12        # Compatible with FreeBSD12
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         _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         CAPABILITY_MODE         # Capsicum capability mode
options         CAPABILITIES            # Capsicum capabilities
options         KDTRACE_FRAME           # Ensure frames are compiled in
options         KDTRACE_HOOKS           # Kernel DTrace hooks
options         DDB_CTF                 # Kernel ELF linker loads CTF data

# Debugging support.  Always need this:
options         KDB                     # Enable kernel debugger support.
options         KDB_TRACE               # Print a stack trace for a panic.

# Kernel dump features.
options         EKCD                    # Support for encrypted kernel dumps
options         ZSTDIO                  # zstd-compressed kernel and user dumps
options         DEBUGNET                # debugnet networking
options         NETDUMP                 # netdump(4) client support
options         NETGDB                  # netgdb(4) client support

# Make an SMP-capable kernel by default
options         SMP                     # Symmetric MultiProcessor Kernel
options         EARLY_AP_STARTUP

# CPU frequency control
device          cpufreq

# Bus support.
device          acpi
device          smbios
options         IOMMU
device          pci
options         PCI_HP                  # PCI-Express native HotPlug
options         PCI_IOV                 # PCI SR-IOV support

# ATA controllers
device          ahci                    # AHCI-compatible SATA controllers

# ATA/SCSI peripherals
device          scbus                   # SCSI bus (required for ATA/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 ATA/SCSI
access)

# NVM Express (NVMe) support
device          nvme                    # base NVMe driver
device          nvd                     # expose NVMe namespaces as disks,
depends on nvme

# 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
options         VESA                    # Add support for VESA BIOS Extensions
(VBE)

device          splash                  # Splash screen and screen saver
support

# syscons is the default console driver, resembling an SCO console
device          sc
options         SC_PIXEL_MODE           # add support for the raster text mode

# vt is the new video console driver
device          vt
device          vt_vga
device          vt_efifb
device          vt_vbefb

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

# PCI/PCI-X/PCIe Ethernet NICs that use iflib infrastructure
device          iflib
device          em                      # Intel PRO/1000 Gigabit Ethernet
Family

# Pseudo devices.
device          crypto                  # core crypto support
device          aesni                   # AES-NI OpenCrypto module
device          loop                    # Network loopback
device          rdrand_rng              # Intel Bull Mountain RNG
device          ether                   # Ethernet support
device          vlan                    # 802.1Q VLAN support
device          tuntap                  # Packet tunnel.
device          md                      # Memory "disks"
device          gif                     # IPv6 and IPv4 tunneling
device          firmware                # firmware assist module
device          xz                      # lzma decompression
device          bpf                     # Berkeley packet filter

# USB support
options         USB_DEBUG               # enable debug msgs
device          uhci                    # UHCI PCI->USB interface
device          ohci                    # OHCI PCI->USB interface
device          ehci                    # EHCI PCI->USB interface (USB 2.0)
device          xhci                    # XHCI PCI->USB interface (USB 3.0)
device          usb                     # USB Bus (required)
device          ukbd                    # Keyboard
device          umass                   # Disks/Mass storage - Requires scbus
and da

# Sound support
device          sound                   # Generic sound driver (required)
device          snd_hda                 # Intel High Definition Audio
device          snd_ich                 # Intel, NVidia and other ICH AC'97
Audio

# VirtIO support
device          virtio                  # Generic VirtIO bus (required)
device          virtio_pci              # VirtIO PCI device
device          vtnet                   # VirtIO Ethernet device
device          virtio_blk              # VirtIO Block device
device          virtio_scsi             # VirtIO SCSI device
device          virtio_balloon          # VirtIO Memory Balloon device

# Linux KVM paravirtualization support
device          kvm_clock               # KVM paravirtual clock driver

# evdev interface
options         EVDEV_SUPPORT           # evdev support in legacy drivers
device          evdev                   # input event device support
device          uinput                  # install /dev/uinput cdev

# HID support
options         HID_DEBUG               # enable debug msgs
device          hid                     # Generic HID support
options         IICHID_SAMPLING         # Workaround missing GPIO INTR support

-- 
You are receiving this mail because:
You are the assignee for the bug.