[m-rev.] diff: fix bug #386: broken source distribution
Julien Fischer
jfischer at opturion.com
Wed Jul 1 10:34:33 AEST 2015
Hi Peter,
On Wed, 1 Jul 2015, Peter Wang wrote:
> On Wed, 1 Jul 2015 01:32:21 +1000 (AEST), Julien Fischer <jfischer at opturion.com> wrote:
>>
>> Fix bug #386: broken source distribution.
>>
>> The recent change to do more robust evaluation of int operations (commit
>> 6e3e60f) broke installation of the library grades from the source distribution
>> on 64-bit machines. The problem is that we set the target bits-per-word to 32
>> when building the source distribution. This means that any evaluation of int
>> operations done while building the source distribution's C files treats ints as
>> being 32 bit values. However, for the source distribution the size of an int
>> will not be decided until the configure script is run, which is *after* the C
>> files have been generated.
>>
>> This change disables all compile time evaluation of int operations when
>> compiling in .pregen grades.
>>
>> compiler/const_prop.m:
>> compiler/simplify_goal_call.m:
>> As above.
>
> Thanks for finding the bug.
>
> Perhaps target_bits_per_int should be semidet and fail for
> pregenerated_dist?
I think so; the above change is just to get things working again.
(It's essentially parts of the old code with
s/cross_compiling/pregenerated_dist/.)
> Or the bits_per_word and bytes_per_word options in
> globals should be maybes and set to no for pregenerated_dist.
bits_per_word, at least, must currently have a value as it's also used
in some spots in switch generation. (Although, again probably there we
should just check if pregenerated_dist is enabled and we should just
assume 32 bits if it is.)
I intend to add some comments to source distribution build script
documenting all this. I'll take a look at modifying target_bits_per_int
etc later.
Cheers,
Julien.
More information about the reviews
mailing list