This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch]: Add -mmsvcrtd to LIBGCC_SPEC for mingw32
- From: David Fraser <davidf at sjsoft dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: earnie at users dot sourceforge dot net
- Date: Wed, 26 Feb 2003 10:44:02 +0200
- Subject: [Patch]: Add -mmsvcrtd to LIBGCC_SPEC for mingw32
Hi
This patch adds a -mmsvcrtd option which links with libmsvcrtd.a and
libmoldnamed.a rather than libmsvcrt.a and libmoldname.a
This uses the debugging version of Microsoft's Visual C Runtime rather
than the release version. libmsvcrtd.a and libmoldnamed.a were recently
added to mingw. It is useful for debugging programs to be able to link
with this library (and linking with both libmsvcrt.a and libmsvcrtd.a
produces errors).
Could this patch be applied to both the 3.3 branch and the trunk? It
only changes behaviour if a previously non-existent option is applied,
so shouldn't cause any problems. I have only attached the patch for the
trunk here, will attach the other if neccessary. I also have a patch for
cygwin.h if that is desired.
David
Changelog
2003-02-26 David Fraser <davidfraser at users dot sourceforge dot net>
* config/i386/mingw32.h (LIBGCC_SPEC): Add -mmsvcrtd option: libmsvcrt.a libmoldname.a -> libmoldnamed.a libmsvcrtd.a
Index: mingw32.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/i386/mingw32.h,v
retrieving revision 1.31
diff -c -3 -p -r1.31 mingw32.h
*** mingw32.h 15 Feb 2003 04:58:22 -0000 1.31
--- mingw32.h 26 Feb 2003 08:48:43 -0000
*************** Boston, MA 02111-1307, USA. */
*** 92,98 ****
/* Include in the mingw32 libraries with libgcc */
#undef LIBGCC_SPEC
#define LIBGCC_SPEC \
! "%{mthreads:-lmingwthrd} -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \
--- 92,100 ----
/* Include in the mingw32 libraries with libgcc */
#undef LIBGCC_SPEC
#define LIBGCC_SPEC \
! "%{mthreads:-lmingwthrd} -lmingw32 -lgcc \
! %{mmsvcrtd: -lmoldnamed} %{!mmsvcrtd: -lmoldname} -lmingwex \
! %{mmsvcrtd: -lmmsvcrtd} %{!mmsvcrtd: -lmsvcrt}"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \