public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Keith Packard <keithp@keithp.com>
To: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>,
	Joel Sherrill <joel.sherrill@gmail.com>
Cc: "newlib@sourceware.org" <newlib@sourceware.org>
Subject: Re: AArch64 ILP32 strcmp bug
Date: Thu, 26 Nov 2020 21:35:19 -0800	[thread overview]
Message-ID: <87eekfweeg.fsf@keithp.com> (raw)
In-Reply-To: <875238d8-613c-2d8e-6498-df1ead351b99@foss.arm.com>

[-- Attachment #1: Type: text/plain, Size: 1360 bytes --]

Richard Earnshaw <Richard.Earnshaw@foss.arm.com> writes:

> AFAICT gcc doesn't define __LP64__, so I don't think this will work;
> it's also backwards - you shouldn't assume that because __LP64__ isn't
> defined that we have a 32-bit pointer.  GCC does, however, define
> __ILP32__ when building for that ABI.

I borrowed that symbol from glibc; figuring it was better to use a
mechanism already in use elsewhere.

> The right way to do this is to create a new header file,
> machine/aarch64/machine/asm.h, which contains a gas macro called, lets
> say `ptr_param', that takes the *number* of register argument and is
> then conditionally defined to either nothing or an assembly statement
> that narrows the register with that number.  In the main function code
> you can then write simply
>
> 	ptr_param 0
>
> and avoid all conditional assembly in the main source files.

Yes, it would be good to see all of the asm code fixed up to work on
ilp32. For now, just getting setjmp/longjmp working and bypassing all of
the other aarch64 asm code on ilp32 will suffice to make the library
work. I've got an aarch64 toolchain with ilp32 support built. Figuring
out how to catch errors of this particular sort seems challenging
though; the bug report makes it clear that even the incorrect functions
work most of the time.

-- 
-keith

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2020-11-27  5:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20 13:52 Kinsey Moore
2020-11-25 11:28 ` Richard Earnshaw
2020-11-25 14:11   ` Joel Sherrill
2020-11-26 18:41     ` Keith Packard
2020-11-26 19:02       ` Richard Earnshaw
2020-11-27  5:35         ` Keith Packard [this message]
2020-11-25 17:31   ` Kinsey Moore
2020-11-26 17:46     ` Richard Earnshaw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eekfweeg.fsf@keithp.com \
    --to=keithp@keithp.com \
    --cc=Richard.Earnshaw@foss.arm.com \
    --cc=joel.sherrill@gmail.com \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).