What is the mechanism the IDE uses to decide whether to invoke the linker stage after the compier stage? This seems to be the problem: The IDE seems to be getting a false signal of a compiler error, when none occurs. I've run the compiler and linker stages manually, and they complete without error. I used the compiler options and flags as specified by the IDE (got them by pressing the build button with the shift key depressed.)
I've almost definitely isolated the error down to the IDE. The g++ compiler is doing it's job correctly, producing good, linkable .o output, but the link stage isn't being called in some situations. When it is called, the link proceeds without error, and the .elf and .bin files are successfully built.
I've managed to cajole the IDE into invoking the link stage by rearranging the position of a #include directive. The directive was brought up one level from another include file to being included directly from the sketch. The rearrangement should make no difference to the compilable source output by the preprocessor, however, and a check using the -save-temps option verfies this: In both arrangements the post processed source is identical, line for line. No omissions, no reordering -- I really mean line for line identical output that is being passed to the compiler. (Which is actually what one would expect given the normal behavior of the preprocessor.)
I've tested the ERRORLEVEL of the compilation using both #include arrangements; in both cases, the ERRORLEVEL returns as 0. So I don't know what signal the IDE is using to detect a problem in the compilation stage. But whatever it is using, it would appear it is not 100% reliable.
I've run out of time chasing this one down for now. The code compiles without complaint using the Arduino IDE (0023 and 1.0.1) and AVR g++. I was doing what I thought would be a straightforward port to the Maple when I struck this problem. Sort of side-tracked the project for a couple of days, unfortunately, but now I must really get on with it. The #include rearrangement is a clumsy work-around on the Maple for now, but it bothers me for two reasons a) the underlying problem is not completely characterised or understood, it's just an empirical thing, and the underlying problem may manifest itself in other situations unexpectedly, and b) the #include is really out of place, and really should be where it was originally and not in the main sketch.
If anyone is familiar the details of how the IDE detects a failed compilation to suppress invoking the link stage, please chime in.