Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Dec 2015 10:00:13 -0700
From:      Ian Lepore <ian@freebsd.org>
To:        Mark Millard <markmi@dsl-only.net>, Warner Losh <imp@bsdimp.com>
Cc:        mat@FreeBSD.org, freebsd-arm <freebsd-arm@freebsd.org>, FreeBSD Toolchain <freebsd-toolchain@freebsd.org>
Subject:   Re: 11.0-CURRENT (r292413) on a rpi2b: arm-gnueabi-freebsd/bin/ar, _fseeko, and memset vs memory alignment (SCTRL bit[1]=1?): Explains the Bus error?
Message-ID:  <1451149213.25138.271.camel@freebsd.org>
In-Reply-To: <BBAAE33E-BD65-40A3-A0B3-F3346FC08112@dsl-only.net>
References:  <4CC6220D-72FB-45AD-AE70-5EB4EF0BCF5C@dsl-only.net> <DB75F0D6-86CB-4383-8653-6017C76729F9@dsl-only.net> <A338272B-982F-4E1F-B87D-1E33815EA212@dsl-only.net> <0D81C2CA-BF1C-4C14-B816-A8C5F68715B5@bsdimp.com> <51EB4AAB-BC81-4282-BA4D-D329C41D660B@dsl-only.net> <8B52074F-FDEF-4119-BB04-630F9BE9E6DB@bsdimp.com> <BBAAE33E-BD65-40A3-A0B3-F3346FC08112@dsl-only.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 2015-12-25 at 17:21 -0800, Mark Millard wrote:
> In my view "-mno-unaligned-access" is an even bigger hammer than I
> used. I find no clang statement about what its ABI consequences would
> be, unlike for what I did: What mix of more padding for alignment vs.
> more but smaller accesses? But as I remember I've seen "-mno
> -unaligned-access" in use in ports and the like so its consequences
> may be familiar material for some folks.
> 
> Absent any questions about ABI consequences "-mno-unaligned-access"
> does well mark the expected SCTLR bit[1] status, far better than what
> I did. Again: I was covering my ignorance while making any
> significant investigation/debugging as unlikely as I could.

After reading the docs more carefully, I think -mno-unaligned-access
isn't a bigger hammer, it's just a different tool that addresses a
different problem than the one you ran into, and it's one we need.  In
particular, it prevents alignment-required accesses to potentially
unaligned fields in a struct marked as 'packed', which is something we
rely on (it's why we mark some structs as packed).

-- Ian




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