From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7891) id 09F213858C2B; Mon, 14 Aug 2023 03:31:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 09F213858C2B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1691983893; bh=sGW61l0qqqONwJ2Sdg2KxHWSrS8kFc2RJTDzm/3C+Us=; h=From:To:Subject:Date:From; b=YvcX+B4NuWozr5GdLE1Uf1+acON7f12mr9JDynNRyE+H7iHf7ScE9PdbZyxCdHmZk vlO850D9VDhK1cVa7cYhpHrSPIiBh1UDni5EgG8Yw1ZlizlKbU5gYDmArQwaub+84j /I0vaaGRiDR5cFBOe3vsPBdtHBBhevf3v8JpSmxI= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Yinyu Cai To: glibc-cvs@sourceware.org Subject: [glibc] LoongArch: Add minuimum binutils required version X-Act-Checkin: glibc X-Git-Author: dengjianbo X-Git-Refname: refs/heads/master X-Git-Oldrev: 57b2c14272998c0ea08c005edbd90887c2d5fa6b X-Git-Newrev: cb7954c4c2f46e5da5374c75576612c9b02b2592 Message-Id: <20230814033133.09F213858C2B@sourceware.org> Date: Mon, 14 Aug 2023 03:31:33 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=cb7954c4c2f46e5da5374c75576612c9b02b2592 commit cb7954c4c2f46e5da5374c75576612c9b02b2592 Author: dengjianbo Date: Tue Aug 8 14:15:43 2023 +0800 LoongArch: Add minuimum binutils required version 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. Diff: --- NEWS | 3 ++- config.h.in | 5 ----- sysdeps/loongarch/configure | 5 ++--- sysdeps/loongarch/configure.ac | 4 ++-- sysdeps/loongarch/dl-machine.h | 4 ++-- sysdeps/loongarch/dl-trampoline.S | 2 +- 6 files changed, 9 insertions(+), 14 deletions(-) diff --git a/NEWS b/NEWS index 97379002f3..1d9ce09488 100644 --- a/NEWS +++ b/NEWS @@ -20,7 +20,8 @@ Deprecated and removed features, and other changes affecting compatibility: Changes to build and runtime requirements: - [Add changes to build and runtime requirements here] +* Building on LoongArch requires at a minimum binutils 2.41 for vector + instructions. Security related changes: 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 @@ /* LOONGARCH floating-point ABI for ld.so. */ #undef LOONGARCH_ABI_FRLEN -/* Assembler support LoongArch LASX/LSX vector instructions. - This macro becomes obsolete when glibc increased the minimum - required version of GNU 'binutils' to 2.41 or later. */ -#define HAVE_LOONGARCH_VEC_ASM 0 - /* Linux specific: minimum supported kernel version. */ #undef __LINUX_KERNEL_VERSION 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* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_loongarch_vec_asm" >&5 printf "%s\n" "$libc_cv_loongarch_vec_asm" >&6; } -if test $libc_cv_loongarch_vec_asm = yes; then - printf "%s\n" "#define HAVE_LOONGARCH_VEC_ASM 1" >>confdefs.h - +if test $libc_cv_loongarch_vec_asm = no; then + as_fn_error $? "binutils version is too old, use 2.41 or newer version" "$LINENO" 5 fi 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 libc_cv_loongarch_vec_asm=no fi rm -f conftest*]) -if test $libc_cv_loongarch_vec_asm = yes; then - AC_DEFINE(HAVE_LOONGARCH_VEC_ASM) +if test $libc_cv_loongarch_vec_asm = no; then + AC_MSG_ERROR([binutils version is too old, use 2.41 or newer version]) fi 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[], /* If using PLTs, fill in the first two entries of .got.plt. */ if (l->l_info[DT_JMPREL]) { -#if HAVE_LOONGARCH_VEC_ASM && !defined __loongarch_soft_float +#if !defined __loongarch_soft_float extern void _dl_runtime_resolve_lasx (void) attribute_hidden; extern void _dl_runtime_resolve_lsx (void) attribute_hidden; #endif @@ -300,7 +300,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[], /* This function will get called to fix up the GOT entry indicated by the offset on the stack, and then jump to the resolved address. */ -#if HAVE_LOONGARCH_VEC_ASM && !defined __loongarch_soft_float +#if !defined __loongarch_soft_float if (SUPPORT_LASX) gotplt[0] = (ElfW(Addr)) &_dl_runtime_resolve_lasx; else if (SUPPORT_LSX) 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 @@ #include #include -#if HAVE_LOONGARCH_VEC_ASM && !defined __loongarch_soft_float +#if !defined __loongarch_soft_float #define USE_LASX #define _dl_runtime_resolve _dl_runtime_resolve_lasx #include "dl-trampoline.h"