> On Mar 29, 2015, at 2:27 AM, Roman Divacky <rdiva...@freebsd.org> wrote:
> 
>>> I used this script to build with gcc 4.9:
>>> 
>>> https://github.com/freebsd/freebsd-ci/blob/master/scripts/build/cross-build.sh
>>> 
>>> Buildling sys/i386/boot2 failed:
>> ...
>>> output: fmt=bin size=21ef text=200 data=1fef org=0 entry=0
>>> -1007 bytes available
>>> *** Error code 1
>> 
>> Oof, this is going to be hard to fix.  For some reason, boot2 is one of
>> those programs that keeps getting worse (i.e. larger) with *each* new
>> compiler version, be it gcc or clang!
>> 
>> The last few times when we imported a new clang version, we had to jump
>> through several hoops, and attempted to shrink the code again with
>> various cleanups.  Even then, we don't have a lot of headroom.
>> 
>> If it is now also becoming a problem with gcc 4.9, we should really
>> start looking for a more permanent solution, e.g.:
>> * Getting rid of the 7680 byte limit (seems to be impossible?)
>> * Rewrite most of (or all of) boot2 in assembly
> 
> We can also get rid of UFS1 support... That shrinks the code a lot.

No we can’t. And that’s kinda the useless decision to make if you look
at where the 8k limit comes from.

UFS1 imposes the 8k limit. UFS2 has no such limit, but there’s some
issues with some old installs listing 8k as the size to fit into the disklabel
reserves of the time.

If we built a UFS1-only boot2, that would fit in the 7.5k we have left
to play with. We could then build a UFS2-only boot2 that would easily
fit in the like 32k limit that UFS2 has.

The only reason we went to supporting both was to have something
universal. Since it requires a reformat to go from UFS1 -> UFS2 we
wanted the transition to be as smooth as possible so you didn’t have
to add boot blocks into the mix.

Now the only people that use UFS1 are people with really old systems
that are never going to upgrade, or people building new systems with
UFS1 because they are space constrained (for whatever reasons that
we’re not going to debate here: they are still real).

All typical installs are UFS2.

As such, with a bit of automation in our boot block writing, and we should
be in good shape.

So no, we can’t get rid of UFS1 support and have all our problems be
solved. However, we likely can solve most of the issues by moving away
from a single image.

Warner

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to