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.

xdc linking order

How can I have control over linking order when I use xdc.tools.configuro and a cfg.file to build my application ?

My issue is simple: I have a library that calls CE functions such as VIDENC1_create(), VIDENC1_delete(), VIDENC1_control(), VIDENC1_process(). However the linker always tries to link my library after videnc1.av5T, which results in undefined reference error.

For instance the linker command file generated by configuro looks like this:

/* input libraries */

INPUT(

    "/myPath/myApp_x470MV.o470MV"

    "/dvsdk_2_10_01_18/codec_engine_2_24/packages/ti/sdo/ce/video1/lib/release/viddec1.av5T"

    "/dvsdk_2_10_01_18/codec_engine_2_24/packages/ti/sdo/ce/video1/lib/release/videnc1.av5T"

    "/dvsdk_2_10_01_18/codec_engine_2_24/packages/ti/sdo/ce/video2/lib/release/viddec2.av5T"

    "/dvsdk_2_10_01_18/codec_engine_2_24/packages/ti/sdo/ce/lib/release/ce.av5T"

    "/dvsdk_2_10_01_18/codec_engine_2_24/packages/ti/sdo/ce/ipc/linux/lib/release/ipc_linux.av5T"

    "/dvsdk_2_10_01_18/codec_engine_2_24/packages/ti/sdo/ce/alg/lib/release/Algorithm_noOS.av5T"

    "/dvsdk_2_10_01_18/codec_engine_2_24/packages/ti/sdo/ce/alg/lib/release/alg.av5T"

    "/dvsdk_2_10_01_18/codec_engine_2_24/packages/ti/sdo/ce/osal/linux/lib/release/osal_linux_470.av5T"

    "/myPath/myLibrary.a"


etc.

I would like to force "/myPath/myLibrary.a" to be right before  '"/dvsdk_2_10_01_18/codec_engine_2_24/packages/ti/sdo/ce/video1/lib/release/videnc1.av5T"

Currently I workaround the issue by editing linker.cmd after the error is thrown and I do again a 'make' but I would like a smoother build process. 

 

Thanks for your help.

  • Victor,
    linking order is determined by dependency relations that RTSC packages form when they load each other. For example, if pkgA calls xdc.useModule or xdc.module on any module in pkgB, or pkgA calls loadPackage on pkgB, pkgA's libraries will be linked before pkgB's libraries.

    If your library is in a RTSC package, somewhere in the configuration code for that package you should reference the package ti.sdo.ce.videnc1. If that's already a case, and you are still getting the order above, there might be a bug somewhere in XDCtools. If your library is not in a RTSC package, I would have to see how you are adding it to the library list to find out how to change the order.

  • Hi Sasha,

    Adding ti.sdo.ce.videnc1 to the package.xs file solved the issue ! Thanks a lot.