Boost logo

Boost-Build :

Subject: Re: [Boost-build] builtin rule for assembler?
From: Adder (adder.thief_at_[hidden])
Date: 2008-11-04 19:16:45


Hi,

RW> You can get MSVC to output a .asm file with the /FA option -
RW> http://msdn.microsoft.com/en-us/library/367y26c6.aspx

Too bad you can't use that output as input to ML
(Microsoft Macro Assembler) to produce an .obj/.exe file
(unless you're ready to give up exception handling support ^^ Oh no !
The horrors !).

For example, you might want to try to compile the following very
simple code:

  void f ();
  int main ()
  {
    try { f (); } catch (...) { return 1; }
    return 0;
  }

using

  CL /c /EHa /FAs Main.cpp
  ("Compile only, don't link, enable exceptions, generate ASM")
  
and then try to process the output with

  ML /c Main.asm
  ("Assemble only, don't link")

You will get a rightful complaint from the Assembler, due to invalid
nesting of the SEGMENT/ENDS/PROC/ENDP directives:

...
_TEXT SEGMENT ; Begin segment.
...
_main PROC NEAR ; Begin procedure.
...
_TEXT ENDS ; End segment (Missing ENDP before this).
text$x SEGMENT ; Begin another segment (exc. handling code).
...
text$x ENDS ; End segment.
_main ENDP ; End procedure (badly nested).
...

I've uploaded the full example here: http://tinyurl.com/5by89y (2 KB).
I guess one needs to create a custom tool to process the ASM file.

(The Borland/CodeGear toolchain does not have this problem, though.)

-- 
Yours truly,
 Adder

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk