[PATCH][Solaris] Add -lc also when linking shared libraries

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 7 09:07:41 PDT 2015


On Mon, Sep 7, 2015 at 7:18 AM, Xan López <xan at igalia.com> wrote:

> On Sat, Sep 05, 2015 at 12:28:43PM -0700, Saleem Abdulrasool wrote:
> > > Ping?
> > >
> >
> > Testcase?  Looks fine otherwise.
>
> Basically check that -lc is present when clang is called in a certain
> way I guess? Or something more sophisticated?


Yeah, that it is present when a DSO or executable is linked.


>
> Xan
>
> >
> >
> > > > From 8e81d6b095542c0ff1e28cf1f09d675f8afe1a25 Mon Sep 17 00:00:00
> 2001
> > > > From: =?UTF-8?q?Xan=20L=C3=B3pez?= <xan at igalia.com>
> > > > Date: Mon, 17 Aug 2015 16:04:26 +0200
> > > > Subject: [PATCH 4/4] [Solaris] Add -lc also when linking shared
> libraries
> > > >
> > > > This is actually needed, otherwise libc won't be added at all. For
> > > > instance when building libclang.so all the libc symbols won't be
> > > > found, with ld warning about libc being an "implicit dependency".
> > > > ---
> > > >  lib/Driver/Tools.cpp | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
> > > > index cf01d7b..2034c0f 100644
> > > > --- a/lib/Driver/Tools.cpp
> > > > +++ b/lib/Driver/Tools.cpp
> > > > @@ -6899,9 +6899,9 @@ void solaris::Linker::ConstructJob(Compilation
> &C,
> > > const JobAction &JA,
> > > >      if (getToolChain().getDriver().CCCIsCXX())
> > > >        getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
> > > >      CmdArgs.push_back("-lgcc_s");
> > > > +    CmdArgs.push_back("-lc");
> > > >      if (!Args.hasArg(options::OPT_shared)) {
> > > >        CmdArgs.push_back("-lgcc");
> > > > -      CmdArgs.push_back("-lc");
> > > >        CmdArgs.push_back("-lm");
> > > >      }
> > > >    }
> > > > --
> > > > 2.4.3
> > > >
> > >
> > > > _______________________________________________
> > > > cfe-commits mailing list
> > > > cfe-commits at lists.llvm.org
> > > > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> > >
> > > _______________________________________________
> > > cfe-commits mailing list
> > > cfe-commits at lists.llvm.org
> > > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> > >
> >
> >
> >
> > --
> > Saleem Abdulrasool
> > compnerd (at) compnerd (dot) org
>



-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150907/a5575bd4/attachment.html>


More information about the cfe-commits mailing list