Discussion:
Building GNAT/GCC 4.2.0
(too old to reply)
deadlyhead
2006-11-22 01:28:01 UTC
Permalink
Has anybody successfully done this? I've been pulling down the SVN
repository on the gcc-4_2-branch from gnu.org and trying to build with
Ada2005 support, but I've been running into nothing but hangups for the
past three days.

It all begins when the *.adb files (the first one to do this is
gcc/ada/comperr.adb) have warnings based on the fact that string ranges
might be out of bounds (which they aren't, but the GNAT compiler is
designed to sniff out possible hangups like this). Unfortunately,
these warnings are treated as errors due to the -gnatg switch passed to
gcc, and compilation fails. There are several ways around this: using
pragma Assert to designate the lower bound; actually changing the
reference to use something along the lines of S'First; passing
ADAFLAGS='-gnatwn', which negates the effect that '-gnatg' has when
warnings are found.

After many failed attempts, I chose to pass '-gnatwn' along with some
other parameters, and this got me past anywhere which warnings were
treated as errors. A new issue arose, though, when a seemingly
generated *.c file, gnatl.c, has several undefined references within
it. It has no comments, of course, and I can't find where all of the
'extern' references are supposed to go. This is where I'm stuck. I'm
no fan of C, and I also can't find where this file originates. (I've
looked through all of the sources, to no avail.) If anyone has either
gotten around this, or is having the same experience, I'd sure like to
know.

So, does AdaCore simply submit patches wholesale, and hope the GCC
developers will make them work? Or are these tested before the
submission so that the branch they are posting to does compile? I
noticed that on the 17th of October, several patches were submitted for
the 4.3 branch now in stage 1. I tried compiling that, but every
_other_ language is messed up there.

--Seth
Jeffrey Creem
2006-11-22 04:20:33 UTC
Permalink
Post by deadlyhead
Has anybody successfully done this? I've been pulling down the SVN
repository on the gcc-4_2-branch from gnu.org and trying to build with
Ada2005 support, but I've been running into nothing but hangups for the
past three days.
Not recently but about a month ago there was a thread about matrix
multiply issues and I was building 4.2 pretty regularly back then with
no issues.

What are you using as a bootstrap compiler? I was using the GCC 3.4.6
that is part of Redhat 4
Duncan Sands
2006-11-22 08:21:34 UTC
Permalink
I built svn head about a week ago, without any
problems. However, I built it using a fairly
recent GNAT. What version are you using to
do the build?

Ciao,

Duncan.
deadlyhead
2006-11-22 16:14:35 UTC
Permalink
I'm using AdaCore's GNAT-GPL, which I downloaded back in June. I've
seen nothing that indicates a new version has been released since then.
The gcc version is 3.4.6 on it.

I actually tried building ``trunk,'' first, not realizing that it had
moved from 4.2 series to 4.3. It bootstrapped and compiled, however
_every test failed_. That was a truly unpleasant experience. This is
why I switched to gcc-4_2-branch. I'm baffled, though, as to why the
development branch would compile, though the ``stable'' series just
dies.

I'm thinking of attempting to build trunk again, and carefully go over
all of the tests to see where the failures are. I don't like the idea,
though, of not being able to compile the majority of my programs to get
Ada working (though I'm trying to build Ada into my normal compiler
because I also don't like the idea of having two compilers hanging
around).
Post by Duncan Sands
I built svn head about a week ago, without any
problems. However, I built it using a fairly
recent GNAT. What version are you using to
do the build?
Ciao,
Duncan.
Ludovic Brenta
2006-11-23 08:50:02 UTC
Permalink
Post by deadlyhead
I'm thinking of attempting to build trunk again, and carefully go
over all of the tests to see where the failures are. I don't like
the idea, though, of not being able to compile the majority of my
programs to get Ada working (though I'm trying to build Ada into my
normal compiler because I also don't like the idea of having two
compilers hanging around).
This is the job of your distribution, IMHO. What platform are you on?

On most GNU/Linux distributions nowadays, GCC supports Ada out of the
box. On Debian, official Ada support is in GCC 4.1.1. There is also
an experimental package gcc-4.2-snapshot which includes the Ada
compiler, but no support for it.

Whatever your distribution, I encourage you to review the build
scripts (beware, they can be very complex, e.g. in Debian) and the
build logs to see if the distribution maintainers encountered the same
problems as you did. Then get in touch with the maintainers and
contribute patches :)
--
Ludovic Brenta.
deadlyhead
2006-12-15 00:03:04 UTC
Permalink
Alright, so I'm giving this another shot. I've downloaded the latest
version of the 4.2 branch of GCC, and I'm attempting to once again
compile based on the Gnat-GPL download from AdaCore.

The options I pass in the configure script are as follows:

$src_dir/configure --prefix=/usr --enable-bootstrap --enable-shared
--enable-threads --enable-clocale=gnu --enable-__cxa_atexit
--enable-gtk-cairo --enable-libada
--enable-languages=ada,c,c++,java,fortran,objc,obj-c++,treelang

where $src_dir is the root gcc directory, since I'm building in a
directory outside of the tree.

configure runs flawlessly, and there are no issues in the logs.

When I'm building, though, things go great until the Ada part of the
build. Here is the tail from the output:

gcc -c -g -fkeep-inline-functions -gnatpg -gnata -I- -I. -Iada
-I/usr/src/gcc/gcc/gcc/ada /usr/src/gcc/gcc/gcc/ada/checks.adb -o
ada/checks.o
gcc -c -g -fkeep-inline-functions -gnatpg -gnata -I- -I. -Iada
-I/usr/src/gcc/gcc/gcc/ada /usr/src/gcc/gcc/gcc/ada/comperr.adb -o
ada/comperr.o
make[3]: Leaving directory `/usr/src/gcc/gcc-build/gcc'
make[2]: Leaving directory `/usr/src/gcc/gcc-build'
make[1]: Leaving directory `/usr/src/gcc/gcc-build'
comperr.adb:182:30: warning: index for "X" may assume lower bound of 1
comperr.adb:182:30: warning: suggested replacement: "X'First"
comperr.adb:185:48: warning: index for "X" may assume lower bound of 1
comperr.adb:185:48: warning: suggest replacement of "X'Length" by
"X'Last"
make[3]: *** [ada/comperr.o] Error 1
make[2]: *** [all-stage1-gcc] Error 2
make[1]: *** [stage1-bubble] Error 2
make: *** [bootstrap] Error 2

As you can see, I'm having trouble with warnings being treated as
errors. I've not been able to find where in the Makefiles this
behavior is specified. Is -Werror a permanent option in the GCC
supplied by the Gnat-GPL release? Does anyone have a clean way of
turning this off?

I've tried modifying the file comperr.adb to avoid this hangup by using
the pragma assert to force the lower bound assumption of 1 indicated in
the errors, however this just allows comperr.adb to compile and later
files will throw the same.

Sorry to keep beating this dead horse. It's driving me nuts.

--Seth
Post by Ludovic Brenta
Post by deadlyhead
I'm thinking of attempting to build trunk again, and carefully go
over all of the tests to see where the failures are. I don't like
the idea, though, of not being able to compile the majority of my
programs to get Ada working (though I'm trying to build Ada into my
normal compiler because I also don't like the idea of having two
compilers hanging around).This is the job of your distribution, IMHO. What platform are you on?
On most GNU/Linux distributions nowadays, GCC supports Ada out of the
box. On Debian, official Ada support is in GCC 4.1.1. There is also
an experimental package gcc-4.2-snapshot which includes the Ada
compiler, but no support for it.
Whatever your distribution, I encourage you to review the build
scripts (beware, they can be very complex, e.g. in Debian) and the
build logs to see if the distribution maintainers encountered the same
problems as you did. Then get in touch with the maintainers and
contribute patches :)
--
Ludovic Brenta.
deadlyhead
2006-12-15 00:11:46 UTC
Permalink
Crap. I just realized that the `-gnatpg' switch is what's causing
this. However, I thought that the `p' was supposed to suppress the
checks, thus counteracting the warnings-as-errors implied by `-gnatg'.
I doubt very much that I want to remove `-gnatg' switches. I'll try
explicitly changing all occurrences of `-gnatpg' to `-gnatg -gnatp' in
the Make files.

--Seth
deadlyhead
2006-12-15 05:25:18 UTC
Permalink
Well, that didn't work. Time to start hack-hack-hacking away.

--Seth
Post by deadlyhead
Crap. I just realized that the `-gnatpg' switch is what's causing
this. However, I thought that the `p' was supposed to suppress the
checks, thus counteracting the warnings-as-errors implied by `-gnatg'.
I doubt very much that I want to remove `-gnatg' switches. I'll try
explicitly changing all occurrences of `-gnatpg' to `-gnatg -gnatp' in
the Make files.
--Seth
Ludovic Brenta
2006-12-15 08:40:48 UTC
Permalink
Post by deadlyhead
Well, that didn't work. Time to start hack-hack-hacking away.
--Seth
Post by deadlyhead
Crap. I just realized that the `-gnatpg' switch is what's causing
this. However, I thought that the `p' was supposed to suppress the
checks, thus counteracting the warnings-as-errors implied by `-gnatg'.
I doubt very much that I want to remove `-gnatg' switches. I'll try
explicitly changing all occurrences of `-gnatpg' to `-gnatg -gnatp' in
the Make files.
--Seth
GNAT automatically compiles all units under the Ada.*, System.*, and
Interfaces.* hierarchies with -gnatpg; you can't turn that off.
--
Ludovic Brenta.
A: No.
Q: Should I include quotations after my reply?
deadlyhead
2006-12-15 09:59:00 UTC
Permalink
Post by Ludovic Brenta
Post by deadlyhead
Well, that didn't work. Time to start hack-hack-hacking away.
--Seth
Post by deadlyhead
Crap. I just realized that the `-gnatpg' switch is what's causing
this. However, I thought that the `p' was supposed to suppress the
checks, thus counteracting the warnings-as-errors implied by `-gnatg'.
I doubt very much that I want to remove `-gnatg' switches. I'll try
explicitly changing all occurrences of `-gnatpg' to `-gnatg -gnatp' in
the Make files.
--SethGNAT automatically compiles all units under the Ada.*, System.*, and
Interfaces.* hierarchies with -gnatpg; you can't turn that off.
--
Ludovic Brenta.
A: No.
Q: Should I include quotations after my reply?
So, basically what I'm looking at is some poor code submitted to the
branch by AdaCore, code which the compiler is too picky to pass?
That's a dirty shame.

BTW, I'm attempting to build trunk now. Hopefully the tests will pass.

--Seth
deadlyhead
2006-12-15 10:00:57 UTC
Permalink
Post by Ludovic Brenta
GNAT automatically compiles all units under the Ada.*, System.*, and
Post by Ludovic Brenta
Interfaces.* hierarchies with -gnatpg; you can't turn that off.
--
Ludovic Brenta.
A: No.
Q: Should I include quotations after my reply?So, basically what I'm looking at is some poor code submitted to the
branch by AdaCore, code which the compiler is too picky to pass?
That's a dirty shame.
BTW, I'm attempting to build trunk now. Hopefully the tests will pass.
--Seth
Well, I spoke too soon. Trunk build fails on assembly code for the
Fortran compiler, in the third stage of the bootstrap. I'm
displeased...

--Seth
Ludovic Brenta
2006-12-15 11:55:57 UTC
Permalink
Post by deadlyhead
Well, I spoke too soon. Trunk build fails on assembly code for the
Fortran compiler, in the third stage of the bootstrap. I'm
displeased...
As a member of the Debian GCC maintainers, I'm just curious to know
why you're trying to compile GCC for yourself. Also, why do you
enable all languages? Do you really need them all?

If you're planning to hack on GCC, why don't you join the
***@gcc.gnu.org mailing list?

If you're trying to install a version of GCC newer than that on your
distribution, why not ask the distribution maintainers for assistance?
For example, Debian has a package named gcc-snapshot in the
experimental section, and you might as well use that.

Or perhaps you are the GCC maintainer for some distribution?
--
Ludovic Brenta.
Georg Bauhaus
2006-12-15 12:07:22 UTC
Permalink
Post by Ludovic Brenta
Post by deadlyhead
Well, I spoke too soon. Trunk build fails on assembly code for the
Fortran compiler, in the third stage of the bootstrap. I'm
displeased...
As a member of the Debian GCC maintainers, I'm just curious to know
why you're trying to compile GCC for yourself. Also, why do you
enable all languages? Do you really need them all?
And do you need all of the "non-standard" configure options?

You could build a simpler collection and install it
somewhere. /usr is a bit of a high risk setting, anyway.

I've had no trouble building 4.3.0 on Ubuntu with C++,
Ada, and Fortran 95 enabled. Running the tests the results
weren't too bad (with the exception of libmudflap).



-- Georg
deadlyhead
2006-12-15 18:22:12 UTC
Permalink
Post by Georg Bauhaus
You could build a simpler collection and install it
somewhere. /usr is a bit of a high risk setting, anyway.
I've had no trouble building 4.3.0 on Ubuntu with C++,
Ada, and Fortran 95 enabled. Running the tests the results
weren't too bad (with the exception of libmudflap).
-- Georg
The configure options are actually what I've used for all of my GCC
builds before this, to make sure that it builds properly for my system
rather than crossing my fingers and hoping it ``does the right thing.''
I also understand that /usr can be a high-risk location, but since
I've got nothing in there that I didn't compile and install myself, I'm
relatively confident that I won't be doing any harm.

--Seth
deadlyhead
2006-12-16 09:38:44 UTC
Permalink
Post by deadlyhead
The configure options are actually what I've used for all of my GCC
builds before this, to make sure that it builds properly for my system
rather than crossing my fingers and hoping it ``does the right thing.''
I also understand that /usr can be a high-risk location, but since
I've got nothing in there that I didn't compile and install myself, I'm
relatively confident that I won't be doing any harm.
--Seth
WHEEEOOOO! I built trunk!

It appears that all went well, and that the vast majority of the tests
passed (including all of libmudflap). It looks like it was more a
question of checking out at the right time than anything. Thanks to
Duncan for pointing out to me that the 4.2 branch is indeed ``older''
than GNAT-GPL. And thanks to everyone who replied for not simply
telling me to sod off for being annoying and/or and idiot.

I may yet do some hacking on the sources. Never hurts to learn more
about the tools you use.

--Seth

deadlyhead
2006-12-15 18:17:24 UTC
Permalink
Post by Ludovic Brenta
As a member of the Debian GCC maintainers, I'm just curious to know
why you're trying to compile GCC for yourself. Also, why do you
enable all languages? Do you really need them all?
If you're planning to hack on GCC, why don't you join the
If you're trying to install a version of GCC newer than that on your
distribution, why not ask the distribution maintainers for assistance?
For example, Debian has a package named gcc-snapshot in the
experimental section, and you might as well use that.
Or perhaps you are the GCC maintainer for some distribution?
--
Ludovic Brenta.
Well, you see, I don't _use_ a distribution, per se. I've compiled all
my packages from scratch, a la Linux From Scratch, and I rather like
it. Since I compile all of my own packages, rather than using binaries
from some distribution, having as many compilers available to me as I
can means that I have less chance of not having access to a certain
package.

Likely I will be joining the GCC mailing list, of for no other reason
than to keep an eye on progress.

--Seth
Duncan Sands
2006-12-15 14:53:28 UTC
Permalink
Post by deadlyhead
Well, I spoke too soon. Trunk build fails on assembly code for the
Fortran compiler, in the third stage of the bootstrap. I'm
displeased...
It's changing all the time - it's the main development branch after
all - so it's pot luck as to whether it builds/works properly. Try
again in a few days time.

Ciao,

Duncan.
Duncan Sands
2006-12-15 14:52:28 UTC
Permalink
Post by deadlyhead
So, basically what I'm looking at is some poor code submitted to the
branch by AdaCore, code which the compiler is too picky to pass?
That's a dirty shame.
No, I don't think so. The problem is that the compiler version you
are building is older than the compiler version you are using to do
the build. AdaCore takes some care (apparently) that you can build
an newer compiler with an older one, but not the other way round. If
you want something more recent than GNAT GPL, try gcc 4.3 (from svn).

Best wishes,

Duncan.
Duncan Sands
2006-12-15 07:47:02 UTC
Permalink
Post by deadlyhead
Alright, so I'm giving this another shot. I've downloaded the latest
version of the 4.2 branch of GCC, and I'm attempting to once again
compile based on the Gnat-GPL download from AdaCore.
...
gcc -c -g -fkeep-inline-functions -gnatpg -gnata -I- -I. -Iada
-I/usr/src/gcc/gcc/gcc/ada /usr/src/gcc/gcc/gcc/ada/comperr.adb -o
ada/comperr.o
make[3]: Leaving directory `/usr/src/gcc/gcc-build/gcc'
make[2]: Leaving directory `/usr/src/gcc/gcc-build'
make[1]: Leaving directory `/usr/src/gcc/gcc-build'
comperr.adb:182:30: warning: index for "X" may assume lower bound of 1
comperr.adb:182:30: warning: suggested replacement: "X'First"
comperr.adb:185:48: warning: index for "X" may assume lower bound of 1
comperr.adb:185:48: warning: suggest replacement of "X'Length" by
"X'Last"
make[3]: *** [ada/comperr.o] Error 1
make[2]: *** [all-stage1-gcc] Error 2
make[1]: *** [stage1-bubble] Error 2
make: *** [bootstrap] Error 2
File a bug report in gcc bugzilla: http://gcc.gnu.org/bugzilla/

Ciao,

Duncan.
Loading...