mingw-w64 cross compiling

Christer Solskogen christer.solskogen@gmail.com
Wed Sep 19 08:39:00 GMT 2012


On 19/9/12 12:17 AM, Ian Lance Taylor wrote:
> On Tue, Sep 18, 2012 at 3:00 PM, Christer Solskogen
> <christer.solskogen@gmail.com> wrote:
>> On Tue, Sep 18, 2012 at 8:07 PM, Ian Lance Taylor <iant@google.com> wrote:
>>>> Today when trying to build trunk, I encountered this error. But has
>>>> not yet figured out how to fix it...
>>>
>>> I just committed a patch that should fix that problem.
>>>
>>> If there are other problems building libbacktrace, let me know.
>>>
>>
>> You wanna take this as well? :-)
>
> Not really....
>

Heh. But this will at least fix compiling a native gcc for mingw-w64:

--- /home/solskogen/source/gcc-trunk/gcc/cp/class.c     2012-09-19 
07:08:34.541126434 +0200
+++ gcc/gcc/cp/class.c  2012-09-19 10:02:24.768291368 +0200
@@ -7576,7 +7576,7 @@
    indented = maybe_indent_hierarchy (stream, indent, 0);
    fprintf (stream, "%s (0x%lx) ",
            type_as_string (BINFO_TYPE (binfo), TFF_PLAIN_IDENTIFIER),
-          (unsigned long) binfo);
+          (unsigned long) (uintptr_t) binfo);
    if (binfo != igo)
      {
        fprintf (stream, "alternative-path\n");
@@ -7601,7 +7601,7 @@
        fprintf (stream, " primary-for %s (0x%lx)",
                type_as_string (BINFO_TYPE (BINFO_INHERITANCE_CHAIN 
(binfo)),
                                TFF_PLAIN_IDENTIFIER),
-              (unsigned long)BINFO_INHERITANCE_CHAIN (binfo));
+              (unsigned long)(uintptr_t)BINFO_INHERITANCE_CHAIN (binfo));
      }
    if (BINFO_LOST_PRIMARY_P (binfo))
      {
@@ -7734,7 +7734,7 @@
        if (ctor_vtbl_p)
         {
           if (!BINFO_VIRTUAL_P (binfo))
-           fprintf (stream, " (0x%lx instance)", (unsigned long)binfo);
+           fprintf (stream, " (0x%lx instance)", (unsigned 
long)(uintptr_t)binfo);
           fprintf (stream, " in %s", type_as_string (t, 
TFF_PLAIN_IDENTIFIER));
         }
        fprintf (stream, "\n");
diff -Naur --exclude .svn 
/home/solskogen/source/gcc-trunk/gcc/ggc-common.c gcc/gcc/ggc-common.c
--- /home/solskogen/source/gcc-trunk/gcc/ggc-common.c   2012-09-19 
07:08:52.486136671 +0200
+++ gcc/gcc/ggc-common.c        2012-09-19 09:52:40.176368518 +0200
@@ -308,7 +308,7 @@
    enum gt_types_enum type;
  };

-#define POINTER_HASH(x) (hashval_t)((long)x >> 3)
+#define POINTER_HASH(x) (hashval_t)((uintptr_t)x >> 3)

  /* Register an object in the hash table.  */

diff -Naur --exclude .svn 
/home/solskogen/source/gcc-trunk/gcc/pointer-set.c gcc/gcc/pointer-set.c
--- /home/solskogen/source/gcc-trunk/gcc/pointer-set.c  2012-09-19 
07:06:07.140135274 +0200
+++ gcc/gcc/pointer-set.c       2012-09-19 09:54:32.308293421 +0200
@@ -64,7 +64,7 @@
  #endif
    const unsigned long shift = HOST_BITS_PER_LONG - logmax;

-  return ((A * (unsigned long) p) >> shift) & (max - 1);
+  return ((A * (uintptr_t) p) >> shift) & (max - 1);
  }

  /* Allocate an empty pointer set.  */
diff -Naur --exclude .svn 
/home/solskogen/source/gcc-trunk/gcc/print-tree.c gcc/gcc/print-tree.c
--- /home/solskogen/source/gcc-trunk/gcc/print-tree.c   2012-09-19 
07:08:52.528134157 +0200
+++ gcc/gcc/print-tree.c        2012-09-19 09:56:55.383303722 +0200
@@ -255,7 +255,7 @@
    /* Allow this function to be called if the table is not there.  */
    if (table)
      {
-      hash = ((unsigned long) node) % HASH_SIZE;
+      hash = ((uintptr_t) node) % HASH_SIZE;

        /* If node is in the table, just mention its address.  */
        for (b = table[hash]; b; b = b->next)
diff -Naur --exclude .svn /home/solskogen/source/gcc-trunk/gcc/REVISION 
gcc/gcc/REVISION
--- /home/solskogen/source/gcc-trunk/gcc/REVISION       2012-09-19 
08:08:46.905214325 +0200
+++ gcc/gcc/REVISION    1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-[trunk revision 191461]
diff -Naur --exclude .svn 
/home/solskogen/source/gcc-trunk/gcc/tree-dump.c gcc/gcc/tree-dump.c
--- /home/solskogen/source/gcc-trunk/gcc/tree-dump.c    2012-09-19 
07:06:06.857256504 +0200
+++ gcc/gcc/tree-dump.c 2012-09-19 09:58:22.256214114 +0200
@@ -168,7 +168,7 @@
  dump_pointer (dump_info_p di, const char *field, void *ptr)
  {
    dump_maybe_newline (di);
-  fprintf (di->stream, "%-4s: %-8lx ", field, (unsigned long) ptr);
+  fprintf (di->stream, "%-4s: %-8lx ", field, (uintptr_t) ptr);
    di->column += 15;
  }




More information about the Gcc-help mailing list