Skip to contentSkip to conversation

Compiling error

DISCUSSION tony 2 participants 3 messages Sep 2, 2014 – Sep 3, 2014 1 message not in the archive

lore
Share & tools
lore

tony

author
#1 lore raw
In reply to a message not in the archive

Hi,

	I am trying to build "backports-3.12.8-1" for my kernel 3.1.10. I am 

following the instructions in the backports wiki to cross compile for arm. But the compilation fails complaining "‘THIS_MODULE’ undeclared". As suggested by one of the earlier posts in the forum, I tried including #include <linux/module.h>
before
#include <linux/skbuff.h>
But it did not make any difference.Attached is a error log.

Thank you in advance for any help.

Tony

******************* Environment & Tools log ********************************

echo $CROSS_COMPILE
arm-linux-gnueabihf-
echo $ARCH
arm
echo $KLIB_BUILD /media/work/git/bsp/Linux_for_Tegra/kernel/linux-tegra echo $KLIB /media/work/git/bsp/Linux_for_Tegra/rootfs arm-linux-gnueabihf-gcc --version arm-linux-gnueabihf-gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

*************************** Build Log ****************************************

make defconfig-media
make[2]: `conf' is up to date.
#

# configuration written to .config
#
tony@tony-N56VJ:~/Desktop/backports-3.12.8-1$ make
make[5]: `conf' is up to date.
#
# configuration written to .config
#
Building backport-include/backport/autoconf.h ... done.
  CC [M]  /home/tony/Desktop/backports-3.12.8-1/compat/main.o
/home/tony/Desktop/backports-3.12.8-1/compat/main.c:52:1: warning: data definition has no type or storage class [enabled by default]
/home/tony/Desktop/backports-3.12.8-1/compat/main.c:52:1: warning: type defaults to ‘int’ in declaration of ‘EXPORT_SYMBOL_GPL’ [-Wimplicit-int]
/home/tony/Desktop/backports-3.12.8-1/compat/main.c:52:1: warning: parameter names (without types) in function declaration [enabled by default]
  CC [M]  /home/tony/Desktop/backports-3.12.8-1/compat/compat-3.3.o
In file included from /home/tony/Desktop/backports-3.12.8-1/backport-include/linux/device.h:4:0,
                 from include/linux/dmaengine.h:24,
                 from include/linux/skbuff.h:30,
                 from /home/tony/Desktop/backports-3.12.8-1/backport-include/linux/skbuff.h:3,
                 from /home/tony/Desktop/backports-3.12.8-1/compat/compat-3.3.c:13:
include/linux/device.h: In function ‘root_device_register’:
include/linux/device.h:724:38: error: ‘THIS_MODULE’ undeclared (first use in this function)
include/linux/device.h:724:38: note: each undeclared identifier is reported only once for each function it appears in
/home/tony/Desktop/backports-3.12.8-1/compat/compat-3.3.c: At top level:
/home/tony/Desktop/backports-3.12.8-1/compat/compat-3.3.c:174:1: warning: data definition has no type or storage class [enabled by default]
/home/tony/Desktop/backports-3.12.8-1/compat/compat-3.3.c:174:1: warning: type defaults to ‘int’ in declaration of ‘EXPORT_SYMBOL_GPL’ [-Wimplicit-int]
/home/tony/Desktop/backports-3.12.8-1/compat/compat-3.3.c:174:1: warning: parameter names (without types) in function declaration [enabled by default]
/home/tony/Desktop/backports-3.12.8-1/compat/compat-3.3.c:222:1: warning: data definition has no type or storage class [enabled by default]
/home/tony/Desktop/backports-3.12.8-1/compat/compat-3.3.c:222:1: warning: type defaults to ‘int’ in declaration of ‘EXPORT_SYMBOL_GPL’ [-Wimplicit-int]
/home/tony/Desktop/backports-3.12.8-1/compat/compat-3.3.c:222:1: warning: parameter names (without types) in function declaration [enabled by default]
/home/tony/Desktop/backports-3.12.8-1/compat/compat-3.3.c:242:1: warning: data definition has no type or storage class [enabled by default]
/home/tony/Desktop/backports-3.12.8-1/compat/compat-3.3.c:242:1: warning: type defaults to ‘int’ in declaration of ‘EXPORT_SYMBOL_GPL’ [-Wimplicit-int]
/home/tony/Desktop/backports-3.12.8-1/compat/compat-3.3.c:242:1: warning: parameter names (without types) in function declaration [enabled by default]
make[6]: *** [/home/tony/Desktop/backports-3.12.8-1/compat/compat-3.3.o] Error 1
make[5]: *** [/home/tony/Desktop/backports-3.12.8-1/compat] Error 2
make[4]: *** [_module_/home/tony/Desktop/backports-3.12.8-1] Error 2
make[3]: *** [modules] Error 2
make[2]: *** [modules] Error 2
make[1]: *** [modules] Error 2
make: *** [default] Error 2
#2 lore raw
Quoted 11 lines · tony

Hi,

    I am trying to build "backports-3.12.8-1" for my kernel 3.1.10. I am

following the instructions in the backports wiki to cross compile for arm. But the compilation fails complaining "‘THIS_MODULE’ undeclared". As suggested by one of the earlier posts in the forum, I tried including #include <linux/module.h>
before
#include <linux/skbuff.h>
But it did not make any difference.Attached is a error log.

Thank you in advance for any help.

This looks strange. You have to compile your kernel with CONFIG_MODULES activated, backports needs that.

compat/main.c includes linux/module.h and that file contains EXPORT_SYMBOL_GPL(), but that is not found in your build.

Why are you using version 3.12, the current stable version is 3.16?

Hauke

author
#3 lore raw

Thank you Hauke. I do have CONFIG_MODULES in my .config

CONFIG_MODULES=y
# CONFIG_MODULE_FORCE_LOAD is not set
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y

I am trying to get TI wireless driver working. According to their software release note, the latest supported version is 3.12.

Quoted 23 lines · Hauke Mehrtens
Quoted 11 lines · tony

Hi,

     I am trying to build "backports-3.12.8-1" for my kernel 3.1.10. I am

following the instructions in the backports wiki to cross compile for arm. But the compilation fails complaining "‘THIS_MODULE’ undeclared". As suggested by one of the earlier posts in the forum, I tried including #include <linux/module.h>
before
#include <linux/skbuff.h>
But it did not make any difference.Attached is a error log.

Thank you in advance for any help.

This looks strange. You have to compile your kernel with CONFIG_MODULES activated, backports needs that.

compat/main.c includes linux/module.h and that file contains EXPORT_SYMBOL_GPL(), but that is not found in your build.

Why are you using version 3.12, the current stable version is 3.16?

Hauke