[M3devel] ABIs and combinatorial configuration explosion in another project

Jay jayk123 at hotmail.com
Wed Jan 23 09:11:21 CET 2008


Our main concern here is jmpbuf size.
And possibly exception interop. C++ throw should run Modula-3 finally en route to the C++ catch, and vice versa. Bonus points if each language can catch each other's exceptions, by type.
Oh and interop with other Modula-3 compilers. :)
Btw, you can see how profiling munges build_dir, same thing.
 
http://www.boost.org/more/separate_compilation.html#static_or_dynamic
 
Preventing Compiler ABI Clashes
There are some compilers (mostly Microsoft Windows compilers again!), which feature a range of compiler switches that alter the ABI of C++ classes and functions. By way of example, consider Borland's compiler which has the following options:-b    (on or off - effects enum sizes).
-Vx   (on or off - empty members).
-Ve   (on or off - empty base classes).
-aX   (alignment - 5 options).
-pX   (Calling convention - 4 options).
-VmX  (member pointer size and layout - 5 options).
-VC   (on or off, changes name mangling).
-Vl   (on or off, changes struct layout). 

 
These options are provided in addition to those affecting which runtime library is used (more on which later); the total number of combinations of options can be obtained by multiplying together the individual options above, so that gives 2*2*2*5*4*5*2*2 = 3200 combinations! 
 
The problem is that users often expect to be able to build the Boost libraries and then just link to them and have everything just plain work, no matter what their project settings are. Irrespective of whether this is a reasonable expectation or not, without some means of managing this issue, the user may well find that their program will experience strange and hard to track down crashes at runtime unless the library they link to was built with the same options as their project (changes to the default alignment setting are a prime culprit). One way to manage this is with "prefix and suffix" headers: these headers invoke compiler specific #pragma directives to instruct the compiler that whatever code follows was built (or is to be built) with a specific set of compiler ABI settings.
 
....
 
For example the regex libraries get named as follows when built with Visual Studio .NET 2003:boost_regex-vc71-mt-1_31.lib
boost_regex-vc71-mt-gd-1_31.lib
libboost_regex-vc71-mt-1_31.lib
libboost_regex-vc71-mt-gd-1_31.lib
libboost_regex-vc71-mt-s-1_31.lib
libboost_regex-vc71-mt-sgd-1_31.lib
libboost_regex-vc71-s-1_31.lib
libboost_regex-vc71-sgd-1_31.lib

The difficulty now is selecting which of these the user should link his or her code to.
_________________________________________________________________
Shed those extra pounds with MSN and The Biggest Loser!
http://biggestloser.msn.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20080123/fe4dbd96/attachment-0001.html>


More information about the M3devel mailing list