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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: How to kill GNAT DLL initialization? Date: Fri, 12 Aug 2016 12:10:51 +0200 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: vZYCW951TbFitc4GdEwQJg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:31417 Date: 2016-08-12T12:10:51+02:00 List-Id: 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