From patchwork Fri Aug 4 09:53:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dengjianbo X-Patchwork-Id: 1816864 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RHLfd6d0xz1yYC for ; Fri, 4 Aug 2023 19:54:49 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AE1A33857700 for ; Fri, 4 Aug 2023 09:54:47 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 7BD103858436 for ; Fri, 4 Aug 2023 09:54:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7BD103858436 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [10.2.5.5]) by gateway (Coremail) with SMTP id _____8AxEvC7ysxkdhoQAA--.36304S3; Fri, 04 Aug 2023 17:54:03 +0800 (CST) Received: from 5.5.5 (unknown [10.2.5.5]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxviO4ysxkUB1IAA--.13603S3; Fri, 04 Aug 2023 17:54:02 +0800 (CST) From: dengjianbo To: libc-alpha@sourceware.org Cc: adhemerval.zanella@linaro.org, xry111@xry111.site, caiyinyu@loongson.cn, xuchenghua@loongson.cn, huangpei@loongson.cn, dengjianbo Subject: [PATCH v3 2/3] LoongArch: Add minuimum binutils required version Date: Fri, 4 Aug 2023 17:53:58 +0800 Message-Id: <20230804095359.2384557-2-dengjianbo@loongson.cn> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230804095359.2384557-1-dengjianbo@loongson.cn> References: <20230804095359.2384557-1-dengjianbo@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxviO4ysxkUB1IAA--.13603S3 X-CM-SenderInfo: pghqwyxldqu0o6or00hjvr0hdfq/ X-Coremail-Antispam: 1Uk129KBj93XoWxCFyxGryxAF1fAFy3XF48Xwc_yoWrGF15pF y7Zr13GFs7Ca93GFZFy3yYgFn3XF4xuFy7ZF1ay3y8Cr1xCw1kZr48A3s3ZF4UX3y8Aw1I vryv93W2vF45JwbCm3ZEXasCq-sJn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUkFb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r106r15M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r126r1DMcIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6x kF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07j1LvtUUUUU= X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, 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 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" 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. --- 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 +- 5 files changed, 7 insertions(+), 13 deletions(-) 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"