[uClinux-dev] Re: uclinux-elf-tools-20030314 released

Philippe De Muyter phdm at macqel.be
Tue Mar 25 06:24:03 EST 2003


David McCullough wrote :
> 
> Jivin Philippe De Muyter lays it down ...
> > - I have a patch available that fix a long-standing problem with -mcpu32
> > programs compilation :
> > 	relocation truncated to fit: R_68K_PLT16
> > See attachment.
> 
> 
> Great,  is this to make msep-data/shared-library options work ?

I don't know, never used that until now (and I don't even know for the moment
how to use it)

> I knew of problems in this area for cpu32.
> 
> 
> > - 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.

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.

I'd prefer we really had a uclinux/uClibc targetted compiler.

> 
> 
> > In my opinion, if crt0.o is automatically included, and crt0.o requests
> > libc.a, then libc.a must also be included.  As we build here a uClibc-
> > targetted compiler, I suggest that the build process adds -lc in the
> > specs file.  I have added '-lc' in the 'lib' field of the specs
> > file.  With that, I get a clean standalone compilation, and no problem for
> > the link of linux itself, because linux is not linked by gcc itself, but
> > directly by ld.
> 
> Thanks for the feedback,  I will include you patch in the next tools
> release,

Thanks
Philippe

Philippe De Muyter  phdm at macqel.be  Tel +32 27029044
Macq Electronique SA  rue de l'Aeronef 2  B-1140 Bruxelles  Fax +32 27029077



More information about the uClinux-dev mailing list