[m-rev.] for review: Add a `pregen' grade component.

Peter Wang novalazy at gmail.com
Tue Mar 19 15:16:19 AEDT 2013


On Mon, 18 Mar 2013 15:14:44 +1100, Julien Fischer <jfischer at opturion.com> wrote:
> Hi Peter,
> 
> This change is fine by me, at least I can't think of a cleaner solution
> to the problem.  (I agree with Paul, we should try to avoid having multiple
> source distributions.)

Obviously that's best.

> 
> We should probably switch the source distribution around to use the high-level
> C backend at this point as well, i.e. use hlc.gc.prege as the bootstrap grade.
> (Support for pre-generated C files in the hlc grade has been present for
> several years now.)
> 
> This should reduce the instances of users bumping into C compiler bugs and will
> probably result in a faster compiler.  (hlc.gc is usually the fastest grade for
> the Mercury compiler.)

Sounds good.

> 
> > During installation, if required, the pre-generated C source files are
> > used to build and install a Mercury compiler _in a .pregen grade_.
> > Then it is used to install the libraries _in non-.pregen grades_,
> > so that configured settings have their usual effect.
> 
> That of course presupposes that the pregen version of the compiler is
> statically linked against the Mercury libraries (i.e.
> --mercury-linkage=static).  It's probably not worth supporting a pregen version
> of the Mercury compiler that is linked against the shared version of the Mercury
> libraries.

This change doesn't yet block installation of the .pregen grade,
so that should actually work for now.

> > @@ -667,6 +669,22 @@
> >  */
> >
> >  /*
> > +** MR_PREGENERATED_DIST overrides configured values to assume values compatible
> 
> s/assume/take
> 
> > +** with those used to generate the pre-generated source distribution.
> 
>   ... pre-generated C files in the source distribution.
> 
> > +** It implies boxed floats so is incompatible with single-precision floats,
> > +** which imply unboxed floats.
> > +*/
> 
> ...

Ok.

> > diff --git a/runtime/mercury_grade.h b/runtime/mercury_grade.h
> > index 7c12d48..44d356b 100644
> > --- a/runtime/mercury_grade.h
> > +++ b/runtime/mercury_grade.h
> 
> 
> > diff --git a/tools/test_mercury b/tools/test_mercury
> > index 23a3e73..c63f171 100755
> > --- a/tools/test_mercury
> > +++ b/tools/test_mercury
> > @@ -881,6 +881,7 @@ case $HOST in $ROTD_HOST)
> >      rm -f so_locations &&
> >      rm -f .enable_lib_grades &&
> >      $ACLOCAL_CMD &&
> > +    # The cache variable settings can be replaced by --pregenerated-dist.
> >      autoconf &&
> >      mercury_cv_low_tag_bits=2 \
> >      mercury_cv_bits_per_word=32 \
> 
> I intend to separate out the stuff for building the source dist. into a new
> shell script, but that's fine for now.  (Actually, I've been building the
> source distributions since the move over to git using my own script; once this
> change has bootstrapped, I'll switch my version over to use --pregenerated-dist
> and post it for review.)

I made a srcdist package based on the script you inadvertently included.
I'll do a couple of bootchecks using the compiler installed from that,
but I haven't found a problem yet.  Should I then commit the change?
I think there are no bootstrapping issues, but maybe I missed something.

Peter



More information about the reviews mailing list