public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: [Bug binutils/31527] gdb is not working for UNC path
       [not found] ` <bug-31527-70-PyzTwmzlum@http.sourceware.org/bugzilla/>
@ 2024-04-09 15:29   ` Kévin Le Gouguec
  0 siblings, 0 replies; only message in thread
From: Kévin Le Gouguec @ 2024-04-09 15:29 UTC (permalink / raw)
  To: binutils; +Cc: Zhiqing Xiong, Nick Clifton, Simon Cook

Heya!  Bringing this to the list, since the PR in the subject line is
marked "RESOLVED".  Let me know if there is a better way to follow-up.

In a nutshell, since:

  2024-04-05 "Add support for Windows network paths to the UNC support
  in _bfd_real_open()." (eac88f32984)

Building GDB on Windows fails at link-time with:

  […]x86_64-w64-mingw32/bin/ld.exe: ../bfd/.libs/libbfd.a(bfdio.o):bfdio.c:(.text+0x30b): undefined reference to `__imp_PathIsNetworkPathA'
  collect2.exe: error: ld returned 1 exit status

AFAIU this depends on the specifics of the Python configuration picked
up by the configurey; see Simon's analysis and suggested solutions
below.

"simon.cook at embecosm dot com" <sourceware-bugzilla@sourceware.org>
writes:

> https://sourceware.org/bugzilla/show_bug.cgi?id=31527
>
> --- Comment #8 from Simon Cook <simon.cook at embecosm dot com> ---
> The definition is there (I have the header file), this was a linking issue (and
> to confirm we are using the same tools to build).
>
> I've looked through the Makefile/config.status files for my build, and what
> seems to be going on is you're able to build GDB because you're building
> against the python in that environment, and that requires pulling in the
> shlwapi library:
>
>   S["PYTHON_LIBS"]="-lpython3.11 -lversion -lshlwapi -lpathcch -lbcrypt -lm
> -Wl,--stack,2000000"
>
> If I configure GDB without python support, then like gas and binutils the
> __imp_PathIsNetworkPathA symbol is not found.
>
> In order to resolve the link issue, I think there are a couple of solutions.
>
> 1. Always link anything using libbfd against shlwapi - that feels a bit
> intrusive for one small change?
> 2. Implement an alternative to using PathIsNetworkPathA. From its description,
> I think it might be possible to substitute that call for something like
> `is_network_path = strncmp(filename, "//", 2) == 0 || strncmp(filename, "\\\\",
> 2) == 0` since I think that's the behaviour we actually care about.
>
> Any thoughts?

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-09 15:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-31527-70@http.sourceware.org/bugzilla/>
     [not found] ` <bug-31527-70-PyzTwmzlum@http.sourceware.org/bugzilla/>
2024-04-09 15:29   ` [Bug binutils/31527] gdb is not working for UNC path Kévin Le Gouguec

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).