Problem linking with static libraries for arm-elf
Roman
romank@randrlabs.com
Tue Apr 11 17:27:00 GMT 2006
Hi,
I could not have static link and pthread support together in arm elf project.
I could get either static builds but no pthread option or dynamic build and
pthread option.
I ended up putting
a) -pthread in my LFLAGS
b) /usr/lib/libsqlite3.a in my CFLAGS
Everything worked after that. I still do not know why I cannot have -pthread
and -static options used together.
Well that's my two bits,
Roman
On Tuesday 11 April 2006 09:21 am, Carl Miller wrote:
> > On 4/11/06, Apostol Terziev <stinky@inray.spnet.net> wrote:
> > > I'm sorry, I've cut and pasted the compiler output, not the linker
> > > one. Here is what the linker says:
> > >
> > > arm-elf-gcc C:\Progra~1\ARMor\eclipse\gcc\arm-elf\lib\libsys.a
> > > ./src/main.o -lsys -nostartfiles -nodefaultlibs -nostdlib -static
> > > -LC:\cygwin\home\Administrator\soft\arm-elf\lib
> > > -LC:\cygwin\home\Administrator\soft\arm-elf\lib -LC:\Program
> > > Files\ARMor\eclipse\gcc\lib\gcc\arm-elf\4.0.2 -Xlinker -Tlpc210x.ld
> > > -Xlinker -static -otest.elf
> > > lpc210x.ld:299: undefined symbol `endless_loop' referenced in
> > > expression collect2: ld returned 1 exit status
> > > make: *** [test.elf] Error 1
> > > make: Target `all' not remade because of errors.
>
> On Tue, Apr 11, 2006 at 08:28:26AM -0400, Jay Kulpinski wrote:
> > Is it ignoring crt0.o in your libsys.a because you have
> > "-nostartfiles" on the command line? What happens if you rename that
> > object to something other than a startup file name?
>
> I would first try just putting main.o before libsys.a on the command
> line -- my first suspicion is that it's looking at libsys.a first,
> saying, "I've got no unresolved symbols; don't need to pull in any
> objects from this library", then moving on to main.o, and never looking
> back at libsys.a.
>
> Remember that order is significant in libraries passed by name or with
> the -l switch, unless you bracket with --start-group / --end-group.
>
>
> ------Carl
>
> --
> For unsubscribe information see http://sourceware.org/lists.html#faq
--
For unsubscribe information see http://sourceware.org/lists.html#faq
More information about the crossgcc
mailing list