[PATCH] powerpc: Better 32/64bit detection

Dmitry V. Levin ldv at altlinux.org
Fri Jul 12 14:44:24 UTC 2013


On Fri, Jul 12, 2013 at 12:27:30PM +0200, Denys Vlasenko wrote:
> On 07/11/2013 04:03 AM, Anton Blanchard wrote:
> > 
> > We were using uname to determine if userspace was 32 or 64bit.
> > This fails when we have a 64bit kernel and a 32bit userspace.
> > 
> > Similar to x86, use a runtime test to determine if we are 32 or 64bit.
> > 
> > Signed-off-by: Anton Blanchard <anton at samba.org>
> > ---
> > 
> > Index: strace-new/configure.ac
> > ===================================================================
> > --- strace-new.orig/configure.ac
> > +++ strace-new/configure.ac
> > @@ -54,7 +54,11 @@ alpha*)
> >  powerpc*)
> >  	arch=powerpc
> >  	AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
> > -	if test $host_cpu = powerpc64; then
> > +	AC_TRY_COMPILE(
> > +[#ifndef __LP64__
> > +# error 32 bit
> > +#endif], [], ppc_bits=64, ppc_bits=32)
> > +	if test "$ppc_bits" = "64"; then
> >  		AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.])
> >  	fi
> >  	;;
> 
> 
> I can't apply this - I am woefully uneducated about autoconf stuff.
> 
> Dmitry or somebody else needs to take a look.

Applied, thanks.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20130712/a54f2666/attachment.bin>


More information about the Strace-devel mailing list