ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
-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.)
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?
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... :'(
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.