-target command-line option

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

-target command-line option

by Timothy Bourke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I was able to cross-compile to MinGW on FreeBSD over the weekend
(using wine, rather than ssh, to run the intermediate executables).

The support for this within MLton is excellent.

I found, however, that running:

    mlton -target mingw32

does not work on my laptop because the native gcc is 3.4.6, while that
of the mingw32-gcc port is 4.2.1. I tried specifying the -V option:

    mlton -target mingw32 -cc-opt -V4.2.1

but the -V4.2.1 is not passed early enough (relative to the other
options) for gcc.

Specifying both target and compiler does work:

    mlton -target mingw32 -cc mingw32-gcc

but with warnings:

    unrecognized option '-b'

These are innocuous, but I wondered whether it would be worthwhile to
extend the -target option so that if its argument ends in a hyphen, like:

    mlton -target mingw32-

MLton would:
    1) set the target to mingw32
    2) set cc to mingw32-gcc
    3) _not_ add the -b argument

If this idea finds any support I will attempt a patch. If not, I can
live with the warnings!

Tim.



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

attachment0 (194 bytes) Download Attachment

Re: -target command-line option

by Matthew Fluet-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 28 Apr 2008, Timothy Bourke wrote:
> I was able to cross-compile to MinGW on FreeBSD over the weekend
> (using wine, rather than ssh, to run the intermediate executables).
>
> The support for this within MLton is excellent.

Glad to hear that it is a useful feature.

> These are innocuous, but I wondered whether it would be worthwhile to
> extend the -target option so that if its argument ends in a hyphen, like:
>
>    mlton -target mingw32-
>
> MLton would:
>    1) set the target to mingw32
>    2) set cc to mingw32-gcc
>    3) _not_ add the -b argument
>
> If this idea finds any support I will attempt a patch. If not, I can
> live with the warnings!

Actually, you've been beaten to the punch:
   http://mlton.org/cgi-bin/viewsvn.cgi?rev=6403&view=rev

Wesley Terpstra noted similar issues with invoking the mingw cross
compiler.  Recent gcc manual pages have recommended directly invoking
<target>-gcc, rather than using gcc -b <target>.

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

Re: -target command-line option

by Timothy Bourke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Apr 29 at 09:57 -0500, Matthew Fluet wrote:

> On Mon, 28 Apr 2008, Timothy Bourke wrote:
>> These are innocuous, but I wondered whether it would be worthwhile to
>> extend the -target option so that if its argument ends in a hyphen, like:
>>
>>    mlton -target mingw32-
>>
>> MLton would:
>>    1) set the target to mingw32
>>    2) set cc to mingw32-gcc
>>    3) _not_ add the -b argument
>>
>> If this idea finds any support I will attempt a patch. If not, I can
>> live with the warnings!
>
> Actually, you've been beaten to the punch:
>   http://mlton.org/cgi-bin/viewsvn.cgi?rev=6403&view=rev
>
> Wesley Terpstra noted similar issues with invoking the mingw cross
> compiler.  Recent gcc manual pages have recommended directly invoking
> <target>-gcc, rather than using gcc -b <target>.
That's excellent. Thanks Matthew and Wesley.

I did try searching beforehand; but obviously not hard enough!

Tim.



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

attachment0 (194 bytes) Download Attachment