Vincent,

I did what you suggested but it doesn't place the libraries in the right gcc 
parameters
order: if you look below, when it calls gcc to do the linking, the libraries 
"./mylib.a -lm -lc -lrt -ldl" are place right after gcc (near the front); it 
should be
at the end (near "-lpthread).  Why isn't around the lopts placed near the end?

# lnk470MV app.x470MV ...
/opt/dvevm_1_10/xdctools_1_21/packages/xdc/bld/link 
/opt/mv_pro_4.0/montavista/pro/dev
kit/arm/v5t_le/armv5tl-montavista-linuxeabi/bin/gcc    ./mylib.a -lm -lc
 -lrt -ldl  -o app.x470MV package/cfg/loopback/audioManager.o470MV 
package/cfg/lo
opback/loopback.o470MV package/cfg/loopback/main_native.o470MV 
package/cfg/loopback_x4
70MV.o470MV  package/cfg/loopback_x470MV.xdl 
-B/opt/mv_pro_4.0/montavista/pro/devkit/a
rm/v5t_le/armv5tl-montavista-linuxeabi/../lib/gcc/armv5tl-montavista-linuxeabi/3.4.3/
-lpthread  
-L/opt/mv_pro_4.0/montavista/pro/devkit/arm/v5t_le/armv5tl-montavista-linux
eabi/lib


I added              
    lopts: " ../mylib.a -lm -lc -lrt -ldl ", 
to Pkg.addExecutable in package bld.

Thanks.

Regards,
Andy




----- Original Message ----
From: "Wan, Vincent" <[EMAIL PROTECTED]>
To: Andy Ngo <[EMAIL PROTECTED]>
Cc: davinci-linux-open-source <[email protected]>
Sent: Friday, January 26, 2007 5:21:05 PM
Subject: RE: Linking/mapping data to IRAM or L1SDRAM on the DSP


Hi Andy,
 
You can try this:
 
In package.bld, set the lopts (linker options) in the addExecutable call:       
  
     
 
    ….
          
    if (targ.os == "Linux") {
        libraries = "-lm";
    }
    else {
        libraries = "";
    }
                                                                 
    Pkg.addExecutable(name, targ, plat, {
        cfgScript: cfg,
        lopts: libraries,  
 
    ….
 
Fyi, there is also something called copts that allows you to set compiler flags.
 
Alternatively, if you are more comfortable with makefiles, you can take a look 
at the video_copy/dualcpu example to see how you can directly specify –lm, etc. 
next to the rule for app.out, where –lphread is specified.
 
Best regards,
Vincent
 



From: Andy Ngo [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 25, 2007 2:16 PM
To: Wan, Vincent
Cc: davinci-linux-open-source
Subject: Re: Linking/mapping data to IRAM or L1SDRAM on the DSP
 
Hi Vincent,
 
Thanks for you help.  I have another question that maybe you can help.  I want 
to add
a library (i.e. mylib.a) to the ARM application but I couldn't figure it out.  
I know I need
to modify the package.bld file.  For example, in the 
dvevm_1_10/codec_engine_1_02/examples/apps/speech_copy folder, I see all the
source files are added in package.bld via Pkg.addobjects).  How do I add my 
library 
and other system libraries (like -lm -lc -ldl -rt).  Otherwise, I have to 
manually modify
the package.mak that automatically gets generated (my changes get wiped out if I
modify package.bld again).
 
Thanks!
 
Regards,
Andy
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to