X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Fri, 30 Nov 2007 15:20:08 +0100
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Cc: fortran@gcc.gnu.org
Subject: Re: Failure in building GFortran on Cygwin
Message-ID: <20071130142008.GX30894@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com, fortran@gcc.gnu.org
Mail-Followup-To: cygwin@cygwin.com, fortran@gcc.gnu.org
References: <Pine.CYG.4.58.0711292328360.1532@homepc> <474F61CD.1060405@verizon.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <474F61CD.1060405@verizon.net>
User-Agent: Mutt/1.5.16 (2007-06-09)
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

[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.

>From the name of the variable I assume that tzp is a `struct timezone'
variable.  Given that it's unused, and given that struct timezone is a
BSDism which isn't present in the POSIX standard(*), it might be a good
idea to just remove it entirely from the source or to keep it only when
the build target is a BSD system.

However, this *is* a problem in the newlib/cygwin headers.  Cygwin
exports a timezone function and a _timezone variable.  The timezone
function was an ill-advised invention in Cygwin way back in the last
century.  Unfortunately it has to be kept for backward compatibility.
Alas, we're stuck with the _timezone variable and we have to

  #define timezone _timezone

at one point in the headers.  The problem is that the above define
happens in a Cygwin specific header after the definition of `struct
timezone'.  So the usage of `struct timezone' in application code
results in a `struct _timezone', which is not defined and the above
error occurs.

AFAICS there are at least two ways to solve this problem, but I'm a bit
unsure right now, which is the better one.  Saty tuned.


Corinna


(*) gettimeofday's second parameter is void* in POSIX, see
    http://www.opengroup.org/onlinepubs/009695399/functions/gettimeofday.html

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
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/

--
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/

