[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Building cross compilers



On Sun, Dec 11, 2005 at 09:49:14PM +0100, Daniel Widenfalk wrote:
> Hi all,
> 
> I'm trying to help Haakan Ardo with the toolchain-source package
> and I'm having trouble building a cross compiler. First I must
> say that I'm not yet 100% done with integrating the 4.0.3 line
> of gcc into the toolchain-source package and that is why I need
> your help.
> 
> I can build binutils and gdb for most of the debian targets. I'll
> fix those problems once I get at least one target built as cross
> platform gcc.
> 
> Now to my problems (I've decided to take m68k as my first target):
> 
> 1) When I configure gcc to build a cross compiler, I first get a build
> dependency against libc6-dev-m68k-cross. 

That's correct and necessary.

> This sounds a bit odd as I'm not building a compiler that's going to
> run on a m68k-linux but a compiler that going to build for a
> m68k-linux target.

Sure; but you need to build some target object code as part of the
compiler, too -- see /usr/lib/gcc/<host triplet>/<compiler version>/*;
that's code that gets linked into any binary as part of the necessary
ELF magic.

> My question here is: Is tpkg-make (the tool that
> sets up the build stage for a cross copmiler) missconfiguring gcc or
> should I patch the control.m4 file to remove the -m68k-cross part or
> should I first build the libc6-dev-m68k-cross package?

Yes, you first need to build and install the libc6-dev-m68k-cross
package with dpkg-cross.

> 2) If I patch the control file to not depend on libc6-dev-m68k-cross
> and continue the build process, then I get quite far. I think that
> the entire gcc has been built and that I fail to build "libgcov".
> To be specific; I'm missing include files when trying to compile
> unwind-dw2.c (stack unwinding in dwarf 2?) namely pthread.h, and
> unistd.h. When looking at the command line it seems most include
> files should be in /usr/m68k-linux/include and
> /usr/m68k-linux/sys-include, but these two directories do not
> exist. I figure this is due to me removing the libc6-dev-m68k-cross
> dependency to get past problem 1 above.

Exactly.

> How do I create the libc6-dev-m68k-cross package without having
> a m68k-cross gcc?

apt-get install dpkg-cross
wget $MIRROR/debian/pool/main/g/glibc/libc6-dev_2.3.5-8_m68k.deb
dpkg-cross -am68k -b libc6-dev_2.3.5-8_m68k.deb
dpkg -i libc6-dev-m68k-cross_2.3.5-8_all.deb

-- 
.../ -/ ---/ .--./ / .--/ .-/ .../ -/ ../ -./ --./ / -.--/ ---/ ..-/ .-./ / -/
../ --/ ./ / .--/ ../ -/ ..../ / -../ ./ -.-./ ---/ -../ ../ -./ --./ / --/
-.--/ / .../ ../ --./ -./ .-/ -/ ..-/ .-./ ./ .-.-.-/ / --/ ---/ .-./ .../ ./ /
../ .../ / ---/ ..-/ -/ -../ .-/ -/ ./ -../ / -/ ./ -.-./ ..../ -./ ---/ .-../
---/ --./ -.--/ / .-/ -./ -.--/ .--/ .-/ -.--/ .-.-.-/ / ...-.-/



Reply to: