Yasm working with Win32
simonmar at microsoft.com
Fri Dec 15 11:16:39 EST 2006
Peter Tanski wrote:
> On Dec 15, 2006, at 4:19 AM, Simon Marlow wrote:
>> For the native Windows port, we should have a new target, probably
>> i386-unknown-win32 or i386-unknown-windows. Then we can have an
>> option in config.mk to control whether YASM is used, $(UseYASM),
>> which would be on by default for windows_TARGET_OS. Later we might
>> want to make it a configure option, but for now I'd leave it as a
>> build.mk option.
> Right on. Would it be good to consolidate the hard-coded build flags
> into one module, i.e., wired-in flags in DriverPipeline.hs should be
> brought together in DynFlags.hs?
> To sum up:
> * new target: i386-unknown-windows (Yasm covers Win64,
> Intel and AMD)
I imagine a Win64 build will look like x86_64-unknown-windows (if/when we support it; cygwin doesn't support Win64 yet, so we don't have a build system). I don't think it's necessary to change the OS to be -win64, but I could be wrong.
> * windows_TARGET_OS (new cpp define)
You'll get the CPP defines automatically when you tell configure about the i386-unknown-windows target. Note that there are *lots* of #ifdef mingw32_blah_blah that around the system that will need to change, it's probably a good idea to grep and look at each one individually.
> Other things may need changing:
> * add code to DriverPhases.hs to allow ".asm" suffix? (Not
Don't see why not, if it's easy.
> * SysTools.lhs:328-329 (as-prog,as-args) are NOT (gcc_prog,gcc_args)
> * (potential bugger): remove default use of mangler on -O and -fvia-
> C on -fglasgow-exts;
Don't understand this one. -fvia-C won't be available for i386-unknown-windows, right? What are you referring to with -fglasgow-exts?
> Yasm chokes on /ARGS, /NO_ARGS gas directives,
> may add to Yasm with special -D macro[=value] options
Could you elaborate? I don't know what /ARGS is.
More information about the Cvs-ghc