X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Fri, 30 Nov 2007 07:01:19 -0800
From: Jerry DeLisle <jvdelisle@verizon.net>
Subject: Re: Failure in building GFortran on Cygwin
In-reply-to: <20071130142008.GX30894@calimero.vinschen.de>
To: cygwin@cygwin.com, fortran@gcc.gnu.org, corinna-cygwin@cygwin.com
Message-id: <475025BF.7020008@verizon.net>
MIME-version: 1.0
Content-type: text/plain; charset=ISO-8859-1; format=flowed
Content-transfer-encoding: 7bit
References: <Pine.CYG.4.58.0711292328360.1532@homepc>  <474F61CD.1060405@verizon.net> <20071130142008.GX30894@calimero.vinschen.de>
User-Agent: Thunderbird 2.0.0.9 (X11/20071115)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Corinna Vinschen wrote:
> [Forgot to CC the fortran list.  Re-sending...]
> 
> On Nov 29 17:05, Jerry DeLisle wrote:
>> Angelo Graziosi wrote:
>>> /tmp/gcc/libgfortran/intrinsics/system_clock.c: In function
>>> 'system_clock_4':
>>> /tmp/gcc/libgfortran/intrinsics/system_clock.c:67: error: storage size of
>>> 'tzp' isn't known
>>> /tmp/gcc/libgfortran/intrinsics/system_clock.c:67: warning: unused
>>> variable 'tzp'
>>> /tmp/gcc/libgfortran/intrinsics/system_clock.c: In function
>>> 'system_clock_8':
>>> /tmp/gcc/libgfortran/intrinsics/system_clock.c:130: error: storage size of
>>> 'tzp' isn't known
>>> /tmp/gcc/libgfortran/intrinsics/system_clock.c:130: warning: unused
>>> variable 'tzp'
>>> [...]
>>> The Cygwin version is 1.5.25-2 (exp.).
>> I can confirm this.  I saw it last wekend trying to do my regular cygwin 
>> build of gfortran for the wiki.  The build died and I assumed I did 
>> something wrong and was going to try back later.
>>
>> Well this is definitely a regression somewhere.  Its not on the gfortran 
>> side which has not touched that file for several months.  It could be 
>> something broke in the configure for cygwin.  The error occurs in a 
>> conditional comapile:
>>
>> #if defined(HAVE_SYS_TIME_H) && defined(HAVE_GETTIMEOFDAY)
>>
>> I will open a PR to track this.
> 
> A simple testcase would have been much more helpful.
> 

Here is code with the problem:  Not super simple, but I think you can follow it.

Thanks for hellp

void
system_clock_4(GFC_INTEGER_4 *count, GFC_INTEGER_4 *count_rate,
	       GFC_INTEGER_4 *count_max)
{
   GFC_INTEGER_4 cnt;
   GFC_INTEGER_4 rate;
   GFC_INTEGER_4 mx;

#if defined(HAVE_SYS_TIME_H) && defined(HAVE_GETTIMEOFDAY)
   struct timeval tp1;
   struct timezone tzp;

   if (sizeof (tp1.tv_sec) < sizeof (GFC_INTEGER_4))
     internal_error (NULL, "tv_sec too small");

   if (gettimeofday(&tp1, &tzp) == 0)
     {
       GFC_UINTEGER_4 ucnt = (GFC_UINTEGER_4) tp1.tv_sec * TCK;
       ucnt += (tp1.tv_usec + 500000 / TCK) / (1000000 / TCK);
       if (ucnt > GFC_INTEGER_4_HUGE)
	cnt = ucnt - GFC_INTEGER_4_HUGE - 1;
       else
	cnt = ucnt;
       rate = TCK;
       mx = GFC_INTEGER_4_HUGE;
     }
   else
     {
       if (count != NULL)
	*count = - GFC_INTEGER_4_HUGE;
       if (count_rate != NULL)
	*count_rate = 0;
       if (count_max != NULL)
	*count_max = 0;
       return;
     }
#elif defined(HAVE_TIME_H)
   GFC_UINTEGER_4 ucnt;

   if (sizeof (time_t) < sizeof (GFC_INTEGER_4))
     internal_error (NULL, "time_t too small");

   ucnt = time (NULL);
   if (ucnt > GFC_INTEGER_4_HUGE)
     cnt = ucnt - GFC_INTEGER_4_HUGE - 1;
   else
     cnt = ucnt;
   mx = GFC_INTEGER_4_HUGE;
#else
   cnt = - GFC_INTEGER_4_HUGE;
   mx = 0;
#endif
   if (count != NULL)
     *count = cnt;
   if (count_rate != NULL)
     *count_rate = TCK;
   if (count_max != NULL)
     *count_max = mx;
}





--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

