[uClinux-dev] Re: uclinux-elf-tools-20030314 released
davidm at snapgear.com
Tue Mar 25 07:19:26 EST 2003
Jivin Philippe De Muyter lays it down ...
> > > - I wonder why, if I compile a standalone client program with :
> > >
> > > make "CC=m68k-elf-gcc -v -m5307 -msep-data -Wl,-elf2flt" hello
> > >
> > > it finds crt0.o, but fails with :
> > >
> > > hello.elf2flt: In function `_start':
> > > hello.elf2flt(.text+0x8): undefined reference to `__uClibc_main'
> > The m68k-elf tools have always needed a '-lc'. I haven't added it into
> > the specs file as a lot of people use these tools for embedded (non
> > linux) development and libc may not be appropriate. I know you may use
> > -nostdlib and -nostartfiles, but since it has been this way for so long
> > I haven't wanted to change it.
> I'd still suggest you change that. Here I have internal customers (workmates)
> that just need a compiler able to compile simple programs and have them
> run on a uclinux board. With -lc in the specs file, they do not need a
> Makefile for that. Just `make hello' with the appropriate setting of 'CC'
> and they get a working executable. Without -lc in the specs file, they
> need special explanations and a Makefile.
How does that work ? On my system is I type "make hello" it uses "cc",
not m68k-elf-gcc or any other compiler for that matter.
if you are running:
make "CC=m68k-elf-gcc -v -m5307 -msep-data -Wl,-elf2flt" hello
how much harder is it to run:
make "CC=m68k-elf-gcc -v -m5307 -msep-data -Wl,-elf2flt" LDLIBS=-lc hello
you already had to have significant knowledge to get the CC command
correct. I don't think this is a very strong argument.
> For people using a specific compiler to target another target or a naked
> board, they've already solved the link problem, most often by invoking ld
> directly (just as we do when we compile linux), so they would'nt even notice
> the change.
> At the moment the situation is just bad : we get the include files and
> the crt0.o file from uclinux/uClibc, but not the library.
Fair comment and this is a good reason for the change. Not much point
including one part of the libc and not the other. Next time I'm working
on it I'll look at including -lc in the specs file.
The truth is that the crt0.o is compatible with both uC-libc and uClibc.
> I'd prefer we really had a uclinux/uClibc targetted compiler.
You do as far as I can see, it just needs the -lc option, which you
have already shown you know how to add :-)
David McCullough: Ph: +61 7 3435 2815 http://www.SnapGear.com
davidm at snapgear.com Fx: +61 7 3891 3630 Custom Embedded Solutions + Security
More information about the uClinux-dev