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


RW> You can get MSVC to output a .asm file with the /FA option -

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;


  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: (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,

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at