LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   cross compiler for m68k from linux x86 host (https://www.linuxquestions.org/questions/programming-9/cross-compiler-for-m68k-from-linux-x86-host-935176/)

rawrFox 03-18-2012 09:57 PM

cross compiler for m68k from linux x86 host
 
I'm attempting to build a cross compiler for target m68k-coff on an i386 host.

I've managed to setup binutils and gcc, but I've reached a stumbling point, which is made worse by the fact that everybody seems to have moved on from this architecture. :(

When I try to compile a simple hello world program (which includes stdio.h), m68k-coff-gcc spits out the error:

Code:

m68k-coff/bin/ld: cannot find -lc
collect2: ld returned 1 exit status

I'm using gcc-3.4.6 and binutils-2.16.1.

Thanks in advance for any help.

knudfl 03-19-2012 04:35 AM

-lc = libc.so

A 'cross tool chain' is this, as a minimum :
1) binutils 2) gcc 3) A **libc (Any of glibc newlib uclibc etc.)
4) Headers from the target kernel. (Required also for building *libc.)

Setting up a tool chain :
The crosstool-ng build scripts will do that http://crosstool-ng.org/
> http://crosstool-ng.org/download/cro...1.14.1.tar.bz2

The -coff option seems to be included
https://bitbucket.org/bhundven/cross...pts/config.sub


P.S. : The 'Report' button can be used to ask for your thread to be moved
to the 'Embedded Forum', where experts can answer your "cross questions".

.

theNbomr 03-19-2012 12:33 PM

I always recommend Crosstool-NG for people wanting to build cross toolchains, but for 68K architecture, support is extremely thin. Since you've already built a good chunk of the toolchain, it looks like you can proceed with the rest. My take on the error is that it needs a C library to link with, and it hasn't found one. You proably have to complete the toolchain with a C library, such as glibc, or uclibc (probably what you want for a small platform like a 68K).
Out of curiosity, what is your target architcture? Will you be running an OS, or using a bare-metal compiler?

--- rod.

rawrFox 03-19-2012 02:54 PM

I took a look at the crosstool-ng site (which confused me a bit tbh) - and it seems like a cool thing to know about, apart from the fact that when I tried it, m68k wasn't listed in the target options at all, and considering I have binutils and gcc built (after a long time and loads of annoyance - but hey, what's worth doing if it's not a challenge?) I don't want to throw away that work and have to start 'from fresh'.

theNbomr: my target is an Atari 520STE running Minix 1.5. I'm doing this as a side project for some edutainment mostly. To complete the tool chain, I guess I need to compile the C libraries using the m68k-coff compiler on my host? Could you give me some pointers as to how to go about this? There really isn't enough documentation about this neglected architecture, let alone setting up a cross-compiler for it... :'(

theNbomr 03-19-2012 05:10 PM

Sorry, I can't really explain how to do that. I've always allowed a tool like Crosstool-NG figure that out. They do have an active mailing list with friendly help. I suggest asking for pointers on that list.

I was hoping you were developing for an embedded Linux target. I have a possible use-case for such a cross toolchain.

--- rod.


All times are GMT -5. The time now is 02:53 PM.