This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Failure in building GFortran on Cygwin
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/