public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/arm/morello/main] aarch64: morello: configure change for purecap abi
@ 2022-08-05 19:30 Szabolcs Nagy
  0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-08-05 19:30 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=18fb0250708bff99abb0ca3b0fefdb7b563e8dbb

commit 18fb0250708bff99abb0ca3b0fefdb7b563e8dbb
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Fri Apr 8 16:27:01 2022 +0100

    aarch64: morello: configure change for purecap abi
    
    Detect default-abi and add aarch64-purecap make variable.
    
    Purecap abi sets HIDDEN_VAR_NEEDS_DYNAMIC_RELOC and unsets
    SUPPORT_STATIC_PIE.

Diff:
---
 sysdeps/aarch64/configure    | 52 +++++++++++++++++++++++++++++++++++++-------
 sysdeps/aarch64/configure.ac | 28 +++++++++++++++++++-----
 2 files changed, 67 insertions(+), 13 deletions(-)

diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure
old mode 100644
new mode 100755
index bf972122b1..9b2264be19
--- a/sysdeps/aarch64/configure
+++ b/sysdeps/aarch64/configure
@@ -1,10 +1,6 @@
 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/aarch64.
 
-# Static PIE is supported.
-$as_echo "#define SUPPORT_STATIC_PIE 1" >>confdefs.h
-
-
 # We check to see if the compiler and flags are
 # selecting the big endian ABI and if they are then
 # we set libc_cv_aarch64_be to yes which causes
@@ -167,15 +163,55 @@ rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_be" >&5
 $as_echo "$libc_cv_aarch64_be" >&6; }
+# Check for purecap ABI too, an alternative name is l64pc128.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for purecap ABI" >&5
+$as_echo_n "checking for purecap ABI... " >&6; }
+if ${libc_cv_aarch64_purecap+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __CHERI_PURE_CAPABILITY__
+                      yes
+                     #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  libc_cv_aarch64_purecap=yes
+else
+  libc_cv_aarch64_purecap=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_purecap" >&5
+$as_echo "$libc_cv_aarch64_purecap" >&6; }
+config_vars="$config_vars
+aarch64-purecap = $libc_cv_aarch64_purecap"
+
+libc_aarch64_be=""
 if test $libc_cv_aarch64_be = yes; then
   $as_echo "#define HAVE_AARCH64_BE 1" >>confdefs.h
 
-  config_vars="$config_vars
-default-abi = lp64_be"
+  libc_aarch64_be="_be"
+fi
+
+libc_aarch64_abi="lp64"
+if test $libc_cv_aarch64_purecap = yes; then
+  libc_aarch64_abi="purecap"
+  # The purecap abi requires relocations because objects may not be
+  # within bounds for PCC. This means static-pie is not supported.
+  $as_echo "#define HIDDEN_VAR_NEEDS_DYNAMIC_RELOC 1" >>confdefs.h
+
 else
-  config_vars="$config_vars
-default-abi = lp64"
+  # Static PIE is supported.  Hidden variables only need relocations
+  # in PIE with -mcmodel=large, but that's unsupported.
+  $as_echo "#define SUPPORT_STATIC_PIE 1" >>confdefs.h
+
 fi
+config_vars="$config_vars
+default-abi = $libc_aarch64_abi$libc_aarch64_be"
 
 # Only consider BTI supported if -mbranch-protection=bti is
 # on by default in the compiler and the linker produces
diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac
index 51253d9802..aa6064c0e5 100644
--- a/sysdeps/aarch64/configure.ac
+++ b/sysdeps/aarch64/configure.ac
@@ -1,9 +1,6 @@
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/aarch64.
 
-# Static PIE is supported.
-AC_DEFINE(SUPPORT_STATIC_PIE)
-
 # We check to see if the compiler and flags are
 # selecting the big endian ABI and if they are then
 # we set libc_cv_aarch64_be to yes which causes
@@ -17,12 +14,33 @@ AC_CACHE_CHECK([for big endian],
                       yes
                      #endif
   ], libc_cv_aarch64_be=yes, libc_cv_aarch64_be=no)])
+# Check for purecap ABI too, an alternative name is l64pc128.
+AC_CACHE_CHECK([for purecap ABI],
+  [libc_cv_aarch64_purecap],
+  [AC_EGREP_CPP(yes,[#ifdef __CHERI_PURE_CAPABILITY__
+                      yes
+                     #endif
+  ], libc_cv_aarch64_purecap=yes, libc_cv_aarch64_purecap=no)])
+LIBC_CONFIG_VAR([aarch64-purecap], [$libc_cv_aarch64_purecap])
+
+libc_aarch64_be=""
 if test $libc_cv_aarch64_be = yes; then
   AC_DEFINE(HAVE_AARCH64_BE)
-  LIBC_CONFIG_VAR([default-abi], [lp64_be])
+  libc_aarch64_be="_be"
+fi
+
+libc_aarch64_abi="lp64"
+if test $libc_cv_aarch64_purecap = yes; then
+  libc_aarch64_abi="purecap"
+  # The purecap abi requires relocations because objects may not be
+  # within bounds for PCC. This means static-pie is not supported.
+  AC_DEFINE(HIDDEN_VAR_NEEDS_DYNAMIC_RELOC)
 else
-  LIBC_CONFIG_VAR([default-abi], [lp64])
+  # Static PIE is supported.  Hidden variables only need relocations
+  # in PIE with -mcmodel=large, but that's unsupported.
+  AC_DEFINE(SUPPORT_STATIC_PIE)
 fi
+LIBC_CONFIG_VAR([default-abi], [$libc_aarch64_abi$libc_aarch64_be])
 
 # Only consider BTI supported if -mbranch-protection=bti is
 # on by default in the compiler and the linker produces


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

* [glibc/arm/morello/main] aarch64: morello: configure change for purecap abi
@ 2022-11-23 14:40 Szabolcs Nagy
  0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-11-23 14:40 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=76bf2cf7a5095047f4c79fb994910254a58c9244

commit 76bf2cf7a5095047f4c79fb994910254a58c9244
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Fri Apr 8 16:27:01 2022 +0100

    aarch64: morello: configure change for purecap abi
    
    Detect default-abi and add aarch64-purecap make variable.
    
    Purecap abi sets HIDDEN_VAR_NEEDS_DYNAMIC_RELOC and unsets
    SUPPORT_STATIC_PIE.

Diff:
---
 sysdeps/aarch64/configure    | 52 +++++++++++++++++++++++++++++++++++++-------
 sysdeps/aarch64/configure.ac | 28 +++++++++++++++++++-----
 2 files changed, 67 insertions(+), 13 deletions(-)

diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure
old mode 100644
new mode 100755
index bf972122b1..9b2264be19
--- a/sysdeps/aarch64/configure
+++ b/sysdeps/aarch64/configure
@@ -1,10 +1,6 @@
 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/aarch64.
 
-# Static PIE is supported.
-$as_echo "#define SUPPORT_STATIC_PIE 1" >>confdefs.h
-
-
 # We check to see if the compiler and flags are
 # selecting the big endian ABI and if they are then
 # we set libc_cv_aarch64_be to yes which causes
@@ -167,15 +163,55 @@ rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_be" >&5
 $as_echo "$libc_cv_aarch64_be" >&6; }
+# Check for purecap ABI too, an alternative name is l64pc128.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for purecap ABI" >&5
+$as_echo_n "checking for purecap ABI... " >&6; }
+if ${libc_cv_aarch64_purecap+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __CHERI_PURE_CAPABILITY__
+                      yes
+                     #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  libc_cv_aarch64_purecap=yes
+else
+  libc_cv_aarch64_purecap=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_purecap" >&5
+$as_echo "$libc_cv_aarch64_purecap" >&6; }
+config_vars="$config_vars
+aarch64-purecap = $libc_cv_aarch64_purecap"
+
+libc_aarch64_be=""
 if test $libc_cv_aarch64_be = yes; then
   $as_echo "#define HAVE_AARCH64_BE 1" >>confdefs.h
 
-  config_vars="$config_vars
-default-abi = lp64_be"
+  libc_aarch64_be="_be"
+fi
+
+libc_aarch64_abi="lp64"
+if test $libc_cv_aarch64_purecap = yes; then
+  libc_aarch64_abi="purecap"
+  # The purecap abi requires relocations because objects may not be
+  # within bounds for PCC. This means static-pie is not supported.
+  $as_echo "#define HIDDEN_VAR_NEEDS_DYNAMIC_RELOC 1" >>confdefs.h
+
 else
-  config_vars="$config_vars
-default-abi = lp64"
+  # Static PIE is supported.  Hidden variables only need relocations
+  # in PIE with -mcmodel=large, but that's unsupported.
+  $as_echo "#define SUPPORT_STATIC_PIE 1" >>confdefs.h
+
 fi
+config_vars="$config_vars
+default-abi = $libc_aarch64_abi$libc_aarch64_be"
 
 # Only consider BTI supported if -mbranch-protection=bti is
 # on by default in the compiler and the linker produces
diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac
index 51253d9802..aa6064c0e5 100644
--- a/sysdeps/aarch64/configure.ac
+++ b/sysdeps/aarch64/configure.ac
@@ -1,9 +1,6 @@
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/aarch64.
 
-# Static PIE is supported.
-AC_DEFINE(SUPPORT_STATIC_PIE)
-
 # We check to see if the compiler and flags are
 # selecting the big endian ABI and if they are then
 # we set libc_cv_aarch64_be to yes which causes
@@ -17,12 +14,33 @@ AC_CACHE_CHECK([for big endian],
                       yes
                      #endif
   ], libc_cv_aarch64_be=yes, libc_cv_aarch64_be=no)])
+# Check for purecap ABI too, an alternative name is l64pc128.
+AC_CACHE_CHECK([for purecap ABI],
+  [libc_cv_aarch64_purecap],
+  [AC_EGREP_CPP(yes,[#ifdef __CHERI_PURE_CAPABILITY__
+                      yes
+                     #endif
+  ], libc_cv_aarch64_purecap=yes, libc_cv_aarch64_purecap=no)])
+LIBC_CONFIG_VAR([aarch64-purecap], [$libc_cv_aarch64_purecap])
+
+libc_aarch64_be=""
 if test $libc_cv_aarch64_be = yes; then
   AC_DEFINE(HAVE_AARCH64_BE)
-  LIBC_CONFIG_VAR([default-abi], [lp64_be])
+  libc_aarch64_be="_be"
+fi
+
+libc_aarch64_abi="lp64"
+if test $libc_cv_aarch64_purecap = yes; then
+  libc_aarch64_abi="purecap"
+  # The purecap abi requires relocations because objects may not be
+  # within bounds for PCC. This means static-pie is not supported.
+  AC_DEFINE(HIDDEN_VAR_NEEDS_DYNAMIC_RELOC)
 else
-  LIBC_CONFIG_VAR([default-abi], [lp64])
+  # Static PIE is supported.  Hidden variables only need relocations
+  # in PIE with -mcmodel=large, but that's unsupported.
+  AC_DEFINE(SUPPORT_STATIC_PIE)
 fi
+LIBC_CONFIG_VAR([default-abi], [$libc_aarch64_abi$libc_aarch64_be])
 
 # Only consider BTI supported if -mbranch-protection=bti is
 # on by default in the compiler and the linker produces

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

* [glibc/arm/morello/main] aarch64: morello: configure change for purecap abi
@ 2022-10-27 13:50 Szabolcs Nagy
  0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-10-27 13:50 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fa2eae72ccc562228e912d17cd2ac59e50a9bc1f

commit fa2eae72ccc562228e912d17cd2ac59e50a9bc1f
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Fri Apr 8 16:27:01 2022 +0100

    aarch64: morello: configure change for purecap abi
    
    Detect default-abi and add aarch64-purecap make variable.
    
    Purecap abi sets HIDDEN_VAR_NEEDS_DYNAMIC_RELOC and unsets
    SUPPORT_STATIC_PIE.

Diff:
---
 sysdeps/aarch64/configure    | 52 +++++++++++++++++++++++++++++++++++++-------
 sysdeps/aarch64/configure.ac | 28 +++++++++++++++++++-----
 2 files changed, 67 insertions(+), 13 deletions(-)

diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure
old mode 100644
new mode 100755
index bf972122b1..9b2264be19
--- a/sysdeps/aarch64/configure
+++ b/sysdeps/aarch64/configure
@@ -1,10 +1,6 @@
 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/aarch64.
 
-# Static PIE is supported.
-$as_echo "#define SUPPORT_STATIC_PIE 1" >>confdefs.h
-
-
 # We check to see if the compiler and flags are
 # selecting the big endian ABI and if they are then
 # we set libc_cv_aarch64_be to yes which causes
@@ -167,15 +163,55 @@ rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_be" >&5
 $as_echo "$libc_cv_aarch64_be" >&6; }
+# Check for purecap ABI too, an alternative name is l64pc128.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for purecap ABI" >&5
+$as_echo_n "checking for purecap ABI... " >&6; }
+if ${libc_cv_aarch64_purecap+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __CHERI_PURE_CAPABILITY__
+                      yes
+                     #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  libc_cv_aarch64_purecap=yes
+else
+  libc_cv_aarch64_purecap=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_purecap" >&5
+$as_echo "$libc_cv_aarch64_purecap" >&6; }
+config_vars="$config_vars
+aarch64-purecap = $libc_cv_aarch64_purecap"
+
+libc_aarch64_be=""
 if test $libc_cv_aarch64_be = yes; then
   $as_echo "#define HAVE_AARCH64_BE 1" >>confdefs.h
 
-  config_vars="$config_vars
-default-abi = lp64_be"
+  libc_aarch64_be="_be"
+fi
+
+libc_aarch64_abi="lp64"
+if test $libc_cv_aarch64_purecap = yes; then
+  libc_aarch64_abi="purecap"
+  # The purecap abi requires relocations because objects may not be
+  # within bounds for PCC. This means static-pie is not supported.
+  $as_echo "#define HIDDEN_VAR_NEEDS_DYNAMIC_RELOC 1" >>confdefs.h
+
 else
-  config_vars="$config_vars
-default-abi = lp64"
+  # Static PIE is supported.  Hidden variables only need relocations
+  # in PIE with -mcmodel=large, but that's unsupported.
+  $as_echo "#define SUPPORT_STATIC_PIE 1" >>confdefs.h
+
 fi
+config_vars="$config_vars
+default-abi = $libc_aarch64_abi$libc_aarch64_be"
 
 # Only consider BTI supported if -mbranch-protection=bti is
 # on by default in the compiler and the linker produces
diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac
index 51253d9802..aa6064c0e5 100644
--- a/sysdeps/aarch64/configure.ac
+++ b/sysdeps/aarch64/configure.ac
@@ -1,9 +1,6 @@
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/aarch64.
 
-# Static PIE is supported.
-AC_DEFINE(SUPPORT_STATIC_PIE)
-
 # We check to see if the compiler and flags are
 # selecting the big endian ABI and if they are then
 # we set libc_cv_aarch64_be to yes which causes
@@ -17,12 +14,33 @@ AC_CACHE_CHECK([for big endian],
                       yes
                      #endif
   ], libc_cv_aarch64_be=yes, libc_cv_aarch64_be=no)])
+# Check for purecap ABI too, an alternative name is l64pc128.
+AC_CACHE_CHECK([for purecap ABI],
+  [libc_cv_aarch64_purecap],
+  [AC_EGREP_CPP(yes,[#ifdef __CHERI_PURE_CAPABILITY__
+                      yes
+                     #endif
+  ], libc_cv_aarch64_purecap=yes, libc_cv_aarch64_purecap=no)])
+LIBC_CONFIG_VAR([aarch64-purecap], [$libc_cv_aarch64_purecap])
+
+libc_aarch64_be=""
 if test $libc_cv_aarch64_be = yes; then
   AC_DEFINE(HAVE_AARCH64_BE)
-  LIBC_CONFIG_VAR([default-abi], [lp64_be])
+  libc_aarch64_be="_be"
+fi
+
+libc_aarch64_abi="lp64"
+if test $libc_cv_aarch64_purecap = yes; then
+  libc_aarch64_abi="purecap"
+  # The purecap abi requires relocations because objects may not be
+  # within bounds for PCC. This means static-pie is not supported.
+  AC_DEFINE(HIDDEN_VAR_NEEDS_DYNAMIC_RELOC)
 else
-  LIBC_CONFIG_VAR([default-abi], [lp64])
+  # Static PIE is supported.  Hidden variables only need relocations
+  # in PIE with -mcmodel=large, but that's unsupported.
+  AC_DEFINE(SUPPORT_STATIC_PIE)
 fi
+LIBC_CONFIG_VAR([default-abi], [$libc_aarch64_abi$libc_aarch64_be])
 
 # Only consider BTI supported if -mbranch-protection=bti is
 # on by default in the compiler and the linker produces

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

* [glibc/arm/morello/main] aarch64: morello: configure change for purecap abi
@ 2022-10-26 15:12 Szabolcs Nagy
  0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-10-26 15:12 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9249688d6d22f38f108795913c0342cd7abca112

commit 9249688d6d22f38f108795913c0342cd7abca112
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Fri Apr 8 16:27:01 2022 +0100

    aarch64: morello: configure change for purecap abi
    
    Detect default-abi and add aarch64-purecap make variable.
    
    Purecap abi sets HIDDEN_VAR_NEEDS_DYNAMIC_RELOC and unsets
    SUPPORT_STATIC_PIE.

Diff:
---
 sysdeps/aarch64/configure    | 52 +++++++++++++++++++++++++++++++++++++-------
 sysdeps/aarch64/configure.ac | 28 +++++++++++++++++++-----
 2 files changed, 67 insertions(+), 13 deletions(-)

diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure
old mode 100644
new mode 100755
index bf972122b1..9b2264be19
--- a/sysdeps/aarch64/configure
+++ b/sysdeps/aarch64/configure
@@ -1,10 +1,6 @@
 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/aarch64.
 
-# Static PIE is supported.
-$as_echo "#define SUPPORT_STATIC_PIE 1" >>confdefs.h
-
-
 # We check to see if the compiler and flags are
 # selecting the big endian ABI and if they are then
 # we set libc_cv_aarch64_be to yes which causes
@@ -167,15 +163,55 @@ rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_be" >&5
 $as_echo "$libc_cv_aarch64_be" >&6; }
+# Check for purecap ABI too, an alternative name is l64pc128.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for purecap ABI" >&5
+$as_echo_n "checking for purecap ABI... " >&6; }
+if ${libc_cv_aarch64_purecap+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __CHERI_PURE_CAPABILITY__
+                      yes
+                     #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  libc_cv_aarch64_purecap=yes
+else
+  libc_cv_aarch64_purecap=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_purecap" >&5
+$as_echo "$libc_cv_aarch64_purecap" >&6; }
+config_vars="$config_vars
+aarch64-purecap = $libc_cv_aarch64_purecap"
+
+libc_aarch64_be=""
 if test $libc_cv_aarch64_be = yes; then
   $as_echo "#define HAVE_AARCH64_BE 1" >>confdefs.h
 
-  config_vars="$config_vars
-default-abi = lp64_be"
+  libc_aarch64_be="_be"
+fi
+
+libc_aarch64_abi="lp64"
+if test $libc_cv_aarch64_purecap = yes; then
+  libc_aarch64_abi="purecap"
+  # The purecap abi requires relocations because objects may not be
+  # within bounds for PCC. This means static-pie is not supported.
+  $as_echo "#define HIDDEN_VAR_NEEDS_DYNAMIC_RELOC 1" >>confdefs.h
+
 else
-  config_vars="$config_vars
-default-abi = lp64"
+  # Static PIE is supported.  Hidden variables only need relocations
+  # in PIE with -mcmodel=large, but that's unsupported.
+  $as_echo "#define SUPPORT_STATIC_PIE 1" >>confdefs.h
+
 fi
+config_vars="$config_vars
+default-abi = $libc_aarch64_abi$libc_aarch64_be"
 
 # Only consider BTI supported if -mbranch-protection=bti is
 # on by default in the compiler and the linker produces
diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac
index 51253d9802..aa6064c0e5 100644
--- a/sysdeps/aarch64/configure.ac
+++ b/sysdeps/aarch64/configure.ac
@@ -1,9 +1,6 @@
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/aarch64.
 
-# Static PIE is supported.
-AC_DEFINE(SUPPORT_STATIC_PIE)
-
 # We check to see if the compiler and flags are
 # selecting the big endian ABI and if they are then
 # we set libc_cv_aarch64_be to yes which causes
@@ -17,12 +14,33 @@ AC_CACHE_CHECK([for big endian],
                       yes
                      #endif
   ], libc_cv_aarch64_be=yes, libc_cv_aarch64_be=no)])
+# Check for purecap ABI too, an alternative name is l64pc128.
+AC_CACHE_CHECK([for purecap ABI],
+  [libc_cv_aarch64_purecap],
+  [AC_EGREP_CPP(yes,[#ifdef __CHERI_PURE_CAPABILITY__
+                      yes
+                     #endif
+  ], libc_cv_aarch64_purecap=yes, libc_cv_aarch64_purecap=no)])
+LIBC_CONFIG_VAR([aarch64-purecap], [$libc_cv_aarch64_purecap])
+
+libc_aarch64_be=""
 if test $libc_cv_aarch64_be = yes; then
   AC_DEFINE(HAVE_AARCH64_BE)
-  LIBC_CONFIG_VAR([default-abi], [lp64_be])
+  libc_aarch64_be="_be"
+fi
+
+libc_aarch64_abi="lp64"
+if test $libc_cv_aarch64_purecap = yes; then
+  libc_aarch64_abi="purecap"
+  # The purecap abi requires relocations because objects may not be
+  # within bounds for PCC. This means static-pie is not supported.
+  AC_DEFINE(HIDDEN_VAR_NEEDS_DYNAMIC_RELOC)
 else
-  LIBC_CONFIG_VAR([default-abi], [lp64])
+  # Static PIE is supported.  Hidden variables only need relocations
+  # in PIE with -mcmodel=large, but that's unsupported.
+  AC_DEFINE(SUPPORT_STATIC_PIE)
 fi
+LIBC_CONFIG_VAR([default-abi], [$libc_aarch64_abi$libc_aarch64_be])
 
 # Only consider BTI supported if -mbranch-protection=bti is
 # on by default in the compiler and the linker produces

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

end of thread, other threads:[~2022-11-23 14:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-05 19:30 [glibc/arm/morello/main] aarch64: morello: configure change for purecap abi Szabolcs Nagy
2022-10-26 15:12 Szabolcs Nagy
2022-10-27 13:50 Szabolcs Nagy
2022-11-23 14:40 Szabolcs Nagy

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