This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: User libraries


> From: Steven Clugston
> >-----Original Message-----
> >From: Davies, Greg [mailto:Greg.Davies@Ultra-UEMS.com]
> >Don't worry about the linker script. You have to use it, but 
> linking in 
> >regular static libraries is just a matter of using -l (and 
> maybe -L), 
> >or at least that's been my experience. I don't have a 
> 
> As it happens, the libraries I want to use I've got already 
> as eclipse managed projects so it would be convienient if I 
> could just create another build profile for them for eCos as 
> well as the standard Linux Release/Debug ones.

Are you using eclipse 3.2? I'm using 3.3 where there's no
managed/unmanaged makefile projects. Regardless, Here's my setup from
the bottom up: I have a driver project that builds a static lib for my
target. Its compiled like any normal aplication, but uses the arm-elf
tools. I have to target my architecture with gcc at this point
(-mcpu=arm7tdmi), and for some reason I use -rcs as archiver flags.
You'll have to look these up, because I don't remember what they do.
All my middle stuff has at least two build configurations, one for
building for the target board, using the same tools and flags as the
drivers, and another configuration to build for linux for simulation and
testing. Test projects themselves reference the linux build, and only
build for linux. I had problems referencing projects using cygwin and
eclipse because of the ":" after drive letters in the windows PATH
varriable.
I have eCos as a project using an external builder command, which just
runs the makefile that is output by the graphical configuration tool.
This allows me to reference the include and lib directories relative to
my workspace. Any project that links eCos also references the eCos
project, so it builds automatically when I need it. 
For my main application project, I set project references for everything
I want to bring in, add directories -I and -L, and libraries -l for
everything I need, including the eCos libraries. In the Misc section of
the linker setting I added to following:  -Wl,--cref
-Wl,-Map,ProjectName.map -lc -lgcc -T target.ld -n
The linker script target.ld is the one that eCos created for me on this
build, and it's in the same directory as target.a, otherwise I'd have to
add another directory -L so it could be found. As for the rest of the
options, I don't remember what they do. As you already know, but just
for completeness, I check the no startup files and no standard libs
boxes. 

I hope this helps. Let me know if I'm missing any details.

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]