Hi Tim, > I'm trying to get started on evaluating gcc for generating m68k code > for embedded targets. I'm using Debian 5.0 but can pull in more recent > gcc source if required. I've spent a few hours Googlin' around and > have some initial questions, if anyone on the list has experience > using gcc as a cross-compiler.
I've done `build ARM on x86' ages ago, and the `three-stage bootstrap' before that to get a decent compiler on Ultrix, a Unix from DEC, but nothing more recent, I install what others have built, so this could be out of date... > What's multilib and how does it fit in with newlib (which I gather I > need to build for a different target)? I don't think multilib is relevant to what you're doing. Presumably, this is non-Linux, and you're primarily interested in the quality of code gcc produces. Building newlib with your cross-compiling toolchain gives you a C library, if you need one. > Do I need to do a specific gcc build for m68k (I'm assuming yes, but > confirmation would be nice!). Yes, I think gcc only supports the one target you state when it's built, unlike LLVM and clang, IIRC, which can have a whole load thrown in and you choose at run-time. (LLVM doesn't support m68k though AFAICS. Perhaps in time. It has some experimental PIC16 support now.) > I assume I also need to build binutils for m68k too? Yes. I've always thought the `toolchain' people refer to is the group of target-architecture-specific commands to get from textual source to runable binary, e.g. ELF, COFF, or just hex. as(1), cc(1), ld(1), and so on. binutils provides some of them. But it seems it may be wider than that and include make(1), etc., which don't need to know of the cross-compilation. You may find http://vmlinux.org/crash/mirror/www.objsw.com/CrossGCC/FAQ.html of use. I can't contact the author's site, and it's probably out of date, but chapter four gives an idea of the steps involved. Cheers, Ralph. -- Next meeting: Blandford Forum, Tuesday 2010-09-07 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ How to Report Bugs Effectively: http://bit.ly/4sACa