Buserror when built on FreeBSD 10, not on FreeBSD 8
Eivind Evensen
eivinde at terraplane.org
Sat Feb 7 19:14:16 UTC 2015
On Fri, Feb 06, 2015 at 02:43:24PM +0100, Pieter de Goeje wrote:
> Eivind Evensen schreef op 2015-02-05 om 14:36:
> >Hello.
> >
> >After upgrading from FreeBSD 8 to 10, I have a problem I don't
> >understand, hopefully somebody here knows what is happening.
> >
> >I have a project that uses both assembly and c. I started getting
> >bus errors after building on FreeBSD 10. I had, and may still have
> >some objects around from FreeBSD 8 and if I link those, on 10, they work.
> >I don't have any installations running 8 any longer though.
> >This is on amd64 platform.
>
> The problem is that the stack is not aligned to 16 bytes. Changing to
> the code to this:
>
> asmcode:
> sub rsp, 8
> call cagain
> add rsp, 8
> ret
>
> Fixes the problem. It's probably better to just push/pop rbp as that is
> only one byte per instruction,
> which will also align the stack for obvious reasons.
>
> I believe that gcc on FreeBSD 8 wasn't as strict as clang is on 10 now.
Thanks, this is very interesting. Apparently my thought that when I didn't
need the stack for anything myself, I shouldn't have to do anything to it
was wrong.
I appreciate the help.
--
Eivind
More information about the freebsd-stable
mailing list