Date: Thu, 15 Sep 2016 06:51:45 +1000 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Emmanuel Vadot <manu@bidouilliste.com> Cc: Bruce Evans <brde@optusnet.com.au>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305814 - head/sys/boot/common Message-ID: <20160915063308.G2902@besplex.bde.org> In-Reply-To: <20160914220949.bfbd8562ec180ab690b84b60@bidouilliste.com> References: <201609141743.u8EHhX7R038840@repo.freebsd.org> <20160915042715.N2557@besplex.bde.org> <20160914220949.bfbd8562ec180ab690b84b60@bidouilliste.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 14 Sep 2016, Emmanuel Vadot wrote: > Bruce Evans <brde@optusnet.com.au> wrote: > >> On Wed, 14 Sep 2016, Emmanuel Vadot wrote: >> >>> Log: >>> ufsread: Do not cast struct direct from void * >>> This cause alignment problem on ARM (and possibly other archs), instead copy it. >>> ... >> >> This looks like a good pessimization for space. boot2 on i386 has to >> fit in 8192 bytes and has a negative number to spare (features are >> already left out). > > Do you have any suggestion on making the code better ? > This was the last patch for having EFI working on ARMv6 and this is > something that I want to be enabled by default at some point. At least copy to a local variable. Ifdefs for the space-constrained && non-strict-alignment arches work of course, but shouldn't be needed. You will have to investigate the -ffreestanding and builtin situation. -ffreestanding is set in 24 sub-Makefiles instead of correctly in 1 Makefile.inc. I think it applies to all of boot/i386. boot code almost never recovers from this using __builtin_*. Beware that some builtins just call an extern function which might not exist in boot code. Even memcpy barely exists in small boot2's. Some compilers have buggy -ffreestanding and call memcpy() for struct copying, so it is preferred to bcopy() in boot code. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160915063308.G2902>