delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-apps/2001/11/07/15:26:21

Mailing-List: contact cygwin-apps-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-apps-owner AT sourceware DOT cygnus DOT com
List-Subscribe: <mailto:cygwin-apps-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-apps/>
List-Post: <mailto:cygwin-apps AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-apps-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/lists.html#faqs>
Delivered-To: mailing list cygwin-apps AT sources DOT redhat DOT com
Message-ID: <3BE998DF.82555DDE@ece.gatech.edu>
Date: Wed, 07 Nov 2001 15:26:07 -0500
From: Charles Wilson <cwilson AT ece DOT gatech DOT edu>
X-Mailer: Mozilla 4.7 [en] (X11; I; SunOS 5.8 sun4u)
X-Accept-Language: en
MIME-Version: 1.0
To: Corinna Vinschen <cygwin-apps AT cygwin DOT com>
Subject: Re: Did I find an error in the current binutils or what???
References: <20011107131736 DOT U2965 AT cygbert DOT vinschen DOT de> <3BE94852 DOT 8080303 AT ece DOT gatech DOT edu> <20011107163919 DOT Y2965 AT cygbert DOT vinschen DOT de> <3BE95990 DOT 2000308 AT ece DOT gatech DOT edu> <20011107175722 DOT A2965 AT cygbert DOT vinschen DOT de>
X-Virus-Scanned: by amavisd-milter (http://amavis.org/)

Corinna Vinschen wrote:
> 
> On Wed, Nov 07, 2001 at 10:56:00AM -0500, Charles Wilson wrote:
> > Corinna Vinschen wrote:
> >
> >
> > >>Except that the cygwin1.dll/libcygwin.a that you are linking against does
> > >>not have the requisite auto-import support thunks (_nm__*).  Perhaps this
> > >>cygwin was compiled using a (very) old binutils?  pre-20010802 ?
> > >>
> > >
> > > Yes.  It has been cross-compiled on a Linux box.  The binutils are...
> > > uhm... compiled on 2001-07-12 so they are definitely pre-20010802.
> > > Somehow I don't understand how that stuff is supposed to work.  I'm
> > > not a binutils expert...
> >
> >
> > Okay, then I'm gonna assume that you are linking against a kernel that you
> > built yourself, and not the "official" cygwin kernel that cgf built
> > (otherwise, the following applies to him):
> >
> > You ought rebuild your cross-binutils from the binutils-20011002-1-src as
> > distributed from the cygwin mirrors.
> >
> > Recent binutils (post-20010802) add special autoimport-support thunks to
> > the dll's that they create.  These are used to create a lookup table for
> > the variable exports, by fooling the windows runtime loader.  (I don't
> > understand the whole thing, but it's a neat concept.)
> >
> > Anyway, the *DLL* as well as your client app need to be built using a
> > recent binutils, in order for the auto-import thing to work properly.
> 
> Thanks, that helped.  I have build and installed binutils-20011002-1
> for cross-building cygwin binaries on my Linux box.  Now the message
> 
> Warning: resolving ___progname by linking to __imp____progname (auto-import)
> 
> is written to stderr and the link stage is successfully completed.
> 
> > Of course, with the cygwin1.dll, auto-import shouldn't be necessary.
> > __progname *ought* to be declared (with appropriate __declspec() markings)
> > in some header file somewhere, so that's a cygwin bug.
> 
> Which is kinda mess since there's even no header on Linux which
> defines __progname.  Is there _any_ standard on where to define
> __progname?

Hmm...it looks like __progname is a BSDism -- and I saw stuff where THEY
were complaining that it wasn't declared in system headers.  Apparently,
the "standard" is to declare "extern char * __progname" in your own code
-- which makes portable __declspec'ing difficult, unless we do something
ugly like:

#ifdef CYGWIN
extern __declspec(dllimport) char * __progname;
#else
extern char * __progname;
#fi

in all client code that wants __progname.  Or, just make sure folks use
new compilers and live with the "warning" about auto-import.

--Chuck

- Raw text -


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