From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ciao.gmane.io (ciao.gmane.io [116.202.254.214]) by sourceware.org (Postfix) with ESMTPS id 7B2BB385801A for ; Fri, 18 Feb 2022 13:30:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7B2BB385801A Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1nL3Ku-0006bB-HZ for cygwin@cygwin.com; Fri, 18 Feb 2022 14:30:12 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: cygwin@cygwin.com From: Andrew Schulman Subject: Re: [PATCH] Fix optional variables in libargp Date: Fri, 18 Feb 2022 08:30:05 -0500 Message-ID: References: <000001ce7e08$2b866830$82933890$%fedin@samsung.com> <4q4ut8had25hqmo8b0752i8asuv6ism2qh@4ax.com> <002901ce7f0a$9da99420$d8fcbc60$%fedin@samsung.com> <002601ce82b7$63229580$2967c080$%fedin@samsung.com> <002a01ce86c6$ba32a190$2e97e4b0$%fedin@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Newsreader: Forte Agent 4.2/32.1118 X-Archive: encrypt X-Spam-Status: No, score=-3032.2 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Feb 2022 13:30:16 -0000 > Hello! > I have successfully tested it on i386. Really, just remove PREFIX > completely and it's okay. GetProcAddress() appears to be "clever" and adds > the leading underscope by itself on i386. I don't know what you did wrong > and why you could not reproduce the solution. > However, i have one idea. After patching libargp you need to recompile your > test case. Because it needs to pick up __declspec(dllexport). Yes, I recompiled my example after rebuilding and reinstalling libargp. It still doesn't work. I even rebooted too, to make sure I was using the newly installed cygargp-0.dll and not a cached version. I don't know why this should work for you, and not for me. I'm attaching here the revised patch of yours with PREFIX removed, and the argp-ex2.c source file that I'm building. Using this patch, I rebuild and reinstall libargp. Then I get $ gcc -o argp-ex2 argp-ex2.c -largp $ ./argp-ex2.exe --help Usage: argp-ex2 [OPTION...] Argp example #2 -- a pretty minimal program using argp -?, --help give this help list --usage give a short usage message Note there's no --version option or bug reporting email address. Do you get a different result?