Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Nov 2020 18:40:27 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Shawn Webb <shawn.webb@hardenedbsd.org>
Cc:        Ed Maste <emaste@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>, svn-src-head <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r367304 - in head: share/man/man5 share/mk tools/build/options usr.bin usr.bin/clang usr.bin/clang/llvm-cxxfilt
Message-ID:  <9AE259A8-F497-486E-94E0-07E1CA2C2BD7@FreeBSD.org>
In-Reply-To: <20201104163811.2waowgqzarpr3asr@mutt-hbsd>
References:  <202011031957.0A3JvSJ4038311@repo.freebsd.org> <CAPyFy2AfpZg-zL2YMtGC7M=GvgYBRK3bzX7=KKYTLdmLwMGHoQ@mail.gmail.com> <20201104163811.2waowgqzarpr3asr@mutt-hbsd>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_689C94B6-26A4-41AB-AB46-FAC9243C4C3A
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

On 4 Nov 2020, at 17:38, Shawn Webb <shawn.webb@hardenedbsd.org> wrote:
>=20
> On Wed, Nov 04, 2020 at 11:26:51AM -0500, Ed Maste wrote:
>> On Tue, 3 Nov 2020 at 14:57, Dimitry Andric <dim@freebsd.org> wrote:
>>>=20
>>> Author: dim
>>> Date: Tue Nov  3 19:57:28 2020
>>> New Revision: 367304
>>> URL: https://svnweb.freebsd.org/changeset/base/367304
>>>=20
>>> Log:
>>>  Add WITH_LLVM_CXXFILT option to install llvm-cxxfilt as c++filt
>>=20
>> A previous argument against the LLVM versions of binutils =
replacements
>> is that they were excessively large, but this does not look like a
>> substantial problem here. LLVM's cxxfilt is indeed many times the =
size
>> of ELF Tool Chain's, but still small enough that for a tool chain
>> component it's not a concern, in my opinion.
>>=20
>> ELF Tool Chain:
>> $ size obj/c++filt
>>   text   data    bss     dec       hex   filename
>>  66966   1008   8400   76374   0x12a56   obj/c++filt
>>=20
>> LLVM:
>> $ size obj/llvm-cxxfilt
>>    text   data    bss      dec       hex   filename
>>  378138   1756   9165   389059   0x5efc3   obj/llvm-cxxfilt
>>=20
>> A remaining issue is that both nm and addr2line can also demangle C++ =
symbols.
>=20
> This brings a question: is there any guidance as to what FreeBSD
> considers "too large of a component" for a toolchain component (or any
> other various components, like src.git/stand)?

I think this guidance originates from the world of embedded systems,
where storage size is a more limiting factor than on recent desktop or
server class machines. On my desktops I won't care too much whether an
executable is 1M or 100MB, but on a small SD card things add up very
quickly!

That said, llvm-related tools such as llvm-ar or llvm-cxxfilt are pretty
big, mainly because all of them are written in C++ with a lot of
templates, and we link the llvm and clang .a files statically into them.

It would save some space to stuff all those library files into a shared
library, and link the tools against that, but the disadvantage is that
it will take a *lot* of memory and CPU time to link that (huge) shared
library. I experimented a little with that in the past, and it's very
difficult to make it work on 32-bit systems.

-Dimitry


--Apple-Mail=_689C94B6-26A4-41AB-AB46-FAC9243C4C3A
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.2

iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCX6LniwAKCRCwXqMKLiCW
o8gKAKCxbjEuJ990AqwplrupcNnlvDdPLgCg/yq3CATtsvZ1Loi3ddH2qoOimwU=
=PtyD
-----END PGP SIGNATURE-----

--Apple-Mail=_689C94B6-26A4-41AB-AB46-FAC9243C4C3A--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9AE259A8-F497-486E-94E0-07E1CA2C2BD7>