Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Mar 2015 12:04:31 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Roman Divacky <rdivacky@FreeBSD.org>
Cc:        "freebsd-testing@freebsd.org" <freebsd-testing@freebsd.org>, FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, Dimitry Andric <dim@FreeBSD.org>
Subject:   Re: Fails to build sys/i386/boot2 with gcc 4.9
Message-ID:  <B6DB2849-2985-4658-AD13-E9E99E8BE731@bsdimp.com>
In-Reply-To: <20150329082734.GA13058@vlakno.cz>
References:  <CAG=rPVcXPMqifAJvg_-XNWrOUzDLya1UMWW5KMymymyayM25=w@mail.gmail.com> <20683705-0EBA-4B8F-A0CE-9C06B8003BBE@FreeBSD.org> <20150329082734.GA13058@vlakno.cz>

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

--Apple-Mail=_A96F48DD-9F5F-44DB-A5D1-2CE1502149AE
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8


> On Mar 29, 2015, at 2:27 AM, Roman Divacky <rdivacky@FreeBSD.org> =
wrote:
>=20
>>> I used this script to build with gcc 4.9:
>>>=20
>>> =
https://github.com/freebsd/freebsd-ci/blob/master/scripts/build/cross-buil=
d.sh
>>>=20
>>> Buildling sys/i386/boot2 failed:
>> ...
>>> output: fmt=3Dbin size=3D21ef text=3D200 data=3D1fef org=3D0 entry=3D0=

>>> -1007 bytes available
>>> *** Error code 1
>>=20
>> 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!
>>=20
>> 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.
>>=20
>> 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
>=20
> We can also get rid of UFS1 support... That shrinks the code a lot.

No we can=E2=80=99t. And that=E2=80=99s 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=E2=80=99s =
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=E2=80=99t =
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=E2=80=99re 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=E2=80=99t 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


--Apple-Mail=_A96F48DD-9F5F-44DB-A5D1-2CE1502149AE
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJVGD6vAAoJEGwc0Sh9sBEAOCUQANHGNvoPEMMT3AVpZ7X+SDlh
xGj3WEqn+HkGoGYrmaNuFuas21RgCAALK05q1WgJw1HGvYXsT0E4dFMEBQkY9G2k
veP+IqX4vJzcFnE4XpLRUr/59bAvOljHVNDVZ/qFLwVkE9VdrZS158r664QNFCC1
i++B4roNUE12Ew8vqYspei5nojEAg/PU6scUJXh5zpitmEyFOf+yYu4mPKeb0Nz/
j+cnj6NqYBc/Unfu7+GhFfhzAnDNqC3YaruZifxuZQH5cv3K94CE+nwg3YqLc0B2
vyUCi2wDR2rHwe9KOXmM9BDpDuM+1Qk32jZNOSjEeY3s3Ywgq5y20ZSm3BqXuipB
+TM+x+c2q0RGDouQbXlbr8HBRqseXdAPaS4hI7SzxC37Rmja4JixuXdO4NQJo8aT
aXRhpUHM0UBcZutAmwk4I5zpoReowax5vfl6ePbMYzA8VkcG/vKflDpCVPYm7A+v
bGKty/4hTwYg+5lDsYxLEGJiJReZeOmhU14v9kbqPlv6dXwX/a6+qg2wewSVG5D5
r5Iw64Alm7zBld00BzGsnU2aGZVBjf7FKSG4h7MNfjyMLp+QisdkJYFdqTELL8Pp
aQpfB/yGY0H6PZ/1JkaBMwAghbsD+gh2F6oIIV05VnQl20BW6KFnwVn5z5FHrYWw
384tREhodceyLacoeetv
=IwfO
-----END PGP SIGNATURE-----

--Apple-Mail=_A96F48DD-9F5F-44DB-A5D1-2CE1502149AE--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B6DB2849-2985-4658-AD13-E9E99E8BE731>