[PATCH] Add ifunc memcpy and memmove for aarch64
Steve Ellcey
sellcey@caviumnetworks.com
Tue Jan 24 19:34:00 GMT 2017
On Tue, 2017-01-24 at 12:09 -0200, Adhemerval Zanella wrote:
> This branch in my personal repo [1] have a workable draft version for
> aarch64.  It contains 2 patches, one that implements the cpu-features.c
> for aarch64 and another one that actually uses it to implement the
> thundex ifunc.
>
> On the first patch I would like to remove the sysdeps/aarch64/ldsodefs.h and
> make only Linux specific, because of hwcap. I will try to cleanup this up
> later.
>
> [1] https://github.com/zatrazz/glibc/tree/master-aarch64-ifunc
Thanks Adhemerval,
That clears a lot of things up. Â One thing I noticed in your tree is
that you only call init_cpu_features from  __libc_start_main for the
static glibc. Â On x86 they also defined DL_PLATFORM_INIT to be a
routine that calls init_cpu_features for the dynamically loaded glibc.Â
I added this code to sysdeps/aarch64/dl-machine.h but when I added it I
got a build error. Â I am using the same prototype for dl_platform_init
that x86 has so I am not sure why I get this error.
Steve Ellcey
sellcey@caviumnetworks.com
diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-
machine.h
index 84b8aec..7f38a68 100644
--- a/sysdeps/aarch64/dl-machine.h
+++ b/sysdeps/aarch64/dl-machine.h
@@ -426,4 +426,20 @@ elf_machine_lazy_rel (struct link_map *map,
     _dl_reloc_bad_type (map, r_type, 1);
 }
Â
+#define DL_PLATFORM_INIT dl_platform_init ()
+
+static inline void __attribute__ ((unused))
+dl_platform_init (void)
+{
+Â Â if (GLRO(dl_platform) != NULL && *GLRO(dl_platform) == '\0')
+    /* Avoid an empty string which would disturb us.  */
+Â Â Â Â GLRO(dl_platform) = NULL;
+
+#ifdef SHARED
+Â Â /* init_cpu_features has been called early from __libc_start_main in
+     static executable.  */
+Â Â init_cpu_features (&GLRO(dl_aarch64_cpu_features));
+#endif
+}
+
 #endif
The error I get is:
In file included from dynamic-link.h:92:0,
                 from dl-conflict.c:59:
../sysdeps/aarch64/dl-machine.h: In function â_dl_resolve_conflictsâ:
../sysdeps/aarch64/dl-machine.h:432:1: error: invalid storage class for function âdl_platform_initâ
 dl_platform_init (void)
 ^~~~~~~~~~~~~~~~
../o-iterator.mk:9: recipe for target '/home/ubuntu/sellcey/glibc-ifunc-new/obj-glibc64/elf/dl-conflict.o' failed
make[2]: *** [/home/ubuntu/sellcey/glibc-ifunc-new/obj-glibc64/elf/dl-conflict.o] Error 1
More information about the Libc-alpha
mailing list