public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] LoongArch: config: Rewrite check on static PIE.
@ 2023-07-06  9:54 caiyinyu
  2023-07-06  9:58 ` Xi Ruoyao
  0 siblings, 1 reply; 2+ messages in thread
From: caiyinyu @ 2023-07-06  9:54 UTC (permalink / raw)
  To: libc-alpha; +Cc: adhemerval.zanella, xry111, caiyinyu

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] LoongArch: config: Rewrite check on static PIE.
  2023-07-06  9:54 [PATCH] LoongArch: config: Rewrite check on static PIE caiyinyu
@ 2023-07-06  9:58 ` Xi Ruoyao
  0 siblings, 0 replies; 2+ messages in thread
From: Xi Ruoyao @ 2023-07-06  9:58 UTC (permalink / raw)
  To: caiyinyu, libc-alpha; +Cc: adhemerval.zanella

On Thu, 2023-07-06 at 17:54 +0800, caiyinyu wrote:
> It's better to add "\" before "EOF" and remove "\"
> before "$".

Oh, new bash skill learnt!  Thanks!

> ---
>  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

-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-06  9:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-06  9:54 [PATCH] LoongArch: config: Rewrite check on static PIE caiyinyu
2023-07-06  9:58 ` Xi Ruoyao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).