Bug 257732 - Kernel does not compile if VIMAGE is disabled
Summary: Kernel does not compile if VIMAGE is disabled
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.0-RELEASE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-10 09:15 UTC by 606u
Modified: 2021-08-10 23:52 UTC (History)
1 user (show)

See Also:


Attachments
Fix (299 bytes, text/plain)
2021-08-10 09:15 UTC, 606u
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description 606u 2021-08-10 09:15:26 UTC
Created attachment 227074 [details]
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
Comment 1 606u 2021-08-10 11:04:35 UTC
FreeBSD fbsd130 13.0-RELEASE-p3 FreeBSD 13.0-RELEASE-p3 #0: Tue Jun 29 19:46:20 UTC 2021     root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64