building cross compiler, having issues
this is my first time trying to build a compiler from the gnu compiler collection source so, inevitably, i'm having a few issues. i'm trying to build a cross compiler for arm4 targets on my virtual machine, running FreeBSD 7. I'm doing this for building arm4 code for an arm7tdmi chip in the gameboy advance for an operating system project. i have downloaded libgba and the appropriate headers but i need a compiler that will build raw binaries (not ELF compatible, should be a.out old binaries i think) that i can pull over to my flash cartridge and run on the system. here's what i've done so far:
1. downloaded binutils 2.18: won't compile for arm or i386 targets
2. downloaded binutils 2.9: won't compile for arm or i386 targets
3. downloaded binutils 2.8: won't compile for arm or i386 targets
4. make install gcc41 in /usr/ports: gcc upgraded successfully
5. tried to compile gcc43 from source: no success for i386 target: missing gmp, mpfr
6. make install gmp and mpfr in /usr/ports: successful
7. tried again to compile gcc43: no success, different error:
sed -e 's/@gcc_version@//' < > mkheadersT Syntax error: redirection unexpected
should i even bother compiling from source? it seems impossible. i'm trying to gain a greater understanding of gcc and compilation for BSD systems as i'm hoping to soon make a career out of embedded systems programming... maybe i'm just a noob but i was hoping that it would be possible to download and compile gcc from source for any target OS? maybe not...
Is there some way to build a compiler using ./configure options from the ports tree? I'm thinking since that worked, perhaps there's a way to install with --prefix=/path/to/tools --target=arm4l or something like that... any help would be great.
i'd prefer to build this from the source available from gnu rather than ports just to get the experience and learn more about gcc but if that's not possible or no one has the info, compiling from ports would be sufficient.
I don't fully understand what you were doing with ports....
I suggest you install portmaster
install ports using it....
portmaster is very easy to use sh script, which doesn't require any other ports to be installed..
postmaster will make things way more easy
update your ports tree
using csup or portsnap (i suggest 2nd, which is faster)
$ cd /usr/ports/ports-mgmt/portmaster $ make install clean
to install gcc
$ portmaster lang/gcc44
Also do you have actual FreeBSD system on real PC?
If so, do you know that you can compile ports for other architectures from different architecture (for example from i386 compile for sparc64)
This can be done on Virtual machine as well (i just don't really know how, but google might help)
Last edited by graudeejs; 12th September 2008 at 04:04 PM.
Trying to build a cross compiler is quite difficult with gcc you often have to
patch various parts of the gcc build system for it to work.
I have a partial port of gcc for arm, but it was done on 6.2. If you want that I can send it
to you - just let me know.
You do not need to have the compiler produce binary object you leave it to the
linker(ld) - and a particular linker script that matches the memory layout
of your hardware.
You might have more success looking into crosstool - not sure if it will work
on 7 though.
This is a script that can do all the patching. I used it on FreeBSD for ARM cross compiler. Also built a Linux version using a Debian chroot on freeBSD.
Let me know if you want more info.
Last edited by hsw; 13th September 2008 at 03:37 PM. Reason: correct spelling
|Thread||Thread Starter||Forum||Replies||Last Post|
|Delete compilers to cross compile||revzalot||OpenBSD Installation and Upgrading||9||28th August 2009 09:06 PM|
|FreeBSD 7.0 kernel building...||daemonFromHeaven||FreeBSD Installation and Upgrading||4||3rd September 2008 03:42 PM|
|java compiler||bsdnewbie999||OpenBSD Packages and Ports||8||9th August 2008 01:18 PM|
|pkg_chk c++ compiler not available||fenrisW0lf||NetBSD Package System (pkgsrc)||15||30th June 2008 11:48 AM|
|pcc compiler question||ChineseBroccoli||FreeBSD General||1||12th June 2008 12:29 AM|