[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0eba31ea508f4ec491f56e3b8c85fb6c@AcuMS.aculab.com>
Date: Sun, 2 May 2021 11:35:19 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Adrian Bunk' <bunk@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
CC: Tom Stellard <tstellar@...hat.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Masahiro Yamada <masahiroy@...nel.org>,
"Nathan Chancellor" <nathan@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
clang-built-linux <clang-built-linux@...glegroups.com>,
Fangrui Song <maskray@...gle.com>,
Serge Guelton <sguelton@...hat.com>,
Sylvestre Ledru <sylvestre@...illa.com>
Subject: RE: Very slow clang kernel config ..
From: Adrian Bunk
> Sent: 02 May 2021 10:31
>
> On Sat, May 01, 2021 at 09:32:25AM -0700, Linus Torvalds wrote:
> >...
> > Yes, it can save on disk use, but unless it's some very core library
> > used by a lot of things (ie particularly things like GUI libraries
> > like gnome or Qt or similar), the disk savings are often not all that
> > big - and disk is cheap. And the memory savings are often actually
> > negative (again, unless it's some big library that is typically used
> > by lots of different programs at the same time).
> >...
> > I think people have this incorrect picture that "shared libraries are
> > inherently good". They really really aren't. They cause a lot of
> > problems, and the advantage really should always be weighed against
> > those (big) disadvantages.
> >...
>
> Disk and memory usage is not the biggest advantage.
>
> The biggest advantage of shared libraries is that they enable
> distributions to provide security fixes.
>
> Distributions try hard to have only one place to patch and one package
> to rebuild when a CVE has to be fixed.
>
> It is not feasible to rebuild all users of a library in a
> distribution every time a CVE gets published for a library.
Absolutely.
You'd also need to rebuild every application that might include
the static version of the broken function.
Good luck finding all those on a big install.
OTOH just splitting a compiler into multiple shared objects
that have no other use is, as Linus said, stupid.
Building shared libraries requires the same control as building
the kernel.
The user interface mustn't change.
You can add new functions, but not change any existing ones.
This is easy in C, difficult in C++.
Since PLT lookups can only handle code, you really don't want
data areas shared between the program and library.
If the size ever changes 'horrid things (tm)' happen.
We compile any shared libraries with -fvisibility=hidden and
mark any entry points with __attribute__((visibility("protected"))).
This means that calls with a library are simple PC-relative
and only the entry points are visible outside.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists