Documentation for kernel requirements doesn't mention CONFIG_UNUSED_SYMBOLS

Mike Kazantsev mk.fraggod at
Thu Nov 9 17:48:29 CET 2017


Have tried to build wireguard module (using dkms) on mainline 4.9.58
from, and had following warnings on MODPOST:

  MODPOST 1 modules
  WARNING: "inet_confirm_addr" [/var/lib/dkms/wireguard/0.0.20171101/build/wireguard.ko] undefined!
  WARNING: "skb_checksum_setup" [/var/lib/dkms/wireguard/0.0.20171101/build/wireguard.ko] undefined!
  WARNING: "add_random_ready_callback" [/var/lib/dkms/wireguard/0.0.20171101/build/wireguard.ko] undefined!
  WARNING: "del_random_ready_callback" [/var/lib/dkms/wireguard/0.0.20171101/build/wireguard.ko] undefined!

These symbols did exist in /proc/kallsyms:

  ffffffff9385a100 T add_random_ready_callback
  ffffffff9385a1b0 T del_random_ready_callback
  ffffffff93991c20 T skb_checksum_setup
  ffffffff93a22ab0 T inet_confirm_addr

But not in Module.symvers file, hence the warnings.

Loading module also failed with following dmesg output:

  [20139.879546] wireguard: Unknown symbol del_random_ready_callback (err 0)
  [20139.879568] wireguard: Unknown symbol add_random_ready_callback (err 0)
  [20139.879611] wireguard: Unknown symbol skb_checksum_setup (err 0)
  [20139.879627] wireguard: Unknown symbol inet_confirm_addr (err 0)

All symbols in question have e.g. "EXPORT_SYMBOL(inet_confirm_addr);"
in the kernel code.

Reason seem to be missing CONFIG_UNUSED_SYMBOLS=y kernel option, which
wireguard effectively requires to be enabled, but which is missing from
"Kernel Requirements" section of the documentation (as of today, at least):

While docs might not mention some other common sense options which are
enabled in most kernels, I wanted to suggest considering including this
one, in case it wasn't considered already.

As description above suggests, it might be not obvious why these
particular symbols get stripped during build, unlike with other options
that are already documented, where one can easily trace missing symbol
to a disabled module.

It'd have saved me a bunch of time spent looking into the issue.


Mike Kazantsev //

More information about the WireGuard mailing list