Re: [ITA] llvm

Takashi Yano via Cygwin-apps <[email protected]>
Newsgroups gmane.os.cygwin.applications
Message-ID <[email protected]>
On Thu, 17 Jul 2025 22:25:56 -0700 (PDT)
Jeremy Drake <[email protected]> wrote:

> 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 <[email protected]> wrote:
> > > >
> > > > > On Tue, 15 Jul 2025, Takashi Yano via Cygwin-apps wrote:
> > > > >
> > > > > > On Fri, 11 Jul 2025 16:16:09 -0700 (PDT)
> > > > > > Jeremy Drake <[email protected]> wrote:
> > > > > >
> > > > > > > On Fri, 11 Jul 2025, Takashi Yano via Cygwin-apps wrote:
> > > > > > >
> > > > > > > > BTW, I just realized we havent 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).

Oh, I see. I confirmed that if enabling that patch, gcc also can link
with win32 libs.

-- 
Takashi Yano <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.