[MLton] Windows port of MLton using the Microsoft tools (e.g. without MinGW)

Nicolas Bertolotti nicolas.bertolotti at polyspace.com
Thu Jul 26 11:44:17 PDT 2007


 > As for assembler, I have been using Yasm <http://www.tortall.net/
> projects/yasm/> with the Glasgow Haskell Compiler (GHC) because that
> outputs assembler with gas syntax and Yasm, a Windows-native program
> that outputs MS PE-COFF format (-fwin32 or -fwin64), is capable of
> building the entire compiler.  There is a windows binary of Yasm
> available for download.  (Yasm also accepts NASM syntax, which I am
> using for pure-assembler pieces of a replacement gmp-library I have
> been working on, though slowly of late.)  It would not be too much
> trouble to use Yasm in the Makefile; if you want I will see what I
> can do.

Hi,

I didn't know Yasm so I've download it and tried to use it instead of 'gas'
in order to build the MLton generated files for a simple "Hello world"
program.

In order to build using gas, I used :
i686-pc-mingw32-as -o sources.1.obj sources.1.S

Then, I changed my script in order to run :
$ ./toto.pl sources.1.S
$ yasm-0.6.1-win32.exe -p gas -w -X gnu -f coff sources.1.S -o sources.1.obj
where toto.pl is a script which simply handles the __LINE__ directive that
is used in the generated files.

Unfortunately, the resulting binary crashes (similar crash than the one I
has using MASM). Anyway, I'd prefer not adding a dependency to an additional
external tool and rely only on Microsoft's (strange idea isn't it ?)

The issue may be related to the cdecl & declspec stuff as mentioned by
Matthew in a previous message so I'm going to take a look.

Cheers

Nicolas

> 
> Cheers,
> Pete





More information about the MLton mailing list