Re: [uClinux-dev] Building m68k-elf

From: Greg Ungerer (gerg@moreton.com.au)
Date: Sat Jan 20 2001 - 04:12:55 EST


Hi Andrew,

Andrew Kohlsmith wrote:
> I'm so close now I can taste it...  I'm using Greg's crt0.S supplied from
> this list and I don't see a __main there.  However in a few other crt0.S
> files I've perused I see __main pointing to an rts just after __exit cleans
> up...  However they're encased in "#ifdef NO_LIBGCC".

Ideally, you should only need to use the crt0.S from uC-libc for
your particular architecture. But there are many varients around,
so I included the one I specifically used.


[snip]
> A "# m68k-elf-as ..." later the thing compiles!
> 
> root@wanderer:/opt/uClinux# m68k-elf-gcc -lc -o test test.c
> root@wanderer:/opt/uClinux# ls -l test
> -rwxr-xr-x   1 root     root        19232 Jan 19 21:02 test*
> root@wanderer:/opt/uClinux# file test
> test: ELF 32-bit MSB executable, Motorola 68000, version 1, statically
> linked, not stripped
> root@wanderer:/opt/uClinux# m68k-elf-strip test
> root@wanderer:/opt/uClinux# ls -l test
> -rwxr-xr-x   1 root     root        17984 Jan 19 21:02 test*
> 
> So now that's an 18k dummy program.  I know I can flatten that pretty small
> but I'm wondering if the uClinux gurus can tell me if I've done anything
> terribly wrong here...  Examining the compiler output, I browse what seems
> to be the assembly to the program (I'm a little rusty on my 68k assembler
> but it looks right) and I feel a little giddy, I have to admit.  :-)
> 
> Did I finally do it?

That should be it. Off-course a real test would be to convert
it to FLAT format (elf2flat) and run it on uClinux :-)

Regards
Greg


------------------------------------------------------------------------
Greg Ungerer  --  Chief Software Wizard          EMAIL:   gerg@lineo.com
Lineo (Integrated Products Group)                PHONE:  +61 7 3279 1822
825 Stanley St,                                    FAX:  +61 7 3279 1820
Woolloogabba, QLD, 4102, Australia                 WEB:    www.lineo.com
This message resent by the uclinux-dev@uclinux.org list server http://www.uClinux.org/


This archive was generated by hypermail 2.1.4 : Thu Sep 19 2002 - 13:19:27 EDT