This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] powerpc: Automatic CPU detection in preconfigure


On Wed, 8 Feb 2017, Tulio Magno Quites Machado Filho wrote:

> Added a check to detect the CPU value in preconfigure, so that glibc is
> built with the correct --with-cpu value.

I don't think setting submachine as you do here is appropriate; it will 
result in the logic that tried using -mcpu=$submachine being activated, 
which will override the compiler defaults you've just detected (e.g. 
result in -mcpu=476 being passed when the default is -mcpu=476fp, so 
wrongly changing the ABI to soft-float).

Ratherm you should append appropriately to the machine setting in cases 
where there are relevant sysdeps directories.  (Make sure this does 
achieve the desired effects regarding use of sysdeps/powerpc/power7 etc. 
directories not just those under powerpc64 or powerpc32.)

> +  { $as_echo "$as_me:${as_lineno-$LINENO}: --with-cpu not set. Trying to detect CPU." >&5
> +    $as_echo "$as_me: --with-cpu not set. Trying to detect CPU." >&6;}

This is using Autoconf internals.  If you want to send messages like that, 
don't hardcode details of Autoconf internals in a preconfigure script.  
Rather, move powerpc to using preconfigure.ac, and use the appropriate 
AC_* macros there.

> +  e500mc|e500mc64)
> +    submachine="e500"
> +    ;;

No, the e500 sysdeps directories are strictly for classic e500, not e500mc 
or e500mc64.

> +  a2|464|970|power*)
> +    submachine=${archcpu}

And you may want the power* logic to be smarter to map power10, power11 
etc. to power9 sysdeps directories until there are sysdeps directories for 
such future architecture variants.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]