X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,TW_XD,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Message-ID: <4BBD1953.4070703@users.sourceforge.net> Date: Wed, 07 Apr 2010 18:46:27 -0500 From: "Yaakov (Cygwin/X)" <yselkowitz AT users DOT sourceforge DOT net> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: weak symbols on Cygwin References: <4BBB31C6 DOT 7080703 AT redhat DOT com> <201004070141 DOT 36284 DOT bruno AT clisp DOT org> <4BBBF5C2 DOT 30102 AT gmail DOT com> <201004071106 DOT 11471 DOT bruno AT clisp DOT org> In-Reply-To: <201004071106.11471.bruno@clisp.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: <cygwin.cygwin.com> 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 On 2010-04-07 04:06, Bruno Haible wrote: > I was implicitly hoping that > - gcc would collect all weak-declared symbols in some table, and > generate code so that the reference to these symbols makes an indirection > through this table, > - the Cygwin runtime would call dlsym or GetProcAddress at startup and > fill in addresses into said table. This is essentially what FlexDLL[1] does, as used by OCaml to support shared stublibs and natdynlink modules on PE platforms. The major drawback to FlexDLL (besides being nearly impossible to understand because most of it is written in OCaml :-)) is that all link commands must be passed through its flexlink command. I suppose a possible solution would be to port flexlink to C as part of gcc (or ld?) and merge the flexdll_*() functionality into Cygwin. That would be way beyond me, however; I barely managed to learn enough about OCaml to add some patches[2] necessary for a Cygwin-native flexdll package for Ports. [1] http://alain.frisch.fr/flexdll.html [2] http://cygwin-ports.svn.sourceforge.net/viewvc/cygwin-ports/ports/trunk/devel/flexdll/ Yaakov Cygwin Ports -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple