public inbox for libc-stable@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: <marekzmyslowski@poczta.onet.pl>
Cc: <libc-stable@sourceware.org>, libc-help@sourceware.org
Subject: Re: Compile GLIBC without AVX support
Date: Tue, 01 Jan 2019 00:00:00 -0000	[thread overview]
Message-ID: <87k1jlvqlq.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <001b01d4a363$2fa4db50$8eee91f0$@poczta.onet.pl>	(marekzmyslowski's message of "Thu, 3 Jan 2019 13:52:28 +0100")

* 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

  reply	other threads:[~2019-01-03 13:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-01  0:00 marekzmyslowski
2019-01-01  0:00 ` Florian Weimer [this message]
2019-01-01  0:00   ` marekzmyslowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k1jlvqlq.fsf@oldenburg2.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-help@sourceware.org \
    --cc=libc-stable@sourceware.org \
    --cc=marekzmyslowski@poczta.onet.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).