[LLVMdev] Mod for using GAS with MS VC++

Jeff Cohen jeffc at jolt-lang.org
Mon Jul 11 20:26:58 PDT 2005


Jeff Cohen wrote:

> Chris Lattner wrote:
>
>> On Tue, 12 Jul 2005, Aaron Gray wrote:
>>
>>>>>> Sure, but presumably you want to differentiate between nasm and 
>>>>>> masm (if they are not compatible) right?
>>>>>
>>>>>
>>>>>
>>>>> Right
>>>>
>>>>
>>>>
>>>> Then you need something more specific than 'isWindows'.  I'd 
>>>> suggest, isNASM and isMASM.
>>>
>>>
>>>
>>> 'for' rather than 'is'
>>
>>
>>
>> Yeah sorry.
>>
>>> forMSVC ? There is more to it than that :(
>>> I was going from the _WIN32 preprocessor symbol. So maybe 'forWIN32' 
>>> if it is actually needed.
>>
>>
>>
>> I'll leave this to you and jeffc to hash out.  I'll point out again 
>> that if NASM and MASM are not the same, that using 'win32' will not 
>> work, because it will be defined for both of them.
>>
>> It looks like Nate just committed the subtarget support, so you might 
>> want to look at that.
>>
>> -Chris
>>
> _WIN32 is not suitable.  It will also be defined for mingw, and as 
> Chris pointed out it does not differentiate between NASM and MASM.
>
> To check for being built by MSVC++, look for _MSC_VER.  I'm not sure 
> how to differentiate between gcc and mingw.
>
Use __MINGW32__ for mingw.

Also, I'm really not sure what the point is in supporting NASM.  Anyone 
who has Visual Studio has MASM (or ML as it's now called) as well as 
VC++.  Users of gcc/mingw will happily use gas.  Who's going to bother 
getting NASM?  VS-based developers will be annoyed enough as it is 
having to get bison/sed/flex.




More information about the llvm-dev mailing list