LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-18-2012, 09:57 PM   #1
rawrFox
LQ Newbie
 
Registered: May 2011
Location: Knapford, Sodor
Distribution: Slackware, FreeBSD
Posts: 13

Rep: Reputation: 10
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.
 
Old 03-19-2012, 04:35 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
-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".

.
 
1 members found this post helpful.
Old 03-19-2012, 12:33 PM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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.
 
1 members found this post helpful.
Old 03-19-2012, 02:54 PM   #4
rawrFox
LQ Newbie
 
Registered: May 2011
Location: Knapford, Sodor
Distribution: Slackware, FreeBSD
Posts: 13

Original Poster
Rep: Reputation: 10
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... :'(
 
Old 03-19-2012, 05:10 PM   #5
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help building x86_64 Cross compiler on x86 linux (Red Hat) torque_dwf Linux - Software 4 01-08-2009 03:37 AM
cross compiler for m68k processor ratnakarreddy Linux - Software 1 05-23-2006 07:50 AM
cross compiler for m68k ratnakarreddy Linux - Software 0 05-22-2006 03:59 AM
Can gcc cross-compile C code to M68K Assembly? lowpro2k3 Programming 1 03-25-2005 07:50 AM
Cross-compiler for x86-64 ogre7299 Linux - Software 0 10-27-2003 11:27 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration