# Errors compiling kernel



## darqen27 (Dec 24, 2013)

I followed the instructions to a "T" and still the kernel will not compile and errors out with missing things.

```
umass.c undefinded references to 'cam_calc_geometry'
umass.o undefined reference to 'scsi_set_sense_data'

goes on with more umass undefined references and then gives error code 1

ispfw.o: In function `module_handler':
ispfw.c:(.text+0x37): undefined reference to `firmware_unregister'
ispfw.c:(.text+0x82): undefined reference to `firmware_unregister'
ispfw.c:(.text+0xd1): undefined reference to `firmware_unregister'
ispfw.c:(.text+0x121): undefined reference to `firmware_unregister'
ispfw.c:(.text+0x171): undefined reference to `firmware_unregister'
ispfw.o:ispfw.c:(.text+0x1c2): more undefined references to `firmware_unregister' follow
ispfw.o: In function `module_handler':
ispfw.c:(.text+0x543): undefined reference to `firmware_register'
ispfw.c:(.text+0x5ab): undefined reference to `firmware_register'
ispfw.c:(.text+0x614): undefined reference to `firmware_register'
ispfw.c:(.text+0x67d): undefined reference to `firmware_register'
ispfw.c:(.text+0x6e7): undefined reference to `firmware_register'
ispfw.o:ispfw.c:(.text+0x750): more undefined references to `firmware_register' follow
umass.o: In function `umass_detach':
umass.c:(.text+0xaf): undefined reference to `xpt_bus_deregister'
umass.c:(.text+0xda): undefined reference to `cam_sim_free'
umass.o: In function `umass_std_transform':
umass.c:(.text+0xb92): undefined reference to `xpt_freeze_devq'
umass.c:(.text+0xba1): undefined reference to `xpt_done'
umass.c:(.text+0xbbb): undefined reference to `xpt_done'
umass.o: In function `umass_cam_cb':
umass.c:(.text+0xc64): undefined reference to `xpt_freeze_devq'
umass.o: In function `umass_cam_sense_cb':
umass.c:(.text+0xda7): undefined reference to `scsi_get_sense_key'
umass.c:(.text+0xde6): undefined reference to `xpt_freeze_devq'
umass.c:(.text+0xe0f): undefined reference to `xpt_freeze_devq'
umass.c:(.text+0xe61): undefined reference to `xpt_freeze_devq'
umass.o: In function `umass_attach':
umass.c:(.text+0x1814): undefined reference to `cam_simq_alloc'
umass.c:(.text+0x1863): undefined reference to `cam_sim_alloc'
umass.c:(.text+0x18b1): undefined reference to `xpt_bus_register'
umass.c:(.text+0x1b0b): undefined reference to `cam_simq_free'
umass.o: In function `umass_cam_action':
umass.c:(.text+0x1c5e): undefined reference to `cam_calc_geometry'
umass.c:(.text+0x1f92): undefined reference to `scsi_set_sense_data'
umass.c:(.text+0x1fb3): undefined reference to `xpt_freeze_devq'
umass.o: In function `umass_cam_quirk_cb':
umass.c:(.text+0xb4b): undefined reference to `xpt_done'
umass.o: In function `umass_cam_cb':
umass.c:(.text+0xc79): undefined reference to `xpt_done'
umass.o: In function `umass_cam_sense_cb':
umass.c:(.text+0xe2a): undefined reference to `xpt_done'
umass.o: In function `umass_cam_action':
umass.c:(.text+0x1bd7): undefined reference to `xpt_done'
*** [kernel] Error code 1

Stop in /usr/obj/usr/src/sys/MYPAEKERNAL.
*** [buildkernel] Error code 1

Stop in /usr/src.
*** [buildkernel] Error code 1

Stop in /usr/src.
```


----------



## darqen27 (Dec 24, 2013)

And so the fun continues.

The first kernel didn't boot, so I made some changes and now I have compile errors for something I don't what it could be.




```
cc1: warnings being treated as errors
/usr/src/sys/modules/ctl/../../cam/ctl/ctl_frontend_cam_sim.c: In function 'cfcs_datamove':
/usr/src/sys/modules/ctl/../../cam/ctl/ctl_frontend_cam_sim.c:429: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
/usr/src/sys/modules/ctl/../../cam/ctl/ctl_frontend_cam_sim.c:458: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
*** [ctl_frontend_cam_sim.o] Error code 1

Stop in /usr/src/sys/modules/ctl.
*** [all] Error code 1

Stop in /usr/src/sys/modules.
*** [modules-all] Error code 1

Stop in /usr/obj/usr/src/sys/MYPAEKERNAL.
*** [buildkernel] Error code 1

Stop in /usr/src.
*** [buildkernel] Error code 1

Stop in /usr/src.
```


----------



## darqen27 (Dec 24, 2013)

*Re: errors comiling kernel*

The kernels I keep compiling keep crashing at the point where it's trying to mount the hard drives, can anyone tell me why this is happening?

it tries to mount /dev/ada0p2 (my main partition) and it fails with error 19.


----------



## kpa (Dec 24, 2013)

Post your kernel configuration file, use http://www.pastebin.com if it's too large to post here.


----------



## darqen27 (Dec 24, 2013)

Well I figured it out. It was because linprocfs was in fstab and the new kernel doesn't have the module to load, does anyone know how I can get this module? I need it for my webserver apparently.


----------



## kpa (Dec 24, 2013)

It's implemented by the linux(4) module, load it manually with `kldload linux` and put this in /boot/loader.conf to load it automatically on boot:


```
linux_load="YES"
```

It's still quite odd that the kernel panics if the module is not loaded.


----------

