public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug compile/26117] New: Link failure on windows due to invalid library order
@ 2020-06-15 14:41 markus.boeck02 at gmail dot com
  2020-06-15 15:01 ` [Bug compile/26117] " simark at simark dot ca
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: markus.boeck02 at gmail dot com @ 2020-06-15 14:41 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26117

            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_ntop.c:58:
undefined reference to `__imp_inet_ntop'

The symbol __imp_inet_ntop is contained in ws2_32 which is correctly specified
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=lld (an order insensitive linker) the link also succeeds.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-02 18:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-15 14:41 [Bug compile/26117] New: Link failure on windows due to invalid library order markus.boeck02 at gmail dot com
2020-06-15 15:01 ` [Bug compile/26117] " simark at simark dot ca
2020-06-15 15:51 ` [Bug build/26117] " keiths at redhat dot com
2022-12-02 18:32 ` tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).