bootstrapping gnat GCC on amd64

xorquewasp at googlemail.com xorquewasp at googlemail.com
Wed May 6 15:21:44 UTC 2009


On 2009-05-06 10:57:25, Daniel Eischen wrote:
>
> Back in the day when I did it, it was with gcc-2.7.x or
> gcc-2.8.x I believe.  The cross build process with gnat
> was a little different.  I couldn't do a normal gnat build,
> which did a bootstrap and then rebuilt the compiler again
> using the bootstrap.  I believe I had to manually build
> bootstrap, gnatlib-cross, and gnattools-cross or targets
> named something like that.  I don't even think "install"
> worked - I think I had to manually install the cross.
>
> This does sound vaguely familiar though.  I may have
> just rebuilt the target->target GNAT with the cross
> GNAT, then whenever the build process stopped with
> gnatmake errors, I would manually build whatever target
> it stopped at with the cross gnatbind and gnatlink.
>
> I don't even know if gnatmake is required to rebuild
> the target->target GNAT, all the dependencies should
> be listed in the Makefiles, so gcc should get called
> directly as opposed through gnatmake.  So try going
> forward with rebuilding that x86_64 native GNAT and
> see what happens.  This is really what your goal is,
> having the i386->x86_64 cross is nice, but not really
> essential.
>
> Hmm, I do know that building gnat as a cross
> does work though, since we have and use GNAT for
> sparc-solaris hosted ppc-vxworks cross compilers.
> And gnatmake works just fine as a cross.

Thanks for the notes.

This is an example of one of the build failures when
compiling the x86_64 native GNAT:

mkdir -p ada/bldtools/nmake_b
rm -f ada/bldtools/nmake_b/sinfo.ads ada/bldtools/nmake_b/nmake.adt ada/bldtools/nmake_b/xnmake.adb ada/bldtools/nmake_b/xutil.ads ada/bldtools/nmake_b/xutil.adb
cp -p ../../gcc-4.4.0/gcc/ada/sinfo.ads ../../gcc-4.4.0/gcc/ada/nmake.adt ../../gcc-4.4.0/gcc/ada/xnmake.adb ../../gcc-4.4.0/gcc/ada/xutil.ads ../../gcc-4.4.0/gcc/ada/xutil.adb ada/bldtools/nmake_b
(cd ada/bldtools/nmake_b && x86_64-unknown-freebsd7.2-gnatmake -q xnmake && ./xnmake -b ../../nmake.adb )
x86_64-unknown-freebsd7.2-gnatmake: "xnmake.ali" incompatible ALI file, please recompile
x86_64-unknown-freebsd7.2-gnatmake: "xnmake.adb" compilation error
gmake[2]: *** [ada/nmake.adb] Error 4
gmake[2]: Leaving directory `/root/gcc-4.4.0-obj/gcc'
gmake[1]: *** [all-gcc] Error 2
gmake[1]: Leaving directory `/root/gcc-4.4.0-obj'
gmake: *** [all] Error 2

The Makefiles are pretty twisted and hard to comprehend.

I'll try your suggestion, stepping through each target and
ideally try to get the whole process down to shell script
form.

More news to follow...

xw


More information about the freebsd-hackers mailing list