[m-dev.] 32-bit sources on 64-bit target

Peter Wang novalazy at gmail.com
Thu Mar 7 17:08:01 AEDT 2013


On Thu, 7 Mar 2013 15:17:26 +1100, Julien Fischer <jfischer at opturion.com> wrote:
> On Thu, Mar 7, 2013 at 3:06 PM, Peter Wang <novalazy at gmail.com> wrote:
> > On Thu, 7 Mar 2013 12:17:20 +1100, Peter Wang <novalazy at gmail.com> wrote:
> >>
> >> So there will be problems whenever a data structure with those
> >> characteristics crosses the standard library/user program boundary.
> >>
> >> I think I can fix the first by allocating two words to a `float'
> >> constructor argument whenever --no-unboxed-float is used, even when it
> >> is unnecessary on 64-bit.
> >>
> >> The second, I'm guessing, does not actually occur in the standard
> >> library.  A solution would be to restrict enum packing to using at
> >> most 32 bits of a word, with an option like --max-arg-packing-bits=32.
> >
> > Actually, why don't we "just" make the srcdist build and install the
> > proper stage 2 compiler/library, since everyone is recommended to do
> > that anyway.  The stage1 compiler from the pregenerated C sources should
> > be fine as its compiler and library parts should agree.
> 
> Doesn't stage 2 take it's configuration settings from stage 1 though?  (IIRC,
> at for at least some of those settings depend on whether we have pre-generated
> C files or not.)

Here's another idea: provide pre-generated C files from a special grade,
e.g. `*.lcd' (lowest common denominator, to give it a name for now).
The `.lcd' grade component would switch off those troublesome data
representations that I mentioned.

In addition, we provide settings for the pre-generated sources in
DISTINCT files, e.g. COMP_FLAGS.lcd.  The build system needs to use
these files when building from the pre-generated sources, and only then.
(easier said than done)

When you configure on a 64-bit system, you get 64-bit settings
in Mercury.config/COMP_FLAGS/LIB_FLAGS/etc. so the library grades will
built and installed with 3 tag bits and unboxed floats.  The library
built from pre-generated sources (which is incompatible) will not be
installed and used by accident.

The compiler built from pre-generated sources WILL be installed.
For now, I can't think of why that would be a problem.

Peter



More information about the developers mailing list