delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/08/11/09:45:47

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Date: Wed, 11 Aug 2004 15:45:59 +0200
From: "Gerrit P. Haase" <gp AT familiehaase DOT de>
Reply-To: "Gerrit @ cygwin" <cygwin AT cygwin DOT com>
Organization: Esse keine toten Tiere
Message-ID: <315268953.20040811154559@familiehaase.de>
To: "Peter Ekberg" <peda AT axentia DOT se>
CC: cygwin AT cygwin DOT com
Subject: Re: Dynamic loading of cygwin dependent dlls
In-Reply-To: <90459864DAD67D43BDD3D517DEFC2F7D705B@axon.Axentia.local>
References: <90459864DAD67D43BDD3D517DEFC2F7D705B AT axon DOT Axentia DOT local>
MIME-Version: 1.0
X-IsSubscribed: yes

Hello Peter,


>> > Ah, now I see it. You have to be careful with your typing.
>> > pseudo_stubs.dll (with one s in the end) is the name that fails.
>> > Apparently both pseudo_stub.dll (no s) and psuedo_stubs.dll (bad
>> > spelling) work. And pseudo_stubss.dll (double s) definitely 
>> works, that
>> > I have tried myself.
>> 
>> You have checked what error 998 actually is?
>> 
>> #define ERROR_NOACCESS 998L

> Of course. I have also checked what might cause the error. See:
> http://support.microsoft.com/default.aspx?scid=kb;en-us;q196069

> I can also say that I have tried to use the pure Win32 LoadLibrary call
> on the resulting dlls, and the results are consistent with the dlopen
> results. My guess is that there is something wrong inside the dll, that
> causes a segfault during dlopen/LoadLibrary.

>> I cannot believe that it depends on the name of a DLL whether it can
>> be dlopened or not.

> Me neither, yet the name appears to be significant in some way.

Then it is a bug in dlltool or dllwrap and I wonder why this never was
fixed.

>>                      There must be another error with your test!
>> 
>> Consider this (with source from your first posting):
>> $ gcc -shared -o pseudo_stubs.dll foo.c
>> $ gcc -o load load.c
>> $ ./load
>> pseudo_stubs.dll        ok
>> foo.dll dlopen: Win32 error 126
>> $ cp pseudo_stubs.dll foo.dll
>> $ ./load
>> pseudo_stubs.dll        ok
>> foo.dll ok

> Hey, that doesn't explain anything. It's like answering someones awk bug
> report with "see, it works with sed, your test must be wrong". Apart
> from that, thanks for the example, the project now uses "gcc -shared"
> with apparent success. So for me, this problem is now academic.

That is what I wanted to achieve with this example.

> I'm not saying that it is the name of the dll that is causing the
> problem. If I build the dll as foo.dll with dlltool/dllwrap and rename
> it to pseudo_stubs.dll, pseudo_stubs.dll works. Also, if I build the dll
> as pseudo_stubs.dll and rename it foo.dll, foo.dll doesn't work.

> I'd say that there is some sort of problem in dlltool/dllwrap. Please
> enlighten me if I'm using them incorrectly.

Seems to be really a bug.

> Can someone also please say if they get error 998 for the example in the
> original post, or if that happens on my machine only.

Indeed I get the same error and it works if I use foo instead of
pseudo_stubs, maybe it is really the underscore?  Since the -shared
switch for gcc works pretty well and since then, dlltool and dllwrap
are kind of deprecated, it is up to you to figure out what is wrong
with dlltool/dllwrap and fix it if you really need it.


Gerrit
-- 
=^..^=



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