tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] [bootstrappable] Re: wip-full-source-bootstrap: from


From: Danny Milosavljevic
Subject: Re: [Tinycc-devel] [bootstrappable] Re: wip-full-source-bootstrap: from a 357-byte `hex0' to 'hello'
Date: Fri, 8 Jan 2021 14:43:47 +0100

Hi Janneke,

On Fri, 08 Jan 2021 07:25:52 +0100
Jan Nieuwenhuizen <janneke@gnu.org> wrote:

> > Alignment could be disabled on the CPU
> >
> >   
> > https://developer.arm.com/documentation/ddi0464/f/system-control/register-descriptions/system-control-register
> >
> > but I don't think EABI wants that.  
> 
> Hmm, what does this mean?  We are not really using EABI, or are we?

VFP is a floating point unit on ARM CPUs.  It has been designed to either
require aligned members and be fast, or not, depending on a CPU flag that
for example the kernel can set.

See also https://www.keil.com/support/man/docs/armcc/armcc_chr1359124231926.htm
for much more detail.

ARM is a famously mix-and-match CPU, so the client can choose whatever
they want.

If you choose aligned-only, you will get a bus error on misaligned access.
A single program really shouldn't be choosing--it's more the entire platform
doing the choosing.

EABI has standardized on particular settings, among which is required alignment.

<https://www.keil.com/support/man/docs/armcc/armcc_chr1359124228744.htm>

> So alignment should be fixed, but that's more work and you propose a
> workaround, right?  

No, I wanted to find out what's going on first.

Now that grischka commented and I looked up the malloc docs, I suggest
to fix mes libc's malloc to align what it gives back.  That's all--that
should fix everything.

We should provide maxalign_t to make it known to the user what the
malloc alignment we are using is.

Attachment: pgpCG9W45XVVa.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]