From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 51C1838708F9; Mon, 15 Jun 2020 14:41:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 51C1838708F9 From: "markus.boeck02 at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug compile/26117] New: Link failure on windows due to invalid library order Date: Mon, 15 Jun 2020 14:41:15 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: compile X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: markus.boeck02 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 14:41:15 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26117 Bug ID: 26117 Summary: Link failure on windows due to invalid library order Product: gdb Version: HEAD Status: UNCONFIRMED Severity: normal Priority: P2 Component: compile Assignee: unassigned at sourceware dot org Reporter: markus.boeck02 at gmail dot com Target Milestone: --- Linking gdb currently yields following linker error when compiling with x86_64-w64-mingw32-gcc: /mnt/c/GCC-Build/NewestLinux/lib/gcc/x86_64-w64-mingw32/10/../../../../x86_= 64-w64-mingw32/bin/ld: ../gnulib/import/libgnu.a(inet_ntop.o): in function `rpl_inet_ntop': C:/GDB-Build/binutils-gdb/build/gnulib/import/../../../gnulib/import/inet_n= top.c:58: undefined reference to `__imp_inet_ntop' The symbol __imp_inet_ntop is contained in ws2_32 which is correctly specif= ied on the command line to the linker but is specified in the wrong order for libgnu.a Excerpt from the linker command for gdb.exe: /mnt/c/GDB-Build/libexpat/expat/install/lib/libexpat.a -lws2_32 ../gnulib/import/libgnu.a -lstdc++ -lmingw32 -lgcc -lgcc_eh When putting -lws2_32 behind libgnu.a instead of in front the link succeeds. When using -fuse-ld=3Dlld (an order insensitive linker) the link also succe= eds. --=20 You are receiving this mail because: You are on the CC list for the bug.=