Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Nov 2016 15:18:18 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Eugene Grosbein <eugen@grosbein.net>
Cc:        "freebsd-mips@freebsd.org" <freebsd-mips@freebsd.org>
Subject:   Re: MIPS code size strangeness
Message-ID:  <CANCZdfpMLQm58kuHkPzqfrw6Ks5jPK5YLb9mDnANYfWDXggcAQ@mail.gmail.com>
In-Reply-To: <5831E800.60003@grosbein.net>
References:  <5831E800.60003@grosbein.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Nov 20, 2016 at 11:14 AM, Eugene Grosbein <eugen@grosbein.net> wrote:
> Hi!
>
> I'm currently struggle trying to fit my FreeBSD 12/mips build into 8M flash available.
> It used to fit with early 11.0-CURRENT and it has over megabyte overhead with 12.0-CURRENT.
>
> Large parts are /usr/bin and /usr/lib and I've found something very strange.
> For example: /usr/lib/libprivateucl.so.1 has 136064 bytes for amd64
> and it has 241560 bytes for mips.
>
> "nm -C -D --print-size --size-sort libprivateucl.so.1" shows the symbol "ucl_hash_replace"
> has 330 bytes (0x14a) for amd64 and it has 25000 bytes (sic! 0x61a8) for mips.
>
> I understand that amd64 version is built with clang and MIPS code generated with gcc.
> But why such large difference? In no way such small function ucl_hash_replace()
> should expand to 25000 machine code bytes.
>
> I suspect other parts of code may have this problem too.

Keep in mind that FreeBSD uses clang for amd64, which is quite good at
code generation, while we still have to use an ancient version of gcc
for mips, which is known to produce kinda crappy code for mips. To
know for sure, you'll need to look at the code.

But since early 11-current, we haven't changed compilers. We've added
a lot to the base system, so we may need to prune more than you used
to need to do.

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfpMLQm58kuHkPzqfrw6Ks5jPK5YLb9mDnANYfWDXggcAQ>