[Bug 257732] Kernel does not compile if VIMAGE is disabled

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 10 Aug 2021 09:15:26 +0000
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257732

            Bug ID: 257732
           Summary: Kernel does not compile if VIMAGE is disabled
           Product: Base System
           Version: 13.0-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs_at_FreeBSD.org
          Reporter: 606u_at_dir.bg

Created attachment 227074
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=227074&action=edit
Fix

Disabling VIMAGE breaks kernel compilation with

../../../net/debugnet.c:778:1: error: expected identifier
MTX_SYSINIT(debugnet_hwm_lock, &dn_hwm_lk, "Debugnet HWM lock", MTX_DEF);
^
../../../sys/mutex.h:533:19: note: expanded from macro 'MTX_SYSINIT'
            mtx_sysinit, &name##_args);                                 \
                         ^
../../../net/debugnet.c:778:1: error: type specifier missing, defaults to 'int'
[-Werror,-Wimplicit-int]
../../../sys/mutex.h:532:2: note: expanded from macro 'MTX_SYSINIT'
        SYSINIT(name##_mtx_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE,       \
        ^
../../../net/debugnet.c:778:1: error: this function declaration is not a
prototype [-Werror,-Wstrict-prototypes]
../../../sys/mutex.h:532:9: note: expanded from macro 'MTX_SYSINIT'
        SYSINIT(name##_mtx_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE,       \
               ^
../../../net/debugnet.c:778:1: error: expected identifier
../../../sys/mutex.h:535:20: note: expanded from macro 'MTX_SYSINIT'
            _mtx_destroy, __DEVOLATILE(void *, &(mtx)->mtx_lock))
                          ^
../../../sys/cdefs.h:632:33: note: expanded from macro '__DEVOLATILE'
#define __DEVOLATILE(type, var) ((type)(__uintptr_t)(volatile void *)(var))
                                ^
../../../net/debugnet.c:778:1: error: type specifier missing, defaults to 'int'
[-Werror,-Wimplicit-int]
../../../sys/mutex.h:534:2: note: expanded from macro 'MTX_SYSINIT'
        SYSUNINIT(name##_mtx_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE,   \
        ^
../../../net/debugnet.c:778:1: error: this function declaration is not a
prototype [-Werror,-Wstrict-prototypes]
../../../sys/mutex.h:534:11: note: expanded from macro 'MTX_SYSINIT'
        SYSUNINIT(name##_mtx_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE,   \
                 ^
../../../net/debugnet.c:868:42: error: expected ')'
SYSINIT(dn_evh_init, SI_SUB_EVENTHANDLER + 1, SI_ORDER_ANY, dn_evh_init, NULL);
                                         ^
../../../net/debugnet.c:868:8: note: to match this '('
SYSINIT(dn_evh_init, SI_SUB_EVENTHANDLER + 1, SI_ORDER_ANY, dn_evh_init, NULL);
       ^
../../../net/debugnet.c:868: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);
^
../../../net/debugnet.c:868: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.


Steps to reproduce: use this kernel configuration file:

    include             GENERIC
    ident               FOO
    nooptions   VIMAGE

How to fix: add missing

    #include <sys/kernel.h>

to /usr/src/sys/net/debugnet.c

-- 
You are receiving this mail because:
You are the assignee for the bug.
Received on Tue Aug 10 2021 - 09:15:26 UTC

Original text of this message