This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Add ifunc memcpy and memmove for aarch64
Never mind. I fixed this by moving the definition of dl_platform_init
up earlier in the file. That, plus including cpu-features.c fixed the
build.
Steve
On Tue, 2017-01-24 at 11:34 -0800, Steve Ellcey wrote:
>
> 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