From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13113 invoked by alias); 17 May 2010 01:58:04 -0000 Received: (qmail 13042 invoked by uid 22791); 17 May 2010 01:58:03 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 17 May 2010 01:57:58 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id B70CB2BAB5D; Sun, 16 May 2010 21:57:56 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id LuUP-8XI63F3; Sun, 16 May 2010 21:57:56 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id A564C2BAB44; Sun, 16 May 2010 21:57:55 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 6B0F8F58F9; Mon, 17 May 2010 03:57:52 +0200 (CEST) Date: Mon, 17 May 2010 02:08:00 -0000 From: Joel Brobecker To: Joel Sherrill Cc: Doug Evans , Tiemen Schut , "gdb-patches@sourceware.org" Subject: Re: [patch] sim/erc32/ max simulation time extended by using 64bit ints Message-ID: <20100517015752.GA24402@adacore.com> References: <4BD1BBE3020000520000FC62@pluto.sron.nl> <4BE08E95.5040500@oarcorp.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="xHFwDpU9dbj6ez1V" Content-Disposition: inline In-Reply-To: <4BE08E95.5040500@oarcorp.com> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-05/txt/msg00332.txt.bz2 --xHFwDpU9dbj6ez1V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1597 Hey guys, > Index: sim/erc32/sis.h > =================================================================== > RCS file: /cvs/src/src/sim/erc32/sis.h,v > retrieving revision 1.2 > diff -u -r1.2 sis.h > --- sim/erc32/sis.h 9 Jun 2002 15:45:46 -0000 1.2 > +++ sim/erc32/sis.h 4 May 2010 21:14:55 -0000 > @@ -23,6 +23,7 @@ > #include "ansidecl.h" > #include "gdb/callback.h" > #include "gdb/remote-sim.h" > +#include Unfortunately, this change breaks the build when stdint.h is not available (Eg. sparc-solaris). Apparently, this header was included for 2 things: - define two 64bit types int64 and uint64; - have UINT64_MAX. I assume that the requirement was for 64bit minimum, as opposed to exactly 64bit? Making that assumption, we can remove the need for including stdint.h by using long long instead of int64_t (same thing for the unsigned counterpart). Similarly, UINT64_MAX has a well defined value reguardless of the platform, so it can easily be defined as well. Looking at the rest of the type definitions above, it's actually in line with what's been done so far. Joel: Would that work for you as well? Doug: Would that be OK to commit? I think that the cleanest thing to do here would be to have some configury that would provide our own stdint.h when missing. We already do that for GDB by using gnulib so perhaps one way to do so would be to share the gnulib between GDB and the sim (probably meaning moving it to the root directory). PS: We have the same problem with rx sim, I believe. I haven't tried building it, though. -- Joel --xHFwDpU9dbj6ez1V Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="erc32-sim.diff" Content-length: 1115 Fix erc32 sim build failure due to missing stdint.h. 2010-05-16 Joel Brobecker * sis.h: Remove #include . (uint64, int64): Redefine without using stdint.h. (UINT64_MAX): Define. Modified: trunk/gdb/gdb-head/sim/erc32/sis.h =================================================================== --- trunk/gdb/gdb-head/sim/erc32/sis.h 2010-05-17 01:21:31 UTC (rev 163986) +++ trunk/gdb/gdb-head/sim/erc32/sis.h 2010-05-17 01:41:06 UTC (rev 163987) @@ -23,7 +23,6 @@ #include "ansidecl.h" #include "gdb/callback.h" #include "gdb/remote-sim.h" -#include #include "end.h" @@ -53,9 +52,11 @@ typedef double float64; /* 64-bit float */ /* FIXME: what about host compilers that don't support 64-bit ints? */ -typedef uint64_t uint64; /* 64-bit unsigned int */ -typedef int64_t int64; /* 64-bit signed int */ +typedef unsigned long long uint64; /* 64-bit unsigned int */ +typedef long long int64; /* 64-bit signed int */ +#define UINT64_MAX 18446744073709551615ULL + struct pstate { float64 fd[16]; /* FPU registers */ --xHFwDpU9dbj6ez1V--