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.
This commit is contained in:
dengjianbo 2023-08-08 14:15:43 +08:00 committed by caiyinyu
parent 57b2c14272
commit cb7954c4c2
6 changed files with 9 additions and 14 deletions

3
NEWS
View File

@ -20,7 +20,8 @@ Deprecated and removed features, and other changes affecting compatibility:
Changes to build and runtime requirements: 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: Security related changes:

View File

@ -141,11 +141,6 @@
/* LOONGARCH floating-point ABI for ld.so. */ /* LOONGARCH floating-point ABI for ld.so. */
#undef LOONGARCH_ABI_FRLEN #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. */ /* Linux specific: minimum supported kernel version. */
#undef __LINUX_KERNEL_VERSION #undef __LINUX_KERNEL_VERSION

View File

@ -128,8 +128,7 @@ rm -f conftest*
fi fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_loongarch_vec_asm" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_loongarch_vec_asm" >&5
printf "%s\n" "$libc_cv_loongarch_vec_asm" >&6; } printf "%s\n" "$libc_cv_loongarch_vec_asm" >&6; }
if test $libc_cv_loongarch_vec_asm = yes; then if test $libc_cv_loongarch_vec_asm = no; then
printf "%s\n" "#define HAVE_LOONGARCH_VEC_ASM 1" >>confdefs.h as_fn_error $? "binutils version is too old, use 2.41 or newer version" "$LINENO" 5
fi fi

View File

@ -74,6 +74,6 @@ else
libc_cv_loongarch_vec_asm=no libc_cv_loongarch_vec_asm=no
fi fi
rm -f conftest*]) rm -f conftest*])
if test $libc_cv_loongarch_vec_asm = yes; then if test $libc_cv_loongarch_vec_asm = no; then
AC_DEFINE(HAVE_LOONGARCH_VEC_ASM) AC_MSG_ERROR([binutils version is too old, use 2.41 or newer version])
fi fi

View File

@ -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 using PLTs, fill in the first two entries of .got.plt. */
if (l->l_info[DT_JMPREL]) 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_lasx (void) attribute_hidden;
extern void _dl_runtime_resolve_lsx (void) attribute_hidden; extern void _dl_runtime_resolve_lsx (void) attribute_hidden;
#endif #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 /* This function will get called to fix up the GOT entry
indicated by the offset on the stack, and then jump to indicated by the offset on the stack, and then jump to
the resolved address. */ the resolved address. */
#if HAVE_LOONGARCH_VEC_ASM && !defined __loongarch_soft_float #if !defined __loongarch_soft_float
if (SUPPORT_LASX) if (SUPPORT_LASX)
gotplt[0] = (ElfW(Addr)) &_dl_runtime_resolve_lasx; gotplt[0] = (ElfW(Addr)) &_dl_runtime_resolve_lasx;
else if (SUPPORT_LSX) else if (SUPPORT_LSX)

View File

@ -19,7 +19,7 @@
#include <sysdep.h> #include <sysdep.h>
#include <sys/asm.h> #include <sys/asm.h>
#if HAVE_LOONGARCH_VEC_ASM && !defined __loongarch_soft_float #if !defined __loongarch_soft_float
#define USE_LASX #define USE_LASX
#define _dl_runtime_resolve _dl_runtime_resolve_lasx #define _dl_runtime_resolve _dl_runtime_resolve_lasx
#include "dl-trampoline.h" #include "dl-trampoline.h"