From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dmta1017.nifty.com (mta-snd01010.nifty.com [106.153.227.42]) by sourceware.org (Postfix) with ESMTPS id 04EFC3858D33 for ; Mon, 17 Jul 2023 22:53:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 04EFC3858D33 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=nifty.ne.jp Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=nifty.ne.jp Received: from HP-Z230 by dmta1017.nifty.com with ESMTP id <20230717225310842.XSAZ.25676.HP-Z230@nifty.com>; Tue, 18 Jul 2023 07:53:10 +0900 Date: Tue, 18 Jul 2023 07:53:10 +0900 From: Takashi Yano To: cygwin@cygwin.com Cc: =?UTF-8?B?TcO8bWlu?= A. Subject: Re: linking multiple function from .lib to CYGWIN Message-Id: <20230718075310.c14f5d16e87e3fc3a07e05a4@nifty.ne.jp> In-Reply-To: References: X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, 14 Jul 2023 11:51:59 +0300 Mümin A. wrote: > Hi, > > I can only link one function at a time in a *msvc *built library but when I > use multiple functions in the CYGWIN > compiler, I got that error message. > > int main() > { > helloWorld2(); > return 0; > } > > That is compiled and linked successfully. > > int main() > { > helloWorld2(); > helloWorld3(); > return 0; > } > > That is compiled but linking throws a bug report. > > [ 50%] Linking CXX executable a.exe > /usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: > internal error: aborting at > /mnt/share/cygpkgs/binutils/binutils.x86_64/src/binutils-2.40/ld/ldlang.c:527 > in compare_section > /usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: > please report this bug Perhaps, this is a bug of gcc 11 which has been already fixed in gcc 12. Workaround is: Link .dll directly instead of linking .lib if your .lib is associated with a DLL. -- Takashi Yano