This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/36834] structure return ABI for windows targets differs from native MSVC
- From: "mattias at virtutech dot se" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Mar 2009 17:16:41 -0000
- Subject: [Bug target/36834] structure return ABI for windows targets differs from native MSVC
- References: <bug-36834-4066@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from mattias at virtutech dot se 2009-03-20 17:16 -------
The proposed patch works for plain C code, but also affects C++. Since
libstdc++ contains code that returns aggregates or calls code that does,
-mms-aggregate-return will make the generated code incompatible with the C++
library. This makes it impossible to write C++ code that links (as a DLL) to
code compiled with Microsoft or Intel compilers, even if the interface is in
plain C.
We are exactly in this situation. We will have to build libstdc++ with
-mms-aggregate-return, but that option would then become mandatory for all C++
code. Things would be easier if the option were on by default - we can do this
for our build locally, of course, but we'd rather not diverge too much from the
standard behaviour.
An alternative would be to make the option only affect C (including extern "C"
in C++), as other languages are not subject to compatibility with MS compilers.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36834