This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Compile GLIBC without AVX support
- From: Florian Weimer <fweimer at redhat dot com>
- To: <marekzmyslowski at poczta dot onet dot pl>
- Cc: <libc-stable at sourceware dot org>, libc-help at sourceware dot org
- Date: Thu, 03 Jan 2019 14:05:21 +0100
- Subject: Re: Compile GLIBC without AVX support
- References: <001b01d4a363$2fa4db50$8eee91f0$@poczta.onet.pl>
* marekzmyslowski:
> I'm trying to compile the glibc 2.28 version without AVX support. However,
> whatever option I used, AVX files are still compiled and used.
> I need this to use gdb record/replay tool.
> Here is the configure command I used:
>
> ../configure --enable-mathvec=no --prefix=/work/bin libc_cv_asm_avx512=no
> libc_cv_asm_avx512dq=no libc_cv_cc_avx512=no libc_cv_cc_sse2avx=no
> --disable-avx2 --disable-avx512 --disable-avx-128-fma
>
> After make the result is following:
>
> root@d93e9cc876c3:/work/glibc/build# readelf -Ws libc.so | grep avx
> 1194: 0000000000000000 0 FILE LOCAL DEFAULT ABS
> strcasecmp_l-avx.os
> 1198: 0000000000000000 0 FILE LOCAL DEFAULT ABS strncase_l-avx.os
> 3257: 0000000000159070 337 FUNC LOCAL DEFAULT 13
> __memset_avx512_unaligned_erms
> 3272: 0000000000158a40 9 FUNC LOCAL DEFAULT 13
> __mempcpy_chk_avx512_unaligned
> 3276: 000000000014f1d0 1288 FUNC LOCAL DEFAULT 13 __strncmp_avx2
> .
GDB needs to communicate to the process that there is no AVX support, by
masking CPU flags. I don't know if GDB has implemented that. You may
have to use KVM or boot the system with a suitable clearcpuid argument
on the kernel command line. If you do that, you won't have to rebuild
glibc because glibc will automatically stop using AVX.
You can reduce AVX usage further by using --disable-multi-arch, but some
uses will remain if the CPU advertises support for AVX because there are
some corner cases where the dynamic linker needs to save and restore
AVX-related registers.
Thanks,
Florian