mlton and netbsd

View: New views
8 Messages — Rating Filter:   Alert me  

mlton and netbsd

by fulvio ciriaco-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hallo,
is there anybody having mlton working on netbsd 5.0?
I tried mlton-20051202-1.i386-netbsd on a "hello world" program
but the generated executable
segfaults in mutatorStackInvariant()
Fulvio
 

_______________________________________________
MLton-user mailing list
MLton-user@...
http://mlton.org/mailman/listinfo/mlton-user

Re: mlton and netbsd

by Jesper Louis Andersen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Sep 22, 2009 at 17:27, fulvio ciriaco <oivulf@...> wrote:
> Hallo,
> is there anybody having mlton working on netbsd 5.0?
> I tried mlton-20051202-1.i386-netbsd on a "hello world" program
> but the generated executable
> segfaults in mutatorStackInvariant()

It is a long time since I last tried mlton on NetBSD. I think the last
NetBSD I ran it on was a 4.x-something. I wonder what changes were
made to memory for you to segfault in that part.


--
J.

_______________________________________________
MLton-user mailing list
MLton-user@...
http://mlton.org/mailman/listinfo/mlton-user

Re: mlton and netbsd

by fulvio ciriaco-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I created smlnj-mlton from mlton in svn trunk and it works fine.
It is now two days that it is compiling mlton, and I do not know
when it will see the end.
My hardware is a bit outdated, a thinkpad t42 with 1 GiB ram.
Fulvio
From: Jesper Louis Andersen <jesper.louis.andersen@...>
Subject: Re: [MLton-user] mlton and netbsd
Date: Thu, 24 Sep 2009 18:56:31 +0200

> On Tue, Sep 22, 2009 at 17:27, fulvio ciriaco <oivulf@...> wrote:
>> Hallo,
>> is there anybody having mlton working on netbsd 5.0?
>> I tried mlton-20051202-1.i386-netbsd on a "hello world" program
>> but the generated executable
>> segfaults in mutatorStackInvariant()
>
> It is a long time since I last tried mlton on NetBSD. I think the last
> NetBSD I ran it on was a 4.x-something. I wonder what changes were
> made to memory for you to segfault in that part.
>
>
> --
> J.

_______________________________________________
MLton-user mailing list
MLton-user@...
http://mlton.org/mailman/listinfo/mlton-user

Re: mlton and netbsd

by Matthew Fluet-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Bootstrapping with an smlnj-mlton build is infeasible on pretty much any
hardware.  1GB is just about enough for a (32-bit) self-compile, but
you'll need a working mlton on your platform.

I'm surprised that the latest NetBSD isn't sufficiently binary compatible
with the older mlton.

On Thu, 24 Sep 2009, fulvio ciriaco wrote:

> I created smlnj-mlton from mlton in svn trunk and it works fine.
> It is now two days that it is compiling mlton, and I do not know
> when it will see the end.
> My hardware is a bit outdated, a thinkpad t42 with 1 GiB ram.
> Fulvio
> From: Jesper Louis Andersen <jesper.louis.andersen@...>
> Subject: Re: [MLton-user] mlton and netbsd
> Date: Thu, 24 Sep 2009 18:56:31 +0200
>
>> On Tue, Sep 22, 2009 at 17:27, fulvio ciriaco <oivulf@...> wrote:
>>> Hallo,
>>> is there anybody having mlton working on netbsd 5.0?
>>> I tried mlton-20051202-1.i386-netbsd on a "hello world" program
>>> but the generated executable
>>> segfaults in mutatorStackInvariant()
>>
>> It is a long time since I last tried mlton on NetBSD. I think the last
>> NetBSD I ran it on was a 4.x-something. I wonder what changes were
>> made to memory for you to segfault in that part.
>>
>>
>> --
>> J.
>
> _______________________________________________
> MLton-user mailing list
> MLton-user@...
> http://mlton.org/mailman/listinfo/mlton-user
>

_______________________________________________
MLton-user mailing list
MLton-user@...
http://mlton.org/mailman/listinfo/mlton-user

Re: mlton and netbsd

by fulvio ciriaco-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hallo,
the compiler works, but it generates buggy executables.
"Hello world" dumps core,
the backtrace is
#0  0x08050b75 in mutatorStackInvariant ()
#1  0x08052e51 in doGC ()
#2  0x07b09aac in ?? ()
#3  0xbbbeb000 in ?? ()
#4  0xbfbfeb04 in ?? ()
#5  0x00000001 in ?? ()
#6  0x08048964 in ?? ()
#7  0xbbbeb000 in ?? ()
#8  0xbbbf6dc8 in _rtld_find_symdef () from /usr/libexec/ld.elf_so
#9  0x00001002 in ?? ()
#10 0xffffffff in ?? ()
#11 0x00000000 in ?? ()

Any good advice?
Fulvio
From: Matthew Fluet <mtf@...>
Subject: Re: [MLton-user] mlton and netbsd
Date: Fri, 25 Sep 2009 15:31:38 -0400 (EDT)

>
> Bootstrapping with an smlnj-mlton build is infeasible on pretty much
> any hardware.  1GB is just about enough for a (32-bit) self-compile,
> but you'll need a working mlton on your platform.
>
> I'm surprised that the latest NetBSD isn't sufficiently binary
> compatible with the older mlton.
>
> On Thu, 24 Sep 2009, fulvio ciriaco wrote:
>> I created smlnj-mlton from mlton in svn trunk and it works fine.
>> It is now two days that it is compiling mlton, and I do not know
>> when it will see the end.
>> My hardware is a bit outdated, a thinkpad t42 with 1 GiB ram.
>> Fulvio
>> From: Jesper Louis Andersen <jesper.louis.andersen@...>
>> Subject: Re: [MLton-user] mlton and netbsd
>> Date: Thu, 24 Sep 2009 18:56:31 +0200
>>
>>> On Tue, Sep 22, 2009 at 17:27, fulvio ciriaco <oivulf@...>
>>> wrote:
>>>> Hallo,
>>>> is there anybody having mlton working on netbsd 5.0?
>>>> I tried mlton-20051202-1.i386-netbsd on a "hello world" program
>>>> but the generated executable
>>>> segfaults in mutatorStackInvariant()
>>>
>>> It is a long time since I last tried mlton on NetBSD. I think the last
>>> NetBSD I ran it on was a 4.x-something. I wonder what changes were
>>> made to memory for you to segfault in that part.
>>>
>>>
>>> --
>>> J.
>>
>> _______________________________________________
>> MLton-user mailing list
>> MLton-user@...
>> http://mlton.org/mailman/listinfo/mlton-user
>>

_______________________________________________
MLton-user mailing list
MLton-user@...
http://mlton.org/mailman/listinfo/mlton-user

Re: mlton and netbsd

by fulvio ciriaco-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hallo,
fortunately bootstrapping with smlnj-mlton resulted quite feasable,
as soon as I increased memory to 2 Gb.
I used smlnj v110.70.
I left it compiling in the evening and found it done in the morning.
So, now I have mlton trunk on NetBSD and I am testing it.
Only the following needed fixing:
the install procedure
the mlyacc Makefile, seems to require mlyacc, I patched it so:
-               mllex src/yacc.lex && \
+               (mllex src/yacc.lex || ml-lex src/yacc.lex) && \
-               mlyacc src/yacc.grm && \
+               (mlyacc src/yacc.grm || ml-yacc src/yacc.grm) && \
                chmod -w src/yacc.grm.*
so it accepts ml-yacc from smlnj when mlyacc is not found.
Also, benchmark/main.sml has no support for netbsd and is not
documented for mlton:
--- main.sml    (revision 7233)
+++ main.sml    (working copy)
@@ -12,7 +12,7 @@
 type int = Int.t

 fun usage msg =
-   Process.usage {usage = "[-mlkit] [-mosml] [-smlnj] bench1 bench2 ...",
+   Process.usage {usage = "[-mlkit] [-mosml] [-smlnj] [-mlton pathToMlton] bench1 bench2 ...",
                   msg = msg}

 val doOnce = ref false
@@ -239,6 +239,7 @@
                    case (MLton.Platform.Arch.host, MLton.Platform.OS.host) of
                      (X86, Linux) => ".x86-linux"
                    | (Sparc, Solaris) => ".sparc-solaris"
+                   | (X86, NetBSD) => ".x86-bsd"
                    | _ => raise Fail "don't know SML/NJ suffix for host type"
                  end
        val heap = concat [bench, suffix]

Fulvio
 
From: Matthew Fluet <mtf@...>
Subject: Re: [MLton-user] mlton and netbsd
Date: Fri, 25 Sep 2009 15:31:38 -0400 (EDT)

>
> Bootstrapping with an smlnj-mlton build is infeasible on pretty much
> any hardware.  1GB is just about enough for a (32-bit) self-compile,
> but you'll need a working mlton on your platform.
>
> I'm surprised that the latest NetBSD isn't sufficiently binary
> compatible with the older mlton.
>
> On Thu, 24 Sep 2009, fulvio ciriaco wrote:
>> I created smlnj-mlton from mlton in svn trunk and it works fine.
>> It is now two days that it is compiling mlton, and I do not know
>> when it will see the end.
>> My hardware is a bit outdated, a thinkpad t42 with 1 GiB ram.
>> Fulvio
>> From: Jesper Louis Andersen <jesper.louis.andersen@...>
>> Subject: Re: [MLton-user] mlton and netbsd
>> Date: Thu, 24 Sep 2009 18:56:31 +0200
>>
>>> On Tue, Sep 22, 2009 at 17:27, fulvio ciriaco <oivulf@...>
>>> wrote:
>>>> Hallo,
>>>> is there anybody having mlton working on netbsd 5.0?
>>>> I tried mlton-20051202-1.i386-netbsd on a "hello world" program
>>>> but the generated executable
>>>> segfaults in mutatorStackInvariant()
>>>
>>> It is a long time since I last tried mlton on NetBSD. I think the last
>>> NetBSD I ran it on was a 4.x-something. I wonder what changes were
>>> made to memory for you to segfault in that part.
>>>
>>>
>>> --
>>> J.
>>
>> _______________________________________________
>> MLton-user mailing list
>> MLton-user@...
>> http://mlton.org/mailman/listinfo/mlton-user
>>

_______________________________________________
MLton-user mailing list
MLton-user@...
http://mlton.org/mailman/listinfo/mlton-user

Re: mlton and netbsd

by Matthew Fluet-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 6 Oct 2009, fulvio ciriaco wrote:
> fortunately bootstrapping with smlnj-mlton resulted quite feasable,
> as soon as I increased memory to 2 Gb.
> I used smlnj v110.70.
> I left it compiling in the evening and found it done in the morning.

Well, bootstrapping mlton with mlton is a 10min compile; so don't get the
impression that the speed with which SML/NJ executes the compiler is the
speed with which MLton executes the compiler.

> Only the following needed fixing:
> the install procedure
> the mlyacc Makefile, seems to require mlyacc, I patched it so:
> -               mllex src/yacc.lex && \
> +               (mllex src/yacc.lex || ml-lex src/yacc.lex) && \
> -               mlyacc src/yacc.grm && \
> +               (mlyacc src/yacc.grm || ml-yacc src/yacc.grm) && \
>                chmod -w src/yacc.grm.*
> so it accepts ml-yacc from smlnj when mlyacc is not found.

You would presumably also need SML/NJ's ml-yacc and ml-lex for the
<src>/mlton/front-end/Makefile (not just for the <src>/mlyacc/Makefile),
since none of the generated files are part of the source distribution.
Also, the above is a little noisy, as the shell will print an error when
it doesn't find mllex or mlyacc.

In any case, I've committed a patch that looks for MLton's tools first,
and then falls back to SML/NJ's tools.

However, bootstrapping from SML/NJ is not considered an "official" method
of compiling MLton.  Please do not make SML/NJ a build requirement for
MLton.

> Also, benchmark/main.sml has no support for netbsd and is not
> documented for mlton:

The benchmark program isn't part of the installed programs; it is only
used by developers, and isn't fully documented.  (There are a number of
other flags besides those on the usage line.)  And it has no explicit
support for many SML/NJ platforms.

I've committed a more robust method of determining the SML/NJ heap suffix.


_______________________________________________
MLton-user mailing list
MLton-user@...
http://mlton.org/mailman/listinfo/mlton-user

Re: mlton and netbsd

by fulvio ciriaco-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

From: Matthew Fluet <mtf@...>
Subject: Re: [MLton-user] mlton and netbsd
Date: Fri, 9 Oct 2009 13:03:11 -0400 (EDT)

> On Tue, 6 Oct 2009, fulvio ciriaco wrote:
>> fortunately bootstrapping with smlnj-mlton resulted quite feasable,
>> as soon as I increased memory to 2 Gb.
>> I used smlnj v110.70.
>> I left it compiling in the evening and found it done in the morning.
>
> Well, bootstrapping mlton with mlton is a 10min compile; so don't get
> the impression that the speed with which SML/NJ executes the compiler
> is the speed with which MLton executes the compiler.
>
Yes, I had already noticed that mlton-mlton is much smaller and
faster than smlnj-mlton.
 

>> Only the following needed fixing:
>> the install procedure
>> the mlyacc Makefile, seems to require mlyacc, I patched it so:
>> -               mllex src/yacc.lex && \
>> +               (mllex src/yacc.lex || ml-lex src/yacc.lex) && \
>> -               mlyacc src/yacc.grm && \
>> +               (mlyacc src/yacc.grm || ml-yacc src/yacc.grm) && \
>>                chmod -w src/yacc.grm.*
>> so it accepts ml-yacc from smlnj when mlyacc is not found.
>
> You would presumably also need SML/NJ's ml-yacc and ml-lex for the
> <src>/mlton/front-end/Makefile (not just for the
> <src>/mlyacc/Makefile), since none of the generated files are part of
> the source distribution.
> Also, the above is a little noisy, as the shell will print an error
> when it doesn't find mllex or mlyacc.
>
> In any case, I've committed a patch that looks for MLton's tools
> first, and then falls back to SML/NJ's tools.
>
> However, bootstrapping from SML/NJ is not considered an "official"
> method of compiling MLton.  Please do not make SML/NJ a build
> requirement for MLton.
>
I had not that many choices. Probably there is some way to cross
compile, but smlnj-bootstrap was easier to discover.
Anyhow, I now have a working mlton package and can do a standard
compilation.
I committed wip/mlton-svn to pkgsrc, for the moment with the
choice for bootstrap, just until I can upload the package in
an official place.
Keeping a working version of mlton-mlton will avoid the necessity
to bootstrap by means of smlnj.

>> Also, benchmark/main.sml has no support for netbsd and is not
>> documented for mlton:
>
> The benchmark program isn't part of the installed programs; it is only
> used by developers, and isn't fully documented.  (There are a number
> of other flags besides those on the usage line.)  And it has no
> explicit support for many SML/NJ platforms.
>
> I've committed a more robust method of determining the SML/NJ heap
> suffix.
>
Oh, it was the first place where I looked for testing the
compiler.
Thank you for promtly patching the Makefiles, this will make
the port much cleaner.
Fulvio

_______________________________________________
MLton-user mailing list
MLton-user@...
http://mlton.org/mailman/listinfo/mlton-user