On Fri, 18 Jul 2025, Takashi Yano via Cygwin-apps wrote:

> On Thu, 17 Jul 2025 22:06:40 -0700 (PDT)
> Jeremy Drake wrote:
> > On Fri, 18 Jul 2025, Takashi Yano via Cygwin-apps wrote:
> >
> > > On Thu, 17 Jul 2025 17:24:04 -0700 (PDT)
> > > Jeremy Drake <cyg...@jdrake.com> wrote:
> > >
> > > > On Tue, 15 Jul 2025, Takashi Yano via Cygwin-apps wrote:
> > > >
> > > > > On Fri, 11 Jul 2025 16:16:09 -0700 (PDT)
> > > > > Jeremy Drake <cyg...@jdrake.com> wrote:
> > > > >
> > > > > > On Fri, 11 Jul 2025, Takashi Yano via Cygwin-apps wrote:
> > > > > >
> > > > > > > BTW, I just realized we haven’t submitted the ITP for lld yet.
> > > > > > > Jeremy, would you like to do it? Or shall I do that?
> > > > > > > I'm asking because I did not contribute anything for lld.
> > > > > >
> > > > > > I sent something.  I was holding off because it can't be built yet 
> > > > > > until
> > > > > > llvm is updated.
> > > > >
> > > > > Thanks! I've updated the maintainer as folows.
> > > > > +clang                                        Jeremy Drake/Takashi 
> > > > > Yano
> > > > > +compiler-rt                                  Takashi Yano
> > > > > +libcxx                                       Takashi Yano
> > > > > +libcxxabi                                    Takashi Yano
> > > > > +libunwind                                    Takashi Yano
> > > > > +lld                                          Jeremy Drake
> > > > > +llvm                                         Jeremy Drake/Takashi 
> > > > > Yano
> > > > >
> > > > >
> > > >
> > > > I pushed the playground lld branch as master to lld.
> > >
> > > I tried lld in the master branch. clang can work with
> > > lld without -L/usr/lib/w32api. However, g++ cannot.
> > >
> > > $ clang++ -fuse-ld=lld hello.cc
> > > $ g++ -fuse-ld=lld hello.cc
> > > lld: error: unable to find library -ladvapi32
> > > lld: error: unable to find library -lshell32
> > > lld: error: unable to find library -luser32
> > > lld: error: unable to find library -lkernel32
> > > collect2: error: ld returned 1 exit status
> > > $
> > >
> > > Is this intentional behaviour?
> > >
> >
> > I think it is,
> > https://maskray.me/blog/2020-12-19-lld-and-gnu-linker-incompatibilities
> >
> > * Default library paths.
> >   * GNU ld has default library paths.
> >   * ld.lld doesn't. This is intentional so https://reviews.llvm.org/D70048
> > (NetBSD) cannot be accepted.
>
> My understandig is that the patch
>  0207-LLD-add-library-path-w32api.patch
> adds search path /usr/lib/w32api to embedded paths.
>
> So, without -L/usr/lib/w32api lld, can link them regardless
> of compiler (clang++ and g++) invoking lld. Right?

That patch ended up dropped from the PATCH_URI in the lld.cygport.  I
don't think it's safe both from the standpoint that it wouldn't respect
sysroot and that it's impossible to tell the difference between a mingw
and cygwin target from within LLD (the process triple is the host).

Reply via email to