Thursday, November 28, 2019

Re: SIGBUS on octeon for my program

On Thu, Nov 28, 2019 at 11:44:07PM -0700, Theo de Raadt wrote:
> Half the cpu platforms fault on unaligned access.
>
> There are strategies for handling this. Your code must use them.
>
> It is kind of boring, actually.

I took a look at how libasr does it, and I have similar code ie. pack8(),
pack16(), pack32(), I will just change all my functions, as unalignment
flags passed per -m aren't standard on every arch. I did use __packed on
structs already but the way libasr does is a great example I think.

It's a bit of work but the fact that this could work on architectures like
octeon make it worth it for me.

Thanks a lot!
-peter

No comments:

Post a Comment