tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Trivial program size inflation



Le Sat, Jul 01, 2023 at 12:04:25PM -0700, Jason Thorpe a écrit :
> 
> > On Jul 1, 2023, at 8:20 AM, tlaronde%polynum.com@localhost wrote:
> > 
> > This is also what I meant by "static seems to be considered deprecated".
> 
> Honestly, I find the obsession with static linking hilariously quaint.  NetBSD already bends backwards to an extreme degree by ensuring that old version of *system calls* work correctly *in the kernel*.  Some other systems provide the ABI contract at the libc boundary, and let the libc <-> kernel interface be fluid (keep the compatibility stuff in user-space where it belongs!)

If it comes to this particular case, the binary format is ELF; and ELF
has an interpreter field; wouldn't it be possible to have versionned
ld_elf.so providing emulation?

> 
> Obviously this is not feasible to do with static binaries, and we have one platform that ONLY supports static, but for the rest, I honestly think we should officially deprecate static linking in the general case (obviously it has some uses in super-constrained environments, but in those cases we are often also using crunch?d binaries as well).

It is curious that you react this way in a thread where, you as others,
have had your jaw drop seeing the size of a literally do_nothing
executable. This was unseen precisely because few use static linking.

Dshared encourages "inflation".

Dshared is a way to hell---there is not only Windows DLLs Hell. Haven't
you never had a third party application, from pkgsrc, needing to be updated,
and because even trivial libraries of a few kilobytes are linked
dynamically, the thing considers that the previous version is not "good
enough"---while there is no API nor ABI change---and forces to upgrade it,
rendering all the other programs linked against the previous version not
executable (while dshared is advertized as allowing concurrent versions
of a same library, generally only one version is allowed, the other one
being desinstalled) forcing one to upgrade absolutely anything for, in fact, a
library that generally simply implements "Hello, world!"---but with a
ton of fat---?

Not to mention all the security problems implied by the searching
feature for an elf dshared with rpath so that without extra care one can
not be sure that what will be executed is what was expected.

Dshared is not exactly what I will call a panacea.

But as has written Henri Poincar\'e: "To believe everything or to doubt
about anything are two different ways of being equally superficial." (Tout
croire ou douter de tout sont deux façons différentes d'être également
superficiel.)

I sometimes use totally static; frequently use partially static hence
frequently use also partially dshared; and sometimes use totally
dshared.

There are uses for both static and dshared (if there was shared static,
I will also use this in some cases).
-- 
        Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
                     http://www.kergis.com/
                    http://kertex.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C


Home | Main Index | Thread Index | Old Index