From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 49426 invoked by alias); 3 Jan 2019 13:05:26 -0000 Mailing-List: contact libc-stable-help@sourceware.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: List-Archive: Sender: libc-stable-owner@sourceware.org Received: (qmail 49401 invoked by uid 89); 3 Jan 2019 13:05:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=no, H*Ad:U*libc-help, corner X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 03 Jan 2019 13:05:25 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D02AC13A60; Thu, 3 Jan 2019 13:05:23 +0000 (UTC) Received: from oldenburg2.str.redhat.com (dhcp-192-219.str.redhat.com [10.33.192.219]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D341C60BEC; Thu, 3 Jan 2019 13:05:22 +0000 (UTC) From: Florian Weimer To: Cc: , libc-help@sourceware.org Subject: Re: Compile GLIBC without AVX support References: <001b01d4a363$2fa4db50$8eee91f0$@poczta.onet.pl> Date: Tue, 01 Jan 2019 00:00:00 -0000 In-Reply-To: <001b01d4a363$2fa4db50$8eee91f0$@poczta.onet.pl> (marekzmyslowski's message of "Thu, 3 Jan 2019 13:52:28 +0100") Message-ID: <87k1jlvqlq.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 03 Jan 2019 13:05:23 +0000 (UTC) X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00009.txt.bz2 * 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.=20 > I need this to use gdb record/replay tool. > Here is the configure command I used: > > ../configure --enable-mathvec=3Dno --prefix=3D/work/bin libc_cv_asm_avx51= 2=3Dno > libc_cv_asm_avx512dq=3Dno libc_cv_cc_avx512=3Dno=C2=A0 libc_cv_cc_sse2avx= =3Dno > --disable-avx2=C2=A0 --disable-avx512 --disable-avx-128-fma > > After make the result is following: > > root@d93e9cc876c3:/work/glibc/build# readelf -Ws libc.so | grep avx > =C2=A0 1194: 0000000000000000=C2=A0=C2=A0=C2=A0=C2=A0 0 FILE=C2=A0=C2=A0= =C2=A0 LOCAL=C2=A0 DEFAULT=C2=A0 ABS > strcasecmp_l-avx.os > =C2=A0 1198: 0000000000000000 =C2=A0=C2=A0=C2=A0=C2=A00 FILE=C2=A0=C2=A0= =C2=A0 LOCAL=C2=A0 DEFAULT=C2=A0 ABS strncase_l-avx.os > =C2=A0 3257: 0000000000159070=C2=A0=C2=A0 337 FUNC=C2=A0=C2=A0=C2=A0 LOCA= L=C2=A0 DEFAULT=C2=A0=C2=A0 13 > __memset_avx512_unaligned_erms > =C2=A0 3272: 0000000000158a40=C2=A0=C2=A0=C2=A0=C2=A0 9 FUNC=C2=A0=C2=A0= =C2=A0 LOCAL=C2=A0 DEFAULT=C2=A0=C2=A0 13 > __mempcpy_chk_avx512_unaligned > =C2=A0 3276: 000000000014f1d0=C2=A0 1288 FUNC=C2=A0=C2=A0=C2=A0 LOCAL=C2= =A0 DEFAULT=C2=A0=C2=A0 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