delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/12/01/12:12:23

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Sat, 1 Dec 2007 18:11:56 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Failure in building GFortran on Cygwin
Message-ID: <20071201171156.GH30894@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <Pine DOT CYG DOT 4 DOT 58 DOT 0711292328360 DOT 1532 AT homepc> <474F61CD DOT 1060405 AT verizon DOT net> <20071130142008 DOT GX30894 AT calimero DOT vinschen DOT de> <47501D95 DOT 3030200 AT byu DOT net> <20071130145842 DOT GY30894 AT calimero DOT vinschen DOT de> <20071130213601 DOT GC24092 AT ednor DOT casa DOT cgf DOT cx> <20071201103155 DOT GZ30894 AT calimero DOT vinschen DOT de> <20071201161303 DOT GA13773 AT ednor DOT casa DOT cgf DOT cx>
MIME-Version: 1.0
In-Reply-To: <20071201161303.GA13773@ednor.casa.cgf.cx>
User-Agent: Mutt/1.5.16 (2007-06-09)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Dec  1 11:13, Christopher Faylor wrote:
> On Sat, Dec 01, 2007 at 11:31:55AM +0100, Corinna Vinschen wrote:
> >On Nov 30 16:36, Christopher Faylor wrote:
> >> But we do have a fairly transparent way of dealing with this problem which
> >> will allow any ancient apps to continue to work.  We used it for the transition
> >> from 32 -> 64 bit file I/O.
> >
> >Unfortunately it doesn't work for variables.  We can hide the timezone
> >function, but how do we alias timezone to _timezone in libcygwin.a?
> 
> Why do you say that?  It should just be a simple aliasing.

Because it doesn't work, AFAICS.  Actual aliasing in localtime.cc as in

  extern long timezone __attribute__ ((alias("_timezone")));

doesn't work because it breaks generating cygdll.a due to multiple
definitions of timezone, the function in times.cc, the variable in
localtime.cc.

Using the NEW_FUNCTIONS mechanism in Makefile.in doesn't work either.
Apply this patch:

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/Makefile.in,v
retrieving revision 1.202
diff -u -p -r1.202 Makefile.in
--- Makefile.in 1 Dec 2007 13:04:43 -0000       1.202
+++ Makefile.in 1 Dec 2007 17:01:32 -0000
@@ -214,7 +214,8 @@ NEW_FUNCTIONS:=regcomp posix_regcomp \
 	      stat _stat64 \
 	      telldir _telldir64 \
 	      tmpfile _tmpfile64 \
-	      truncate _truncate64
+	      truncate _truncate64 \
+	      timezone _timezone
 
 API_VER:=$(srcdir)/include/cygwin/version.h
 
Index: include/cygwin/time.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/include/cygwin/time.h,v
retrieving revision 1.7
diff -u -p -r1.7 time.h
--- include/cygwin/time.h       1 Dec 2007 13:49:45 -0000       1.7
+++ include/cygwin/time.h       1 Dec 2007 17:01:32 -0000
@@ -29,7 +29,7 @@ time_t __cdecl timegm (struct tm *);
 extern int daylight __asm__ ("__daylight");
 
 #ifndef __timezonefunc__
-extern long timezone __asm__ ("__timezone");
+extern long timezone;
 #endif
 #endif
 
When you build this application:

  #include <sys/time.h>

  int
  main ()
  {
    printf ("&timezone = %p\n", &timezone);
    printf ("&_timezone = %p\n", &_timezone);
    return 0;
  }

The result will be something like this:

  $ ./test-timezone
  &timezone = 0x401170
  &_timezone = 0x611942c0

So timezone is not the same as _timezone in the application and
only _timezone will be handled inside of Cygwin.

Am I missing something?


Corinna

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019