0
votes

I am compiling linux kernel version 3.17. by default a driver is statically compiled into the linux kernel and is probed at boot time. But I want this particular driver to be build as a module so I changed the CONFIG_driver from 'y' to 'm'. But after doing so the kernel outputs an undefined reference error and breaks the build.

following console log

|   LD      drivers/built-in.o
|   LINK    vmlinux
|   LD      vmlinux.o
|   MODPOST vmlinux.o
|   GEN     .version
|   CHK     include/generated/compile.h
|   UPD     include/generated/compile.h
|   CC      init/version.o
|   LD      init/built-in.o
| drivers/built-in.o: In function `adv7511_irq_handler':
| /var/adnan/work/git/mel_repos/mel_cedar_2/build/build_zedboard-zynq7-mel/tmp/work-shared/zedboard-zynq7-mel/kernel-source/drivers/gpu/drm/i2c/adv7511_core.c:314: undefined reference to `drm_helper_hpd_irq_event'
| make: *** [vmlinux] Error 1
| ERROR: oe_runmake failed

where as the function drm_helper_hpd_irq_event is present in drm_probe_helper.c. and according to the makefile

obj-$(CONFIG_DRM_KMS_HELPER) += drm_kms_helper.o

the module which I am building selects CONFIG_DRM_KMS_HELPER. In the .config this is directly proportional to my module when I build my module this also gets build in module and otherwise it build statically. But when it builds in module the file is not compiled.

Any Idea ? How can I force this into static build while doing my driver in module ?

1
Please, put here exact output of comiler.Oleg Gopkolov
Does said driver actually support being built as a module (as in, is its Kconfig entry "tristate", or just "bool")?Notlikethat
Provide the lines around the error one. It seems the module requires symbols which are not exported to the modules.0andriy
Is DRM_KMS_HELPER set to be built ?nos

1 Answers

-1
votes

As a workaround, you can replace

obj-$(CONFIG_DRM_KMS_HELPER) += drm_kms_helper.o

by

obj-y += drm_kms_helper.o