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: [RFC 2.0] Implementing hwcap2


On Thursday 28 March 2013 17:39:34 David Miller wrote:
> From: "Ryan S. Arnold" <ryan.arnold@gmail.com>
> Date: Thu, 28 Mar 2013 16:21:02 -0500
> 
> > On Thu, Mar 28, 2013 at 1:06 PM, Richard Henderson <rth@twiddle.net> 
wrote:
> >> On 03/28/2013 10:52 AM, Ryan Arnold wrote:
> >>> +++ b/sysdeps/s390/s390-32/multiarch/ifunc-resolve.c
> >>> @@ -19,6 +19,7 @@
> >>> 
> >>>  #include <unistd.h>
> >>>  #include <dl-procinfo.h>
> >>> 
> >>> +#include <stdint.h>
> >>> 
> >>>  #define STFLE_BITS_Z10  34 /* General instructions extension */
> >>>  #define STFLE_BITS_Z196 45 /* Distinct operands, pop ... */
> >>> 
> >>> @@ -38,7 +39,7 @@
> >>> 
> >>>    extern void *FUNC##_z10 attribute_hidden;                          \
> >>>    extern void *FUNC##_g5 attribute_hidden;                           \
> >>>    
> >>>                                                                       \
> >>> 
> >>> -  void *resolve_##FUNC (unsigned long int dl_hwcap)                  \
> >>> +  void *resolve_##FUNC (uint64_t dl_hwcap)                           \
> >> 
> >> This is an abi change for 32-bit big-endian systems.
> > 
> > A uint64_t hwcap is already the default storage type for hwcap for all
> > architectures.
> > 
> > From ldsodefs.h:
> >   /* Mask for hardware capabilities that are available.  */
> >   EXTERN uint64_t _dl_hwcap;
> > 
> > Am I not understanding what you mean by 'abi change'?  Can you throw
> > me a bone and describe a problematic use case where my suggestion
> > breaks something?
> 
> The function signature for ifunc resolvers are part of the ABI.
> 
> Because anyone wanting to use the hwcap bits passed into the ifunc
> resolver, inside or outside of glibc, have to know the type so they
> can interpret the argument properly.
> 
> This is not an interface used only inside of glibc, it's available for
> every piece of code out there that wants to use ifuncs.
> 
> So effectively you are changing the interface for all ifunc users
> outside of glibc, who expect an "unsigned long int" as the dl_hwcap
> argument rather than an uint64_t.

how ?  resolve_* are not exported symbols, and they're not in the header files.  
if you want to override memset (or another func glibc implements using ifunc), 
your own code doesn't have to be an ifunc to interpose the symbol.

on a related note, ifunc support for s390 is new to glibc-2.17 and 
binutils-2.23, although you need 2.23.2 for the detection to even work.  but 
that still won't help because the code doesn't assemble with that version due 
to using insns that are too new.  you need to use a recent binutils snapshot 
in order to build.

so even if the ABI changes for s390, i wouldn't sweat it too much considering 
no release today even can compile it :).
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


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