This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DM365 RDK - Undefined References

Other Parts Discussed in Thread: TVP7002

I am new on Linux and recently ran into the following when trying to do kernel build on DM365 RDK:

root@welson-desktop:~/DM368DVR_RDK/DM368_RDK/dvr/lsp/ti-davinci# make
  CHK     include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
  CHK     include/linux/utsrelease.h
  CHK     include/linux/compile.h
  GEN     .version
  CHK     include/linux/compile.h
  LD      .tmp_vmlinux1
drivers/built-in.o: In function `mt9t001_initialize':
davinci-mmc.c:(.text+0x5a4cc): undefined reference to `mt9xxx_set_input_mux'
drivers/built-in.o: In function `mt9p031_initialize':
davinci-mmc.c:(.text+0x5bf18): undefined reference to `mt9xxx_set_input_mux'
drivers/built-in.o: In function `tvp514x_setcontrol':
davinci-mmc.c:(.text+0x5cc6c): undefined reference to `tvp514x_set_input_mux'
drivers/built-in.o: In function `tvp514x_querystd':
davinci-mmc.c:(.text+0x5ceb4): undefined reference to `tvp514x_set_input_mux'
drivers/built-in.o: In function `tvp514x_setstd':
davinci-mmc.c:(.text+0x5d16c): undefined reference to `tvp514x_set_input_mux'
drivers/built-in.o: In function `tvp514x_getcontrol':
davinci-mmc.c:(.text+0x5d588): undefined reference to `tvp514x_set_input_mux'
drivers/built-in.o: In function `tvp514x_getinput':
davinci-mmc.c:(.text+0x5da68): undefined reference to `tvp514x_set_input_mux'
drivers/built-in.o:davinci-mmc.c:(.text+0x5dbfc): more undefined references to `tvp514x_set_input_mux' follow
drivers/built-in.o: In function `tvp514x_i2c_init':
davinci-mmc.c:(.text+0x5e4b4): undefined reference to `tvp514x_get_evm_chan_config'
davinci-mmc.c:(.text+0x5e4c0): undefined reference to `tvp514x_get_evm_chan_config'
drivers/built-in.o: In function `tvp7002_set_format_params':
davinci-mmc.c:(.text+0x648d0): undefined reference to `tvp7002_set_input_mux'
drivers/built-in.o: In function `tvp7002_setstd':
davinci-mmc.c:(.text+0x64af0): undefined reference to `tvp7002_set_input_mux'
drivers/built-in.o: In function `tvp7002_setparams':
davinci-mmc.c:(.text+0x64cd4): undefined reference to `tvp7002_set_input_mux'
drivers/built-in.o: In function `tvp7002_querystd':
davinci-mmc.c:(.text+0x651fc): undefined reference to `tvp7002_set_input_mux'
drivers/built-in.o: In function `tvp7002_initialize':
davinci-mmc.c:(.text+0x65670): undefined reference to `tvp7002_set_input_mux'
make: *** [.tmp_vmlinux1] Error 1

I have noticed that those undefined references are all functions defined in several C files and they are all declared "EXPORT_SYMBOL" (defined in linux/module.h).  I suppose the linker cannot find them and this could be due to:

1. Include path not correctly set

2. EXPORT_SYMBOL is not "exporting" correctly

I have spent 2 days trying to resolve it but no luck so far.

 

Any help would be greatly appreciated.

 

  • Here is what's defined about EXPORT_SYMBOL:

    /* For every exported symbol, place a struct in the __ksymtab section */
    #define __EXPORT_SYMBOL(sym, sec)                \
        extern typeof(sym) sym;                    \
        __CRC_SYMBOL(sym, sec)                    \
        static const char __kstrtab_##sym[]            \
        __attribute__((section("__ksymtab_strings")))        \
        = MODULE_SYMBOL_PREFIX #sym;                        \
        static const struct kernel_symbol __ksymtab_##sym    \
        __attribute_used__                    \
        __attribute__((section("__ksymtab" sec), unused))    \
        = { (unsigned long)&sym, __kstrtab_##sym }

    #define EXPORT_SYMBOL(sym)                    \
        __EXPORT_SYMBOL(sym, "")