From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.13.214.202 with SMTP id y193mr13648998ywd.19.1471078786385; Sat, 13 Aug 2016 01:59:46 -0700 (PDT) X-Received: by 10.157.41.230 with SMTP id g35mr923094otd.19.1471078786340; Sat, 13 Aug 2016 01:59:46 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!c52no8540510qte.1!news-out.google.com!d68ni26059ith.0!nntp.google.com!f6no9604780ith.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 13 Aug 2016 01:59:46 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2a02:1205:c68c:9d90:68ed:594a:acd7:f401; posting-account=Pm0FhgoAAAAiPscNT3etSZ15tHNZGXm_ NNTP-Posting-Host: 2a02:1205:c68c:9d90:68ed:594a:acd7:f401 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <4a0bfd30-3876-4700-9437-e58340114c9f@googlegroups.com> Subject: Re: How to kill GNAT DLL initialization? From: ahlan.marriott@gmail.com Injection-Date: Sat, 13 Aug 2016 08:59:46 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:31422 Date: 2016-08-13T01:59:46-07:00 List-Id: On Friday, 12 August 2016 12:11:30 UTC+2, Dmitry A. Kazakov wrote: > On 12/08/2016 09:56, ahlan.marriott@gmail.com wrote: > > > I can't help but feel that you are going about this the wrong way. > > I found the reason, in the project file the "-a" switch was specified > explicitly for default Binder switches. That overrode the effect of > > for Library_Auto_Init use "false"; > > > I don't think you should be trying to prevent initialisation. > > That is the only way because my DLL uses tasking. > > > If you succeed then your DLL probably won't work because things need to be initialised. > > My DLL interface calls to initialization from all exported operation. > > > We do all our PC programming in Ada. > > Unfortunately not everyone is so enlightened and so we have to produce DLLs for other departments to use. > > There are other reasons to use encapsulated libraries. GNU linker > performance becomes catastrophic with the number of libraries we have. > But I would prefer an ability to have accumulating library projects that > will produce single static or dynamic library out of multiple libraries. > Encapsulated GNAT run-time is not an issue to me. > > > The task restriction is normally where we trip over. So I suggest > > that you check very carefully where your tasks are being created. They can > > only be created as a result of being called by the DLL user not > > automatically by the DLL. > > That is a bug on GNAT's side, IMO. The problem is not only tasks but > also asynchronous select. If you have any, RTS will create an internal > task during initialization and so freeze. Possibly there are other cases > when Lock_RTS is called. It is Lock_RTS that causes freezing. > > -- > Regards, > Dmitry A. Kazakov > http://www.dmitry-kazakov.de Dear Dmitry, I am glad that you managed to solve your problem. Although I wonder what you are doing that requires you to disable the library auto init. We don't for any of our DLLs almost all of which create and use tasks although not from the dll_Main nor during elaboration. Bes wishes, Ahlan