Re: AArch64 ILP32 strcmp bug

Keith Packard via Newlib <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
Richard Earnshaw <[email protected]> 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
signature.asc (application/pgp-signature, 832 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEw4O3eCVWE9/bQJ2R2yIaaQAAABEFAl/AkBcACgkQ2yIaaQAA
ABEoMw/7B9uW/fONDpcuS1QKh/ZKENAhWLtN7IAyVjze9t4P8uWn1+APlC1phTpf
vvc44EUtAOdh0veYJ6LzDpV2BN9LDCcJE5wzS4eDNcwuwEQ696FXEt0rv3BU5oVZ
ZBUh7ZhKfCUrba5q2/IFZrixo0U5DQnSNF9OsDLnYVyWpV2O0eiALX3dleCZiW09
ZfznK1Ge6pUoOtR3qPCBANmONxdjPAKySp7dbt7Yoh94nfK1ewSRLQX0G98epYiK
setXlPiOLxsrOe7M+EvXarq3BMJtx459B3IBfGy/frazlzJheAtxC6+FCO5I5zVP
aS8qtDIXXyOxxOqzTDf4xg9bY5GTgQBchhR287PWpWzVtrL1cgCKnGU81+ICEpRI
h3my1YM4oDMYm+2IXC4mr6djtaIVCXogISWJ8GV0L/tjG6fZbxJT+/M5AtqiKsQ4
xJC0vYZaeKAVxlxcnWlv2F9nogzDvHDtpajBTm0FoUUKX0wYTJaLxHAEvEfGp2C5
VCAqIKC9ko6yG+299bPMX+hSewmLQrDqBVB2HvMfGd2hx17uF+hyZQw1n/xQ4d5R
NcaFG1sK1o5woTYGolS8uJe3+9zdcHBhNnVoWn8HbEeOKWDAh39CDTKWiWkh0JPU
4TNYdRr2uSUdtJzh19F4a6P9Uk5+JIXDuIb1ykArjWRTbd9lOr8=
=zwQY
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.