Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com X-Authentication-Warning: hp2.xraylith.wisc.edu: khan owned process doing -bs Date: Mon, 13 Dec 1999 19:06:54 -0600 (CST) From: Mumit Khan To: cygwin users cc: Earnie Boyd Subject: Re: [GCC BUG] -I switch not functioning correctly. In-Reply-To: <19991213191842.A25705@cygnus.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 13 Dec 1999, Chris Faylor wrote: > I don't know if anyone has noticed that you may not need dllwrap as much > in the CD release. DJ added functionality to ld which should make it > a lot easier to build DLLs. Essentially you can say something like: > > ld -shared -o foo.dll --export-all-symbols foo.o bar.o Actually, there's a very good reason why I never brought this up -- it's because the --shared support in v1 ld has certain known problems that will generate lots of unnecessary bug reports. These problems have been fixed in the sourceware tree, but v1 was cut before that point. Try the following: /* v1-dll.c */ __attribute__((dllexport)) int foo; Now create the DLL. $ gcc -c v1-dll.c $ ld --shared -o v1-dll.dll v1-dll.o Cannot export foo: symbol wrong type (5 vs 3) ie., can't handle uninitialized commons. If you leave out the __attribute__((declspec)): /* v1-dll.c */ int foo; And use --export-all: $ gcc -c v1-dll.c $ ld --export --shared -o v1-dll.dll v1-dll.o Looks ok, but the dll doesn't export foo as expected and you get a runtime error. The problem has already been fixed, but not in v1. Search the binutils mailing list for "pe-dll". Patch submitted on 1999-06-25 and accepted on 1999-09-28. I believe there are a few other issues as well that have been fixed since (something about adding relocs to .exe that I vaguely remember running into while testing v1 after getting the CD). My suggestion is to use either (1) dllwrap, or (2) use ld/dlltool multiple times; (2) requires that you also remember to supply the correct entry point, which is automatically taken care of by dllwrap. Regards, Mumit -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com