[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-stable
Subject:    Re: Buserror when built on FreeBSD 10, not on FreeBSD 8
From:       Eivind Evensen <eivinde () terraplane ! org>
Date:       2015-02-07 18:24:13
Message-ID: 20150207182413.GA34637 () klump ! hjerdalen ! lokalnett
[Download RAW message or body]

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
_______________________________________________
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic