From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 19CB63858D33 for ; Thu, 6 Jul 2023 09:54:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 19CB63858D33 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.20.4.187]) by gateway (Coremail) with SMTP id _____8DxxPBvj6ZkZ90AAA--.3573S3; Thu, 06 Jul 2023 17:54:55 +0800 (CST) Received: from loongson-pc.loongson.cn (unknown [10.20.4.187]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxjiNuj6ZkZIQeAA--.50842S4; Thu, 06 Jul 2023 17:54:55 +0800 (CST) From: caiyinyu To: libc-alpha@sourceware.org Cc: adhemerval.zanella@linaro.org, xry111@xry111.site, caiyinyu Subject: [PATCH] LoongArch: config: Rewrite check on static PIE. Date: Thu, 6 Jul 2023 17:54:53 +0800 Message-Id: <20230706095453.5496-1-caiyinyu@loongson.cn> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:AQAAf8AxjiNuj6ZkZIQeAA--.50842S4 X-CM-SenderInfo: 5fdl5xhq1xqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBj93XoWxXw1UKr1ktF45XFy5Zr4DZFc_yoW5Jw47pr Z3Zr9rWF48W3Z3XFn8C3yFg3Z7Jrs7CFyUWa43try8CwnFgry8Zws3C39Iq3W7K348J34F vF48KrnrCa1DAacCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUkFb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r106r15McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6x kF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07jUsqXUUUUU= X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: It's better to add "\" before "EOF" and remove "\" before "$". --- sysdeps/loongarch/configure | 14 +++++++------- sysdeps/loongarch/configure.ac | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sysdeps/loongarch/configure b/sysdeps/loongarch/configure index b3c203ba4b..52bd08a91e 100644 --- a/sysdeps/loongarch/configure +++ b/sysdeps/loongarch/configure @@ -10,14 +10,14 @@ if ${libc_cv_static_pie_on_loongarch+:} false; then : $as_echo_n "(cached) " >&6 else - cat > conftest1.S << EOF + cat > conftest1.S <<\EOF .global _start .type _start, @function _start: - li.w \$a7, 93 + li.w $a7, 93 /* This ensures the assembler supports explicit reloc. */ - pcalau12i \$a0, %pc_hi20(x) - ld.w \$a0, \$a0, %pc_lo12(x) + pcalau12i $a0, %pc_hi20(x) + ld.w $a0, $a0, %pc_lo12(x) syscall 0 .data @@ -26,13 +26,13 @@ x: /* This should produce an R_LARCH_RELATIVE in the static PIE. */ .dword _start EOF - cat > conftest2.S << EOF + cat > conftest2.S <<\EOF .global f .type f, @function f: /* The linker should be able to handle this and produce a PLT entry. */ - la.pcrel \$t0, \$t0, external_func - jirl \$zero, \$t0, 0 + la.pcrel $t0, $t0, external_func + jirl $zero, $t0, 0 EOF libc_cv_static_pie_on_loongarch=no diff --git a/sysdeps/loongarch/configure.ac b/sysdeps/loongarch/configure.ac index c45f6b815e..cdd95fa512 100644 --- a/sysdeps/loongarch/configure.ac +++ b/sysdeps/loongarch/configure.ac @@ -13,14 +13,14 @@ dnl satisfy the requirement, but a distro may backport static PIE support into dnl earlier GCC or Binutils releases as well. AC_CACHE_CHECK([if the toolchain is sufficient to build static PIE on LoongArch], libc_cv_static_pie_on_loongarch, [ - cat > conftest1.S << EOF + cat > conftest1.S <<\EOF .global _start .type _start, @function _start: - li.w \$a7, 93 + li.w $a7, 93 /* This ensures the assembler supports explicit reloc. */ - pcalau12i \$a0, %pc_hi20(x) - ld.w \$a0, \$a0, %pc_lo12(x) + pcalau12i $a0, %pc_hi20(x) + ld.w $a0, $a0, %pc_lo12(x) syscall 0 .data @@ -29,13 +29,13 @@ x: /* This should produce an R_LARCH_RELATIVE in the static PIE. */ .dword _start EOF - cat > conftest2.S << EOF + cat > conftest2.S <<\EOF .global f .type f, @function f: /* The linker should be able to handle this and produce a PLT entry. */ - la.pcrel \$t0, \$t0, external_func - jirl \$zero, \$t0, 0 + la.pcrel $t0, $t0, external_func + jirl $zero, $t0, 0 EOF libc_cv_static_pie_on_loongarch=no -- 2.31.1