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.

Linking dsplib: undefined symbol DSPF_sp_fftSPxSP

Hello,

While trying to use dsplib (from http://software-dl.ti.com/dsps/dsps_public_sw/c6000/web/c674_dsplib/latest/index_FDS.html / c674x-dsplib_1_03_00_01_Linux-x86_Setup.bin), I always get a linker error:

#
# lnke674 platforms_ti816x_dsp/debug/App.xe674 ...
rm -f package/cfg//platforms_ti816x_dsp/debug/App.xe674.map
/opt/ti/C6000CGT7.3.0/bin/lnk6x -w -q -u _c_int00 -fs package/cfg/platforms_ti816x_dsp/debug/ -l /opt/ti/c674x-dsplib/lib/dsplib674x_elf.lib -q -o platforms_ti816x_dsp/debug/App.xe674 package/cfg/platforms_ti816x_dsp/debug/App_pe674.oe674  package/cfg/platforms_ti816x_dsp/debug/App/App.oe674  package/cfg/platforms_ti816x_dsp/debug/App_pe674.xdl --abi=eabi -c -m package/cfg//platforms_ti816x_dsp/debug/App.xe674.map -l /opt/ti/C6000CGT7.3.0/lib/rts6740_elf.lib

 undefined        first referenced                                   
  symbol              in file                                        
 ---------        ----------------                                   
 DSPF_sp_fftSPxSP package/cfg/platforms_ti816x_dsp/debug/App/App.oe674


error: unresolved symbols remain
error: errors encountered during linking;
   "platforms_ti816x_dsp/debug/App.xe674" not built
gmake: *** [platforms_ti816x_dsp/debug/App.xe674] Error 1

I have no idea what's wrong. The symbol is defined in the lib:

gru@pc-cm-gru-virtlinux1 % nm6x /opt/ti/c674x-dsplib/lib/dsplib674x_elf.lib| grep DSPF_sp_fftSPxSP
00000000 t .text:DSPF_sp_fftSPxSP
00000000 T DSPF_sp_fftSPxSP
00000000 a DSPF_sp_fftSPxSP.asm
00000000 D __TI_DW.debug_info.DSPF_sp_fftSPxSP.asm.ac3e14752c3c078efc7e92029fa659cd
00000000 D __TI_DW.debug_info.DSPF_sp_fftSPxSP.asm.bbbcff6360f32c3bc3e18a7b8f78fb0b

 

I attached my (hopefully minimal) test project. Compiler output is contained in mini/compile.log. Can you please tell me what I'm making wrong?

1803.mini.zip

  • The file that references the symbol shows up on the command line after the library. Try adding '-x -l ...' to lopts in package.bld. That forces rereading of the linked libraries. If you prefer not to use '-x', there could be other ways to force the library to show up later on the command line.

  • Hello,

    I'm trying to build a codec server, and I have almost the same problem. This is my linker command line call when I add "-l link.cmd"  to lopts in package.bld file:

    # lnke674 bin/ti_platforms_evmTI816X/hdaac_DSP.xe674 ...
    rm -f package/cfg//bin/ti_platforms_evmTI816X/hdaac_DSP.xe674.map
    /home/user/ti-ezsdk_dm816x-evm_5_03_01_15/dsp-devkit/cgt6x_7_3_1/bin/lnk6x -w -q -u _c_int00 -fs
    package/cfg/bin/ti_platforms_evmTI816X/ -l link.cmd -q -o bin/ti_platforms_evmTI816X/hdaac_DSP.xe674
    package/cfg/bin/ti_platforms_evmTI816X/hdaac_DSP_pe674.oe674
    package/cfg/bin/ti_platforms_evmTI816X/hdaac_DSP/main.oe674
    package/cfg/bin/ti_platforms_evmTI816X/hdaac_DSP_pe674.xdl --abi=eabi -c -m
    package/cfg//bin/ti_platforms_evmTI816X/hdaac_DSP.xe674.map
    -l /home/user/ti-ezsdk_dm816x-evm_5_03_01_15/dsp-devkit/cgt6x_7_3_1/lib/rts6740_elf.lib --compress_dwarf
    warning: creating output section ".plt" without a SECTIONS specification

    undefined first referenced
    symbol in file
    --------- ----------------
        .  .  .

    It fails because the linker obviously expects link.cmd file with library paths after object files which should use definitions from these libraries.

    If I edit generated package.mak file and place -l link.cmd in the previous command line after "package/cfg/bin/ti_platforms_evmTI816X/hdaac_DSP_pe674.xdl":

    # lnke674 bin/ti_platforms_evmTI816X/hdaac_DSP.xe674 ...
    rm -f package/cfg//bin/ti_platforms_evmTI816X/hdaac_DSP.xe674.map
    /home/user/ti-ezsdk_dm816x-evm_5_03_01_15/dsp-devkit/cgt6x_7_3_1/bin/lnk6x -w -q -u _c_int00 -fs
    package/cfg/bin/ti_platforms_evmTI816X/ -l link.cmd -q -o bin/ti_platforms_evmTI816X/hdaac_DSP.xe674
    package/cfg/bin/ti_platforms_evmTI816X/hdaac_DSP_pe674.oe674
    package/cfg/bin/ti_platforms_evmTI816X/hdaac_DSP/main.oe674
    package/cfg/bin/ti_platforms_evmTI816X/hdaac_DSP_pe674.xdl -l link.cmd --abi=eabi -c -m
    package/cfg//bin/ti_platforms_evmTI816X/hdaac_DSP.xe674.map
    -l /home/user/ti-ezsdk_dm816x-evm_5_03_01_15/dsp-devkit/cgt6x_7_3_1/lib/rts6740_elf.lib --compress_dwarf
    warning: creating output section ".fastCode" without a SECTIONS specification
    warning: creating output section ".plt" without a SECTIONS specification
    warning: entry-point symbol other than "_c_int00" specified:
    "ti_sysbios_family_c64p_Hwi0"
    .executables files complete: Sat Mar 31 05:33:29 PDT 2012.
    ======== all [.] ========
    #
    # all files complete.

    linking successfully completes.

    Several functions from rts6740_elf.lib are already defined in libs from link.cmd, so adding '-x -l ...' to lopts would cause redefinitions, thus this is not an option.

    Can you tell me any other way to force the library to show up later on the command line?

  • You can create a file package.xs in your codec server package, and in that file add the function getSects(). That function should return a path to an XDC template file whose content will be added to the generated linker command file (the file with the extension .xdl). XDC template files allow you to generate pieces of the linker command file on the fly, depending on the content of your configuration script.

    But in your case, you just need to add whatever is in your link.cmd to the generated XDL file. So, getSects() should just return the path to your link.cmd. The path has to include the full package name, as specified in package.xdc. For example, if the package name is mycodec.server, then the content of getSects() should be:

    function getSects() {
        return ("mycodec/server/link.cmd");
    }

    Then, the content of your link.cmd file will be added to the end of the xdl file, which means it will be read after all other object files are already processed.

    If this doesn't work for you, please let me know.

  • I've created package.xs with getSects() function inside, and succeeded in building codec server. Now the library paths from my link.cmd are placed in generated .xdl file, and  linker can find all definitions needed.

    Thanks!