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

Julien Fischer jfischer at opturion.com
Wed Mar 20 11:19:42 AEDT 2013


On Tue, Mar 19, 2013 at 3:16 PM, Peter Wang <novalazy at gmail.com> wrote:

>> 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.

We should do this as a separate step though.

>> > 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.

Could we install just the pregen version of the library with
--enable-minimal-install?
It's not as though you actually use a --enable-minimal-install version
of the compiler
for anything other than bootstrapping a new Mercury anyway.

....

>> > 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?

Yes, go ahead.

Cheers,
Julien.



More information about the reviews mailing list