Re: [MLton] Patches needed for MLton in debian/stretch

Matthew Fluet <[email protected]> Sat, 17 Dec 2016 19:20:25 -0500
Newsgroups gmane.comp.lang.ml.mlton.devel
Message-ID <CAMrhFL4SnDrG7zHdAUztVZT2CQ=KtrvheyGfDc8q8KRt9u8qvw@mail.gmail.com>
Thanks very much for getting MLton up to speed with the latest Debian
requirements!

The various platform patches can probably be merged.

I know about the feature test macros issue; obviously, it is a simple
patch, but I'd like to investigate where the runtime system isn't
quite POSIX compliant (i.e., why exactly we've been using
_BSD_SOURCE).

We should include a way of disabling PIC.  But, for those needing a
non-PIE, they can achieve that with a "-link-opt -fno-PIE"; there
shouldn't be a problem (just a small performance hit) if the
intermediate object files are PIC.

MLton.World.load (and "@MLton load-world <world>") are incompatible
with PIE (and, to a lesser extent, with non-PIE but ASLR of shared
libraries).  Essentially, the saved state of the running computation
includes code addresses (e.g., the return address of the
MLton.World.save call that created the world, but also all of the
other return addresses on the ML stack and other runtime system
state); those addresses are meaningless in a new execution of the
executable at a different address.  Compiling with "-link-opt
-fno-PIE" generally gets the world* regressions to pass; technically,
even with "-link-opt -fno-PIE", if some code address of a shared
library gets caught in the program state, then that address would be
meaningless in the resumed process (but, it isn't typical to capture
such values).  In any case, the compiler proper does not make use of
world saving or loading, so there is no issue with bootstrapping.


On Sat, Dec 17, 2016 at 5:24 PM, Wesley W. Terpstra <[email protected]> wrote:
> Hey,
>
> I had to make a few minor changes to MLton to get it to build on all
> the current debian architectures. I leave it up to your discretion if
> any should be merged upstream. I believe you already have the
> arm64.patch, but not the rest.
>
> The patch which turns PIC on by default for linux should probably come
> with a corresponding option to turn PIC off. However, since binaries
> in debian are now required by policy to turn on PIC, I did not include
> a new command-line option.
>
> Also, there is currently a regression causing every world* test to
> fail on every architecture. I have not yet investigated, as this
> little-used feature does not seem to affect the compiler negatively, I
> suspect it's related to the security improvements made to debian, and
> it the deadline to get MLton into stretch is Dec 24th (Jan 5th - 10
> days waiting time).
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> MLton-devel mailing list
> [email protected]; [email protected]
> https://lists.sourceforge.net/lists/listinfo/mlton-devel
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot