This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] tunables: Add IFUNC selection and cache sizes
On Wed, Jun 21, 2017 at 12:28 AM, Andreas Schwab <schwab@suse.de> wrote:
> Fails to build on i586.
>
> https://build.opensuse.org/package/live_build_log/home:Andreas_Schwab:glibc/glibc/f/i586
>
> /home/abuild/rpmbuild/BUILD/glibc-2.25.90.20170621.g43e0ac24c8/cc-base/libc.a(dl-sysdep.o): In function `_dl_tunable_set_ifunc':
> /home/abuild/rpmbuild/BUILD/glibc-2.25.90.20170621.g43e0ac24c8/elf/../sysdeps/x86/cpu-tunables.c:313: undefined reference to `__memcmp_ia32'
> /home/abuild/rpmbuild/BUILD/glibc-2.25.90.20170621.g43e0ac24c8/elf/../sysdeps/x86/cpu-tunables.c:299: undefined reference to `__memcmp_ia32'
> /home/abuild/rpmbuild/BUILD/glibc-2.25.90.20170621.g43e0ac24c8/elf/../sysdeps/x86/cpu-tunables.c:292: undefined reference to `__memcmp_ia32'
> /home/abuild/rpmbuild/BUILD/glibc-2.25.90.20170621.g43e0ac24c8/elf/../sysdeps/x86/cpu-tunables.c:263: undefined reference to `__memcmp_ia32'
> /home/abuild/rpmbuild/BUILD/glibc-2.25.90.20170621.g43e0ac24c8/elf/../sysdeps/x86/cpu-tunables.c:244: undefined reference to `__memcmp_ia32'
> /home/abuild/rpmbuild/BUILD/glibc-2.25.90.20170621.g43e0ac24c8/cc-base/libc.a(dl-sysdep.o):/home/abuild/rpmbuild/BUILD/glibc-2.25.90.20170621.g43e0ac24c8/elf/../sysdeps/x86/cpu-tunables.c:246: more undefined references to `__memcmp_ia32' follow
> collect2: error: ld returned 1 exit status
> make[2]: *** [../Rules:224: /home/abuild/rpmbuild/BUILD/glibc-2.25.90.20170621.g43e0ac24c8/cc-base/elf/sln] Error 1
>
The problem is caused by:
--build=i586-suse-linux --host=i586-suse-linux --enable-multi-arch
which defines:
#define USE_MULTIARCH 1
But i586 doesn't support multiarch. This breaks codes which check
USE_MULTIARCH:
/* We can't use IFUNC memcmp nor strlen in init_cpu_features from libc.a
since IFUNC must be set up by init_cpu_features. */
# if defined USE_MULTIARCH && !defined SHARED
# ifdef __x86_64__
# define DEFAULT_MEMCMP __memcmp_sse2
# define DEFAULT_STRLEN __strlen_sse2
# else
# define DEFAULT_MEMCMP __memcmp_ia32
# define DEFAULT_STRLEN strlen
# endif
extern __typeof (memcmp) DEFAULT_MEMCMP;
extern __typeof (strlen) DEFAULT_STRLEN;
# else
# define DEFAULT_MEMCMP memcmp
# define DEFAULT_STRLEN strlen
# endif
The workaround is not configure glibc with --enable-multi-arch when it
isn't supported.
--
H.J.