CLFS GNAT support HOWTO.
Hi there! I have noticed that on BCLFS under compilers there is no GNAT support so I took it a upon myself to make a howto.
Here we go! Okay before we even start, let me tell you that this was actually a pain in the ass at first, but is pretty simple after you have failed the first 100 times. It is easier support GNAT if you start over, sadly Ada support within gcc doesn't like when you cross-compile too totally different versions of gcc, that being said I will guide you on how to build a fully functional Ada backend for your cross-compile tools (which will allow you to include the Ada backend later on). First things first, follow the book up until Ch.4 "Setting Up the Environment" (we dont want to add host defines or targets just yet)... There are some prerequisites. Gcc 4.6.1 http://ftp.gnu.org/gnu/gcc/gcc-4.6.1/gcc-4.6.1.tar.bz2 Gcc patch #1 http://www.linuxfromscratch.org/patc...es_fix-1.patch Gcc patch #2 http://www.linuxfromscratch.org/patc...ompile-1.patch AdaCore's GNAT compiler (be sure to download the 2010 edition!) 'gnat-gpl-2010-x86_64-pc-linux-gnu-bin.tar.gz' http://libre.adacore.com/libre/download2 1. Make the directory '/fake-tools' and its link just as the book tells you how to do it for the cross-tools and tools directories. As root: Code:
exit Code:
tar -xvf gnat-gpl-2010-x86_64-pc-linux-gnu-bin.tar.gz Code:
export OLDPATH=$PATH Code:
mkdir -v ../binutils-build First we need to patch: Code:
patch -Np1 -i ../gcc-4.6.1-cross_compile-1.patch I didn't build all gcc support libraries, because we don't actually want to link to these, we want gcc to build stand alone versions. Code:
tar -jxf ../mpfr-3.0.1.tar.bz2 Code:
rm -rf /cross-tools/oldgcc --enable-languages=c,ada --enable-adalib' to the configure script when you build gcc-static 8. Finally fix the $PATH and remove /fake-tools since they will not be needed anymore. Code:
export PATH=$OLDPATH 9. All you need to do now is pass '--disable-target-libiberty --disable-target-zlib --enable-languages=c,ada --enable-adalib'to the rest of the gcc builds and you will have a fully working ada backend for gcc. 10. In final cross-gcc (before you build your temperary system) you need to create some symlinks or building any Ada libraries will fail. I will give you an example, note that this has to be done to all the gnat tools, bind, gnat, gnatmake, etc as many scripts call these names not the full name of the compiler or tool. Code:
cd /cross-tools/bin And now we have a fully functional Ada backend to be used in the rest of CLFS and BCLFS enjoy... if this was not any help to you, tell me to shut up and I'll be on my way. :P |
All times are GMT -5. The time now is 06:13 PM. |