delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2023/07/17/18:53:33

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C8C343858431
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1689634411;
bh=tRUWBGPzyCCUBz1MnbGYQGJ80kZ1UrC5ixlrCCtSeaQ=;
h=Date:To:Cc:Subject:In-Reply-To:References:List-Id:
List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
From:Reply-To:From;
b=Ux/Gd2wKEkcwCgGLnK+sq6W1VgljEIjSQsL9tieOkW2cjwWEDspMS/9jQ/DRe4ozF
j6NEvmozSxL5JhaKYpFX+F08SmYog3zetqlyV0Gei2tmSRAiYxqXHd5CJlC9Fd0qeh
3Nk4tvzKSn9jSi6g5Vpci4oXgeGrYqllEvG0wjRs=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 04EFC3858D33
Date: Tue, 18 Jul 2023 07:53:10 +0900
To: cygwin AT cygwin DOT com
Cc: "=?UTF-8?B?TcO8bWlu?= A." <muminaydin06 AT gmail DOT com>
Subject: Re: linking multiple function from .lib to CYGWIN
Message-Id: <20230718075310.c14f5d16e87e3fc3a07e05a4@nifty.ne.jp>
In-Reply-To: <CAPxKPA479BGNumXfytnRwRi_Zbxy0dBxhsLH0G14yBfsdvn5WA@mail.gmail.com>
References: <CAPxKPA479BGNumXfytnRwRi_Zbxy0dBxhsLH0G14yBfsdvn5WA AT mail DOT gmail DOT com>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
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
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Takashi Yano via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 36HMrWxo032438

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 <takashi DOT yano AT nifty DOT ne DOT jp>

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019