From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 06B0B3858D28 for ; Mon, 7 Aug 2023 05:31:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 06B0B3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1691386303; bh=IO+4lvJzhD7X5zZQRvZC5wkw56nmOdxWkjXPd7p4V08=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=dgF7Sy08gHgfYAVDkq12pnZNG5oNjteFNBQHnrJk4ZS2UE4b9N1AlJ7rN5vR3gPOy XERKfbXpbWpCkrJ10sEoqEHZ6a0UNTbdXbf6P+2mc25bDDzPqhW0Yfr0l5mDCLvpO2 Tq+VnJXAI44d11FhYiQUHDZ0kchJ4wYtXPckmH1c= Received: from [IPv6:2409:8a0c:2a4:2170:40dc:a500:81f0:2] (unknown [IPv6:2409:8a0c:2a4:2170:40dc:a500:81f0:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id D22D9659AD; Mon, 7 Aug 2023 01:31:37 -0400 (EDT) Message-ID: <97225a65ac67656f7881f30df44c42d0e8829f95.camel@xry111.site> Subject: Re: [PATCH v3 2/3] LoongArch: Add minuimum binutils required version From: Xi Ruoyao To: dengjianbo , libc-alpha@sourceware.org Cc: adhemerval.zanella@linaro.org, caiyinyu@loongson.cn, xuchenghua@loongson.cn, huangpei@loongson.cn Date: Mon, 07 Aug 2023 13:31:10 +0800 In-Reply-To: <20230804095359.2384557-2-dengjianbo@loongson.cn> References: <20230804095359.2384557-1-dengjianbo@loongson.cn> <20230804095359.2384557-2-dengjianbo@loongson.cn> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 MIME-Version: 1.0 X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,LIKELY_SPAM_FROM,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, 2023-08-04 at 17:53 +0800, dengjianbo wrote: > LoongArch glibc can add some LASX/LSX vector instructions codes, > change the > required minimum binutils version to 2.41 which could support vector > instructions. HAVE_LOONGARCH_VEC_ASM is removed accordingly. I guess we need a NEWS entry for this. > --- > =C2=A0config.h.in=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 | 5 ----- > =C2=A0sysdeps/loongarch/configure=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 5= ++--- > =C2=A0sysdeps/loongarch/configure.ac=C2=A0=C2=A0=C2=A0 | 4 ++-- > =C2=A0sysdeps/loongarch/dl-machine.h=C2=A0=C2=A0=C2=A0 | 4 ++-- > =C2=A0sysdeps/loongarch/dl-trampoline.S | 2 +- > =C2=A05 files changed, 7 insertions(+), 13 deletions(-) >=20 > diff --git a/config.h.in b/config.h.in > index 0dedc124f7..44a34072a4 100644 > --- a/config.h.in > +++ b/config.h.in > @@ -141,11 +141,6 @@ > =C2=A0/* LOONGARCH floating-point ABI for ld.so.=C2=A0 */ > =C2=A0#undef LOONGARCH_ABI_FRLEN > =C2=A0 > -/* Assembler support LoongArch LASX/LSX vector instructions. > -=C2=A0=C2=A0 This macro becomes obsolete when glibc increased the minimu= m > -=C2=A0=C2=A0 required version of GNU 'binutils' to 2.41 or later. */ > -#define HAVE_LOONGARCH_VEC_ASM 0 > - > =C2=A0/* Linux specific: minimum supported kernel version.=C2=A0 */ > =C2=A0#undef=C2=A0__LINUX_KERNEL_VERSION > =C2=A0 > diff --git a/sysdeps/loongarch/configure b/sysdeps/loongarch/configure > index 5843c7cf90..395ddc92ca 100644 > --- a/sysdeps/loongarch/configure > +++ b/sysdeps/loongarch/configure > @@ -128,8 +128,7 @@ rm -f conftest* > =C2=A0fi > =C2=A0{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: > $libc_cv_loongarch_vec_asm" >&5 > =C2=A0printf "%s\n" "$libc_cv_loongarch_vec_asm" >&6; } > -if test $libc_cv_loongarch_vec_asm =3D yes; then > -=C2=A0 printf "%s\n" "#define HAVE_LOONGARCH_VEC_ASM 1" >>confdefs.h > - > +if test $libc_cv_loongarch_vec_asm =3D no; then > +=C2=A0 as_fn_error $? "binutils version is too old, use 2.41 or newer > version" "$LINENO" 5 > =C2=A0fi > =C2=A0 > diff --git a/sysdeps/loongarch/configure.ac > b/sysdeps/loongarch/configure.ac > index ba89d8346d..989287c6d2 100644 > --- a/sysdeps/loongarch/configure.ac > +++ b/sysdeps/loongarch/configure.ac > @@ -74,6 +74,6 @@ else > =C2=A0=C2=A0 libc_cv_loongarch_vec_asm=3Dno > =C2=A0fi > =C2=A0rm -f conftest*]) > -if test $libc_cv_loongarch_vec_asm =3D yes; then > -=C2=A0 AC_DEFINE(HAVE_LOONGARCH_VEC_ASM) > +if test $libc_cv_loongarch_vec_asm =3D no; then > +=C2=A0 AC_MSG_ERROR([binutils version is too old, use 2.41 or newer > version]) > =C2=A0fi > diff --git a/sysdeps/loongarch/dl-machine.h b/sysdeps/loongarch/dl- > machine.h > index 51ce9af84b..066bb233ac 100644 > --- a/sysdeps/loongarch/dl-machine.h > +++ b/sysdeps/loongarch/dl-machine.h > @@ -270,7 +270,7 @@ elf_machine_runtime_setup (struct link_map *l, > struct r_scope_elem *scope[], > =C2=A0=C2=A0 /* If using PLTs, fill in the first two entries of .got.plt.= =C2=A0 */ > =C2=A0=C2=A0 if (l->l_info[DT_JMPREL]) > =C2=A0=C2=A0=C2=A0=C2=A0 { > -#if HAVE_LOONGARCH_VEC_ASM && !defined __loongarch_soft_float > +#if !defined __loongarch_soft_float > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 extern void _dl_runtime_resolve_lasx= (void) attribute_hidden; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 extern void _dl_runtime_resolve_lsx = (void) attribute_hidden; > =C2=A0#endif > @@ -300,7 +300,7 @@ elf_machine_runtime_setup (struct link_map *l, > struct r_scope_elem *scope[], > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* This function w= ill get called to fix up the GOT entry > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = indicated by the offset on the stack, and then jump to > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = the resolved address.=C2=A0 */ > -#if HAVE_LOONGARCH_VEC_ASM && !defined __loongarch_soft_float > +#if !defined __loongarch_soft_float > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (SUPPORT_LASX) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 gotplt= [0] =3D (ElfW(Addr)) &_dl_runtime_resolve_lasx; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 else if (SUPPORT_L= SX) > diff --git a/sysdeps/loongarch/dl-trampoline.S b/sysdeps/loongarch/dl- > trampoline.S > index f6ba5e443c..8fd9146978 100644 > --- a/sysdeps/loongarch/dl-trampoline.S > +++ b/sysdeps/loongarch/dl-trampoline.S > @@ -19,7 +19,7 @@ > =C2=A0#include > =C2=A0#include > =C2=A0 > -#if HAVE_LOONGARCH_VEC_ASM && !defined __loongarch_soft_float > +#if !defined __loongarch_soft_float > =C2=A0#define USE_LASX > =C2=A0#define _dl_runtime_resolve _dl_runtime_resolve_lasx > =C2=A0#include "dl-trampoline.h" --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University