revised**2 x86_64-pc-mingw32 patch

Kai Tietz
Thu Mar 29 13:01:00 GMT 2007

Richard Henderson <> wrote on 28.03.2007 18:42:26:

> Add 
> near the end of i386.c.  The other i386 abis ignore the value
> of "named", so it won't affect them in any way, so we don't
> need to make this hook depend on TARGET_64BIT_MS_ABI.

Great, it works AFAICS fine ;)

I changed the c-pragma.c part to be more GNAT style compliant and add a 
test-case for "#pragma pop_macro" and "#pragma push_macro".
Also I added a patch to libiberty/strerror.c to be compilable with w64 
include headers.

New ChangeLog entries are:

2007-03-29  Richard Henderson  <>
            Kai Tietz  <>

        * gcc/ Add x86_64-*-mingw32* target.
        * gcc/ Ditto.
        * gcc/config.gcc: Ditto.
        * libgcc/ Add support for an x86_64-mingw* target.
        * gcc/doc/tm.texi: (HANDLE_PRAGMA_PUSH_POP_MACRO): Add new.
        * gcc/gthr-win32.h: (__gthread_key_create): Mark arg dtor as 
        * gcc/gthr-win32.c: (__gthread_key_create): Mark arg dtor as 
        * gcc/testsuite/gcc.dg/pragma-push_pop_macro.c: New test-case.
        * gcc/c-pragma.c (HANDLE_PRAGMA_PUSH_POP_MACRO): New.
          (handle_pragma_push_macro): New.
          (handle_pragma_pop_macro): New.
          (init_pragma): Add new pragma command.
          (def_pragma_macro): New type for macro pile.
          (macro_list): New static var for chain macro pile.
        * gcc/emutls.c: (__emutls_array): Change size to type pointer.
          (emutls_destroy): Changed to avoid "unsigned long int" cast.
          (__emutls_get_address): Ditto.
        * gcc/unwind-generic.h (_uleb128_t): Handle case 
          >= __SIZEOF_POINTER__.
          (_sleb128_t): Ditto.
        * gcc/config/i386/i386.h: Move and adjust comments.
          (TARGET_SUBTARGET64_DEFAULT): New macro default to zero.
          (TARGET_64BIT_MS_ABI): New macro default to zero.
          (call_used_regs): Adjustments for target.
        * gcc/config/i386/cygming.h: (DWARF2_DEBUGGING_INFO) for 
x86_64-mingw needs to be
            set to valued 1.
          (DWARF2_UNWIND_INFO): Likewise
          (PREFERRED_DEBUGGING_TYPE): for x86_64-mingw it needs to be set 
            as default.
          (DBX_REGISTER_NUMBER): Have to use dbx64_register_map for 
          (SIZE_TYPE): Needs to be "long long unsigned int" for 
          (PTRDIFF_TYPE): Needs to be "long long int" for x86_64-mingw.
          (POINTER_SIZE: Needs to be 64 for x86_64 mingw.
          (LONG_TYPE_SIZE): Force 32-bit for a long.
          (TARGET_SUBTARGET_DEFAULT): Defined proper for x86_64-mingw.
          (REGPARM_MAX): Likewise.
          (SSE_REGPARM_MAX): Likewise.
          (LONG_TYPE_SIZE): Likewise.
          (REG_PARM_STACK_SPACE): Likewise.
          (STACK_BOUNDARY): Likewise.
          (SUBTARGET_ATTRIBUTE_TABLE): Move comment outside of macro 
          (HANDLE_PRAGMA_PUSH_POP_MACRO): New macro
        * gcc/config/i386/ (allocate_stack): Merge 32-bit and 
64-bit support.
        * gcc/config/i386/ (x86_64_movabs_operand): Adjust 
for new target.
        * gcc/config/i386/cygwin.asm: Adjustments for target build of 
x86_64-mingw (and cygwin).
        * gcc/config/i386/i386elf.h: (TARGET_SUBTARGET_DEFAULT): Removed.
        * gcc/config/i386/unix.h: (TARGET_SUBTARGET_DEFAULT): Added.
        * gcc/config/i386/winnt.c: (i386_pe_mark_dllimport): 64-bit mode 
        * gcc/config/i386/i386.c: New calling convention and target 
          (ix86_GOT_alias_set): Make from gobal scope available.
        * gcc/config/i386/mingw32.h: Adjustments for target x86_64-mingw.
          (EXTRA_OS_CPP_BUILTINS): Added predefined macro 
_INTEGRAL_MAX_BITS with the value of
            bitsize of a pointer.
          (WIN64,_WIN64,__MINGW64__): New predefined macros for 
x86_64-mingw target
x86_64-mingw from
            different place.
        * gcc/config/i386/i386-protos.h: Proto for ix86_GOT_alias_set 
        * fixincludes/ Add x86_64-mingw target.
        * libstdc++-v3/include/bits/locale_facets.tcc: Fixed integer 
pointer mismatch.
        * libiberty/strerror.c: Ensure sys_nerr and sys_errlist is not 
used as macro version.

 i.A. Kai Tietz

  OneVision Software Entwicklungs GmbH & Co. KG
  Dr.-Leo-Ritter-Straße 9 - 93049 Regensburg
  Tel: +49.(0)941.78004.0 - Fax: +49.(0)941.78004.489 -
  Commerzbank Regensburg - BLZ 750 400 62 - Konto 6011050
  Handelsregister: HRA 6744, Amtsgericht Regensburg
  Komplementärin: OneVision Software Entwicklungs Verwaltungs GmbH
  Dr.-Leo-Ritter-Straße 9 – 93049 Regensburg
  Handelsregister: HRB 8932, Amtsgericht Regensburg - Geschäftsführer: 
Ulrike Döhler, Manuela Kluger

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: a.txt
URL: <>

More information about the Gcc-patches mailing list