From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8050 invoked by alias); 12 Jul 2013 14:18:11 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 7983 invoked by uid 89); 12 Jul 2013 14:18:06 -0000 X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.1 Received: from mailout4.w1.samsung.com (HELO mailout4.w1.samsung.com) (210.118.77.14) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 12 Jul 2013 14:18:04 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MPT001W1UDQBF90@mailout4.w1.samsung.com> for cygwin@cygwin.com; Fri, 12 Jul 2013 15:18:01 +0100 (BST) Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id B6.9D.07878.91010E15; Fri, 12 Jul 2013 15:18:01 +0100 (BST) Received: from fedinw7x64 ([106.109.9.113]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0MPT00L4ZUDZXN60@eusync2.samsung.com>; Fri, 12 Jul 2013 15:18:01 +0100 (BST) From: Fedin Pavel To: 'Andrew Schulman' Cc: cygwin@cygwin.com References: <000001ce7e08$2b866830$82933890$%fedin@samsung.com> <4q4ut8had25hqmo8b0752i8asuv6ism2qh@4ax.com> In-reply-to: <4q4ut8had25hqmo8b0752i8asuv6ism2qh@4ax.com> Subject: RE: libargp: argp_program_version does not work Date: Fri, 12 Jul 2013 14:52:00 -0000 Message-id: <002901ce7f0a$9da99420$d8fcbc60$%fedin@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-SW-Source: 2013-07/txt/msg00250.txt.bz2 Hello! > int main (int argc, char **argv) > { > argp_program_version = version; > argp_program_bug_address = bug_address; > > argp_parse (&argp, argc, argv, 0, 0, 0); } > > /*** End modified argp example #2 ***/ > > If you compile the above version, you'll see that the --version option > and bug tracker text are available. > > I'm sure this problem is familiar to developers and users of shared > libraries, but I had forgotten it. I'll add a note to the Cygwin > README file, to help all of us remember it next time. Yes, i know this. But looks like nobody actually follows your way, because under Linux simple redefinition perfectly works. Of course we could fix every program, but i have an idea how to make the original Linux code working: 1. Inside DLL we should rename this variables somehow 2. Inside libargp.a.dll we should have a constructor function (with __attribute__((constructor))) which assigns variables inside DLL with contents of argp_program_version and argp_program_bug_address. 3. Also inside libargp.a.dll we should have default definitions of these variables with NULL contents. This way code modification would not be required any more. I'll try to implement this when have more time. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- 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