Ping. Steve Ellcey sell...@cavium.com
On Thu, 2017-08-31 at 10:24 -0700, Steve Ellcey wrote: > On Tue, 2017-08-29 at 12:25 +0100, Szabolcs Nagy wrote: > > > > > > in glibc the hwcap is not used, because it has accesses to > > cached dispatch info, but in libatomic using the hwcap > > argument is the right way. > Here is an updated version of the patch to allow aarch64 to use > ifuncs > in libatomic. > > The main difference from the last patch is that the library does not > access the hwcap value directly but accesses it through the ifunc > resolver argument. That means that we no longer need the > init_cpu_revision static constructor to set a flag that the resolver > checks, instead the resolver just does a comparision of its incoming > argument with HWCAP_ATOMICS. > > This did mean I had to change the prototype for the resolver > functions > in libatomic_i.h to have an argument, which is the way glibc calls > them. One complication of this is that the type of the argument can > differ between platforms and ABIs so I added code to configure.tgt to > set the type. I used uint64_t for aarch64 and 'long unsigned int' > for everything else. That is not correct for all platforms but at > this point no other platforms access the argument so it should not > matter. If and when platforms do need to access it they can change > the type if necessary. > > Steve Ellcey > sell...@cavium.com > > > 2017-08-31 Steve Ellcey <sell...@cavium.com> > > * Makefile.am (ARCH_AARCH64_LINUX_LSE): Add IFUNC_OPTIONS and > libatomic_la_LIBADD. > * config/linux/aarch64/host-config.h: New file. > * configure.ac (HWCAP_TYPE): Define. > (AC_CHECK_HEADERS): Check for sys/auxv.h. > (AC_CHECK_FUNCS): Check for getauxval. > (ARCH_AARCH64_LINUX_LSE): New conditional for IFUNC builds. > * configure.tgt (aarch64): Set AARCH and try_ifunc. > (aarch64*-*-linux*) Update config_path. > (aarch64*-*-linux*) Set HWCAP_TYPE. > * libatomic_i.h (GEN_SELECTOR): Add "HWCAP_TYPE hwcap" > argument. > * Makefile.in: Regenerate. > * auto-config.h.in: Regenerate. > * configure: Regenerate. >