# 11.1 Kernel Build Error



## hashbang (Aug 21, 2017)

I'm interested in using VIMAGE, so I created a new GENERIC, and the only difference is including VIMAGE. The compile failed. So I used a vanilla GENERIC file, and the build still failed.

Started the compile right after a freebsd-update to 11.1-RELEASE-p1.

Compile command:

```
# cd /usr/src
# make buildkernel
```


```
# uname -a
FreeBSD files 11.1-RELEASE-p1 FreeBSD 11.1-RELEASE-p1 #0: Wed Aug  9 11:55:48 UTC 2017     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
```

Thanks for any help!

The error follows:


```
===> mdio (all)
machine -> /usr/src/sys/amd64/include
x86 -> /usr/src/sys/x86/include
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/dev/etherswitch/mdio_if.m -c
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/dev/etherswitch/mdio_if.m -h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/device_if.m -h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/bus_if.m -h
cc -target x86_64-unknown-freebsd11.1 --sysroot=/usr/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/bin -O2 -pipe  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -DHAVE_KERNEL_OPTION_HEADERS -include /usr/obj/usr/src/sys/GENERIC/opt_global.h -I. -I/usr/src/sys -fno-common -g -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/obj/usr/src/sys/GENERIC  -MD  -MF.depend.mdio.o -MTmdio.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -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-error-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -c /usr/src/sys/dev/mdio/mdio.c -o mdio.o
/usr/src/sys/dev/mdio/mdio.c:90:10: error: implicit declaration of function 'MDIO_READEXTREG' is invalid in C99
      [-Werror,-Wimplicit-function-declaration]
        return (MDIO_READEXTREG(device_get_parent(dev), phy, devad, reg));
                ^
/usr/src/sys/dev/mdio/mdio.c:90:10: note: did you mean 'MDIO_READREG'?
./mdio_if.h:22:21: note: 'MDIO_READREG' declared here
static __inline int MDIO_READREG(device_t dev, int phy, int reg)
                    ^
/usr/src/sys/dev/mdio/mdio.c:90:10: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
        return (MDIO_READEXTREG(device_get_parent(dev), phy, devad, reg));
                ^
/usr/src/sys/dev/mdio/mdio.c:98:10: error: implicit declaration of function 'MDIO_WRITEEXTREG' is invalid in C99
      [-Werror,-Wimplicit-function-declaration]
        return (MDIO_WRITEEXTREG(device_get_parent(dev), phy, devad, reg, val));
                ^
/usr/src/sys/dev/mdio/mdio.c:98:10: note: did you mean 'MDIO_WRITEREG'?
./mdio_if.h:34:21: note: 'MDIO_WRITEREG' declared here
static __inline int MDIO_WRITEREG(device_t dev, int phy, int reg, int val)
                    ^
/usr/src/sys/dev/mdio/mdio.c:98:10: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
        return (MDIO_WRITEEXTREG(device_get_parent(dev), phy, devad, reg, val));
                ^
/usr/src/sys/dev/mdio/mdio.c:123:2: error: use of undeclared identifier 'mdio_readextreg_desc'; did you mean
      'mdio_readreg_desc'?
        DEVMETHOD(mdio_readextreg,      mdio_readextreg),
        ^
/usr/src/sys/sys/bus.h:724:19: note: expanded from macro 'DEVMETHOD'
#define DEVMETHOD       KOBJMETHOD
                        ^
/usr/src/sys/sys/kobj.h:98:5: note: expanded from macro 'KOBJMETHOD'
        { &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) }
           ^
<scratch space>:14:1: note: expanded from here
mdio_readextreg_desc
^
./mdio_if.h:18:27: note: 'mdio_readreg_desc' declared here
extern struct kobjop_desc mdio_readreg_desc;
                          ^
/usr/src/sys/dev/mdio/mdio.c:123:2: error: expected expression
        DEVMETHOD(mdio_readextreg,      mdio_readextreg),
        ^
/usr/src/sys/sys/bus.h:724:19: note: expanded from macro 'DEVMETHOD'
#define DEVMETHOD       KOBJMETHOD
                        ^
/usr/src/sys/sys/kobj.h:98:52: note: expanded from macro 'KOBJMETHOD'
        { &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) }
                                                          ^
/usr/src/sys/dev/mdio/mdio.c:123:2: error: use of undeclared identifier 'mdio_readextreg_t'; did you mean
      'mdio_readextreg'?
/usr/src/sys/sys/bus.h:724:19: note: expanded from macro 'DEVMETHOD'
#define DEVMETHOD       KOBJMETHOD
                        ^
/usr/src/sys/sys/kobj.h:98:42: note: expanded from macro 'KOBJMETHOD'
        { &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) }
                                                ^
<scratch space>:14:1: note: expanded from here
mdio_readextreg_t
^
/usr/src/sys/dev/mdio/mdio.c:87:1: note: 'mdio_readextreg' declared here
mdio_readextreg(device_t dev, int phy, int devad, int reg)
^
/usr/src/sys/dev/mdio/mdio.c:124:2: error: use of undeclared identifier 'mdio_writeextreg_desc'; did you mean
      'mdio_writereg_desc'?
        DEVMETHOD(mdio_writeextreg,     mdio_writeextreg),
        ^
/usr/src/sys/sys/bus.h:724:19: note: expanded from macro 'DEVMETHOD'
#define DEVMETHOD       KOBJMETHOD
                        ^
/usr/src/sys/sys/kobj.h:98:5: note: expanded from macro 'KOBJMETHOD'
        { &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) }
           ^
<scratch space>:14:1: note: expanded from here
mdio_writeextreg_desc
^
./mdio_if.h:30:27: note: 'mdio_writereg_desc' declared here
extern struct kobjop_desc mdio_writereg_desc;
                          ^
/usr/src/sys/dev/mdio/mdio.c:124:2: error: expected expression
        DEVMETHOD(mdio_writeextreg,     mdio_writeextreg),
        ^
/usr/src/sys/sys/bus.h:724:19: note: expanded from macro 'DEVMETHOD'
#define DEVMETHOD       KOBJMETHOD
                        ^
/usr/src/sys/sys/kobj.h:98:52: note: expanded from macro 'KOBJMETHOD'
        { &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) }
                                                          ^
/usr/src/sys/dev/mdio/mdio.c:124:2: error: use of undeclared identifier 'mdio_writeextreg_t'; did you mean
      'mdio_writeextreg'?
/usr/src/sys/sys/bus.h:724:19: note: expanded from macro 'DEVMETHOD'
#define DEVMETHOD       KOBJMETHOD
                        ^
/usr/src/sys/sys/kobj.h:98:42: note: expanded from macro 'KOBJMETHOD'
        { &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) }
                                                ^
<scratch space>:14:1: note: expanded from here
mdio_writeextreg_t
^
/usr/src/sys/dev/mdio/mdio.c:94:1: note: 'mdio_writeextreg' declared here
mdio_writeextreg(device_t dev, int phy, int devad, int reg,
^
10 errors generated.
*** Error code 1
```


----------



## SirDice (Aug 21, 2017)

What's in /etc/make.conf and/or /etc/src.conf?


----------



## acheron (Aug 21, 2017)

And `svn info /usr/src`


----------



## hashbang (Aug 22, 2017)

/etc/make.conf and /etc/src.conf do not exist.

`$ svn info /usr/src
svn: E155007: '/usr/src' is not a working copy`


----------



## acheron (Aug 22, 2017)

Where did you grab your src tree?


----------



## hashbang (Aug 22, 2017)

The src tree came from freebsd-update.

Thanks


----------

