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.

How to include existing lib under auto-generated Codec package?

Other Parts Discussed in Thread: SYSBIOS

Hi,

I am working on a (C674 DSP [dm8168]) Codec Server for an image processing application.  Through package.xs file I'm including c64plus imglib as follows, 

/*
* ======== getLibs ========
*/

function getLibs(prog)
{
var lib = null;

if (prog.build.target.isa == "674") {

lib = "imglib/imglib2_elf.lib";

print(" will link with " + this.$name + ":" + lib);
}

return (lib);
}

The codec built without error, and server seems to do the work as well:

manageIpc = true
Heap: ti.sysbios.heaps.HeapMem

will link with devcodec.sobel:imglib/imglib2_elf.lib

rm -f package/cfg/bin/ti_platforms_evmTI816X/all_DSP_pe674.oe674
#
# cle674 package/cfg/bin/ti_platforms_evmTI816X/all_DSP_pe674.c ...

Now, to include imglib under getLibs(prog) I had to get rid of the (xdc configuro) autogenerated package.xs that has the following:

function getLibs(prog)
{
var name = "";
var suffix = "";

if ("findSuffix" in prog.build.target) {
suffix = prog.build.target.findSuffix(this);
if (suffix == null) {
/* no matching lib found in this package, return "" */
return ("");
}
} else {
suffix = prog.build.target.suffix;
}

/* And finally, the location of the libraries are in lib/<profile>/* */
name = "lib/" + this.profile + "/sobel.a" + suffix;

return (name);
}

The problem is that server build crashes due to unresolved symbols:

6740_elf.lib --compress_dwarf
warning: creating output section ".plt" without a SECTIONS specification

undefined first referenced
symbol in file
--------- ----------------
SOBEL_DEVCODEC_ISOBEL package/cfg/bin/ti_platforms_evmTI816X/all_DSP_pe674.oe674

error: unresolved symbols remain
warning: entry-point symbol other than "_c_int00" specified:
"ti_sysbios_family_c64p_Hwi0"

Seems that the original package.xs has the SOBEL_DEVCODEC_ISOBEL definition for the build, but I DONT know how to MERGE the package.xs lib definitions to do the both tasks: define the current SOBEL_DEVCODEC_ISOBEL interface for the codec and include the image library. Can someone help on this and check if i am getting the procedure right?, sorry for the long post. - Thanks

- Jose L.

  • I managed to link imglib2_elf.lib into the server package through the link.cmd file, also i have written the getSects() function on Codec's package.xs file so the Codec can call the libs functions. What other consideration must be taken to use the library from the Codec Package when this lib has been built on the Server package?, i would appreciate some hints on this topic. Thanks

    - Jose L.

  • Jose:

        See if the suggestion here helps:

         http://e2e.ti.com/support/embedded/linux/f/354/t/246419.aspx

        With this, other than including the header file for the library in your codec library, I don't think you would need to write a getSect() function.
    Regards,
    - Gil
  • Gil, 

    Thanks for your answer. I have tried different schemes for library linking, the one I think works better (in a cleaner way) for me is the simple wrapper lib package: http://rtsc.eclipse.org/docs-tip/Integrating_Existing_Content/Example_1. After that I just write the 'require mydev.mylib' under package.xdc and the build works fine for both the codec & server.

    Now I have other issue, the ARM app builds based on the remote server package (through createFromServer function), seems that ARM app build retrieves or needs information from the Server's imglib2_elf.lib (I do not understand why, from my point of view the linked lib is a resource needed ONLY by the Codec at runtime, ARM app should not be concerned about what happens in Codec's process() function), then the *.xv5T ARM executable build crashes saying that will skip the lib due to incompatibility. Details about this crash can be found on this post http://e2e.ti.com/support/embedded/linux/f/354/t/259424.aspx, can you clarify me on this?, I would like to know if I am missing something. Regards;

    - Jose L



  • Jose:

       Not sure why createFromServer is pulling that in via the config step for the ARM side build.   Somehow it is getting into the package/cfg/bin/ti_platforms_evmTI816X/app_remote_pv5T.xdl file (can you verifiy?).

       I wonder if a more direct way would be to just add the library into the server's link.cmd file? 

       From: examples/ti/sdo/ce/examples/servers/all_codecs:

      % more link.cmd
    /*
     * Any additions to the generated linker-command files should be placed here
     */

    Regards,
    - Gil