diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 26e6d31fb990..64405d3505d1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2009-04-26 Kai Tietz + + * config/i386/mingw-w64.h (STANDARD_INCLUDE_DIR): + Redefine it to just use mingw/include. + (ASM_SPEC): Rules for -m32 and -m64. + (LINK_SPEC): Use Likewise. + (SPEC_32): New define. + (SPEC_64): Likewise. + (SUB_LINK_SPEC): Likewise. + (MULTILIB_DEFAULTS): New define. + * config/i386/t-mingw-w64 (MULTILIB_OPTIONS): + Add multilib options. + (MULTILIB_DIRNAMES): Likewise. + (MULTILIB_OSDIRNAMES): Likewise. + (LIBGCC): Likewise. + (INSTALL_LIBGCC): Likewise. + 2009-04-26 Joseph Myers PR c/39556 diff --git a/gcc/config/i386/mingw-w64.h b/gcc/config/i386/mingw-w64.h index 9a2b32e04eb2..458b4740a5d0 100644 --- a/gcc/config/i386/mingw-w64.h +++ b/gcc/config/i386/mingw-w64.h @@ -32,3 +32,38 @@ along with GCC; see the file COPYING3. If not see %{!shared:%{!mdll:%{municode:crt2u%O%s}}} \ %{pg:gcrt2%O%s} \ crtbegin.o%s" + +/* Use mingw/include for include. */ +#undef STANDARD_INCLUDE_DIR +#define STANDARD_INCLUDE_DIR "/mingw/include" + +/* Enable multilib. */ + +#undef ASM_SPEC +#define ASM_SPEC "%{v:-V} %{n} %{T} %{Ym,*} %{Yd,*} \ + %{Wa,*:%*} %{m32:--32} %{m64:--64}" + +#if TARGET_64BIT_DEFAULT +#define SPEC_32 "m32" +#define SPEC_64 "!m32" +#else +#define SPEC_32 "!m64" +#define SPEC_64 "m64" +#endif + +#define SUB_LINK_SPEC "%{" SPEC_64 ":-m i386pep} %{" SPEC_32 ":-m i386pe}" + +#if TARGET_64BIT_DEFAULT +#define MULTILIB_DEFAULTS { "m64" } +#else +#define MULTILIB_DEFAULTS { "m32" } +#endif + +#undef LINK_SPEC +#define LINK_SPEC SUB_LINK_SPEC "%{mwindows:--subsystem windows} \ + %{mconsole:--subsystem console} \ + %{shared: %{mdll: %eshared and mdll are not compatible}} \ + %{shared: --shared} %{mdll:--dll} \ + %{static:-Bstatic} %{!static:-Bdynamic} \ + %{shared|mdll: -e _DllMainCRTStartup@12 --enable-auto-image-base} \ + %(shared_libgcc_undefs)" diff --git a/gcc/config/i386/t-mingw-w64 b/gcc/config/i386/t-mingw-w64 index bfe15069c680..dbbe00a1d96c 100644 --- a/gcc/config/i386/t-mingw-w64 +++ b/gcc/config/i386/t-mingw-w64 @@ -1,5 +1,12 @@ # Match SYSTEM_INCLUDE_DIR NATIVE_SYSTEM_HEADER_DIR = /mingw/include +MULTILIB_OPTIONS = m64/m32 +MULTILIB_DIRNAMES = 64 32 +MULTILIB_OSDIRNAMES = ../lib64 ../lib32 + # MinGW-specific parts of LIB_SPEC SHLIB_LC = -lmingw32 -lmingwex -lmoldname -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib