public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Kévin Le Gouguec" <legouguec@adacore.com>
To: binutils@sourceware.org
Cc: Zhiqing Xiong <zhiqxion@qti.qualcomm.com>,
	Nick Clifton <nickc@redhat.com>,
	Simon Cook <simon.cook@embecosm.com>
Subject: Re: [Bug binutils/31527] gdb is not working for UNC path
Date: Tue, 09 Apr 2024 17:29:20 +0200	[thread overview]
Message-ID: <87sezuo8q7.fsf@adacore.com> (raw)
In-Reply-To: <bug-31527-70-PyzTwmzlum@http.sourceware.org/bugzilla/> (simon cook at embecosm dot com's message of "Tue, 09 Apr 2024 11:13:44 +0000")

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?

           reply	other threads:[~2024-04-09 15:29 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <bug-31527-70-PyzTwmzlum@http.sourceware.org/bugzilla/>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sezuo8q7.fsf@adacore.com \
    --to=legouguec@adacore.com \
    --cc=binutils@sourceware.org \
    --cc=nickc@redhat.com \
    --cc=simon.cook@embecosm.com \
    --cc=zhiqxion@qti.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).