[PATCH] [AArch64] Define BE loader name.

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] [AArch64] Define BE loader name.

Marcus Shawcroft-2
Hi,

This patch defines the BE loader name for aarch64 to be ld-linux-aarch64_be.so.1.

Cheers
/Marcus

---
 ports/ChangeLog.aarch64                          |  12 ++
 ports/sysdeps/aarch64/configure                  | 174 +++++++++++++++++++++++
 ports/sysdeps/aarch64/configure.ac               |  22 +++
 ports/sysdeps/aarch64/shlib-versions             |   5 +
 ports/sysdeps/unix/sysv/linux/aarch64/Makefile   |  15 ++
 ports/sysdeps/unix/sysv/linux/aarch64/ldconfig.h |   1 +
 6 files changed, 229 insertions(+)
 create mode 100644 ports/sysdeps/aarch64/configure
 create mode 100644 ports/sysdeps/aarch64/configure.ac

diff --git a/ports/ChangeLog.aarch64 b/ports/ChangeLog.aarch64
index bad3b91..c1602ce 100644
--- a/ports/ChangeLog.aarch64
+++ b/ports/ChangeLog.aarch64
@@ -1,5 +1,17 @@
 2014-01-01  Marcus Shawcroft  <[hidden email]>
 
+ * sysdeps/aarch64/configure.ac: New file.
+ * sysdeps/aarch64/configure: New file.
+ * sysdeps/aarch64/shlib-versions: Define ld-linux-aarch64_be.so.1
+ * sysdeps/unix/sysv/linux/aarch64/Makefile (abi-variants)
+ (abi-lp64-options, abi-lp64-condition, abi-lp64-ld-soname)
+ (abi-lp64_be-options, abi-lp64_be-condition)
+ (abi-lp64_be-ld-soname) Define.
+ * sysdeps/unix/sysv/linux/aarch64/ldconfig.h
+ (SYSDEP_KNOWN_INTERPRETER_NAMES): Add ld-linux-aarch64_be.so.1
+
+2014-01-01  Marcus Shawcroft  <[hidden email]>
+
  * sysdeps/aarch64/abort-instr.h: New file.
 
 2013-12-18  Marcus Shawcroft  <[hidden email]>
diff --git a/ports/sysdeps/aarch64/configure b/ports/sysdeps/aarch64/configure
new file mode 100644
index 0000000..af870b7
--- /dev/null
+++ b/ports/sysdeps/aarch64/configure
@@ -0,0 +1,174 @@
+# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/aarch64.
+
+# 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
+# HAVE_AARCH64_BE to be defined in config.h and
+# in include/libc-symbols.h and thus available to
+# shlib-versions to select the appropriate name for
+# the dynamic linker via %ifdef.
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for big endian" >&5
+$as_echo_n "checking for big endian... " >&6; }
+if ${libc_cv_aarch64_be+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __AARCH64EB__
+                      yes
+                     #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  libc_cv_aarch64_be=yes
+else
+  libc_cv_aarch64_be=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_be" >&5
+$as_echo "$libc_cv_aarch64_be" >&6; }
+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"
+else
+  config_vars="$config_vars
+default-abi = lp64"
+fi
diff --git a/ports/sysdeps/aarch64/configure.ac b/ports/sysdeps/aarch64/configure.ac
new file mode 100644
index 0000000..7851dd4
--- /dev/null
+++ b/ports/sysdeps/aarch64/configure.ac
@@ -0,0 +1,22 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/aarch64.
+
+# 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
+# HAVE_AARCH64_BE to be defined in config.h and
+# in include/libc-symbols.h and thus available to
+# shlib-versions to select the appropriate name for
+# the dynamic linker via %ifdef.
+AC_CACHE_CHECK([for big endian],
+  [libc_cv_aarch64_be],
+  [AC_EGREP_CPP(yes,[#ifdef __AARCH64EB__
+                      yes
+                     #endif
+  ], libc_cv_aarch64_be=yes, libc_cv_aarch64_be=no)])
+if test $libc_cv_aarch64_be = yes; then
+  AC_DEFINE(HAVE_AARCH64_BE)
+  LIBC_CONFIG_VAR([default-abi], [lp64_be])
+else
+  LIBC_CONFIG_VAR([default-abi], [lp64])
+fi
diff --git a/ports/sysdeps/aarch64/shlib-versions b/ports/sysdeps/aarch64/shlib-versions
index 82b227d..67f1911 100644
--- a/ports/sysdeps/aarch64/shlib-versions
+++ b/ports/sysdeps/aarch64/shlib-versions
@@ -1,2 +1,7 @@
 aarch64.*-.*-linux.* DEFAULT GLIBC_2.17
+
+%ifdef HAVE_AARCH64_BE
+aarch64.*-.*-linux.* ld=ld-linux-aarch64_be.so.1
+%else
 aarch64.*-.*-linux.* ld=ld-linux-aarch64.so.1
+%endif
diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/Makefile b/ports/sysdeps/unix/sysv/linux/aarch64/Makefile
index 8a3d76b..d3f1603 100644
--- a/ports/sysdeps/unix/sysv/linux/aarch64/Makefile
+++ b/ports/sysdeps/unix/sysv/linux/aarch64/Makefile
@@ -22,3 +22,18 @@ endif
 ifeq ($(subdir),stdlib)
 gen-as-const-headers += ucontext_i.sym
 endif
+
+abi-variants := lp64
+abi-variants += lp64_be
+
+ifeq (,$(filter $(default-abi),$(abi-variants)))
+Unknown ABI, must be one of $(abi-variants)
+endif
+
+abi-lp64-options := -U__AARCH64EB__
+abi-lp64-condition := !defined __AARCH64EB__
+abi-lp64-ld-soname := ld-linux-aarch64.so.1
+
+abi-lp64_be-options := -D__AARCH6464EB__
+abi-lp64_be-condition := defined __AARCH64EB__
+abi-lp64_be-ld-soname := ld-linux-aarch64_be.so.1
diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/ldconfig.h b/ports/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
index 10be197..b0e6b6a 100644
--- a/ports/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
+++ b/ports/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
@@ -20,6 +20,7 @@
 
 #define SYSDEP_KNOWN_INTERPRETER_NAMES \
   { "/lib/ld-linux-aarch64.so.1", FLAG_ELF_LIBC6 }, \
+  { "/lib/ld-linux-aarch64_be.so.1", FLAG_ELF_LIBC6 }, \
   { "/lib/ld-linux.so.3", FLAG_ELF_LIBC6 }, \
   { "/lib/ld-linux-armhf.so.3", FLAG_ELF_LIBC6 },
 #define SYSDEP_KNOWN_LIBRARY_NAMES \
--
1.8.3.2

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] [AArch64] Define BE loader name.

Andrew Pinski-3


> On Jan 1, 2014, at 9:37 AM, Marcus Shawcroft <[hidden email]> wrote:
>
> Hi,
>
> This patch defines the BE loader name for aarch64 to be ld-linux-aarch64_be.so.1.

We (Cavium and Montavista) already have a distro out in the wild for big-endian and I think changing this is a bad idea as you won't have both little-endian and big-endian on the same system ever. Also you forgot to change both GCC and binutils.

Thanks,
Andrew

>
> Cheers
> /Marcus
>
> ---
> ports/ChangeLog.aarch64                          |  12 ++
> ports/sysdeps/aarch64/configure                  | 174 +++++++++++++++++++++++
> ports/sysdeps/aarch64/configure.ac               |  22 +++
> ports/sysdeps/aarch64/shlib-versions             |   5 +
> ports/sysdeps/unix/sysv/linux/aarch64/Makefile   |  15 ++
> ports/sysdeps/unix/sysv/linux/aarch64/ldconfig.h |   1 +
> 6 files changed, 229 insertions(+)
> create mode 100644 ports/sysdeps/aarch64/configure
> create mode 100644 ports/sysdeps/aarch64/configure.ac
>
> diff --git a/ports/ChangeLog.aarch64 b/ports/ChangeLog.aarch64
> index bad3b91..c1602ce 100644
> --- a/ports/ChangeLog.aarch64
> +++ b/ports/ChangeLog.aarch64
> @@ -1,5 +1,17 @@
> 2014-01-01  Marcus Shawcroft  <[hidden email]>
>
> +    * sysdeps/aarch64/configure.ac: New file.
> +    * sysdeps/aarch64/configure: New file.
> +    * sysdeps/aarch64/shlib-versions: Define ld-linux-aarch64_be.so.1
> +    * sysdeps/unix/sysv/linux/aarch64/Makefile (abi-variants)
> +    (abi-lp64-options, abi-lp64-condition, abi-lp64-ld-soname)
> +    (abi-lp64_be-options, abi-lp64_be-condition)
> +    (abi-lp64_be-ld-soname) Define.
> +    * sysdeps/unix/sysv/linux/aarch64/ldconfig.h
> +    (SYSDEP_KNOWN_INTERPRETER_NAMES): Add ld-linux-aarch64_be.so.1
> +
> +2014-01-01  Marcus Shawcroft  <[hidden email]>
> +
>   * sysdeps/aarch64/abort-instr.h: New file.
>
> 2013-12-18  Marcus Shawcroft  <[hidden email]>
> diff --git a/ports/sysdeps/aarch64/configure b/ports/sysdeps/aarch64/configure
> new file mode 100644
> index 0000000..af870b7
> --- /dev/null
> +++ b/ports/sysdeps/aarch64/configure
> @@ -0,0 +1,174 @@
> +# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
> + # Local configure fragment for sysdeps/aarch64.
> +
> +# 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
> +# HAVE_AARCH64_BE to be defined in config.h and
> +# in include/libc-symbols.h and thus available to
> +# shlib-versions to select the appropriate name for
> +# the dynamic linker via %ifdef.
> +
> +
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
> +$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
> +if ${ac_cv_path_GREP+:} false; then :
> +  $as_echo_n "(cached) " >&6
> +else
> +  if test -z "$GREP"; then
> +  ac_path_GREP_found=false
> +  # Loop through the user's path and test for each of PROGNAME-LIST
> +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
> +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
> +do
> +  IFS=$as_save_IFS
> +  test -z "$as_dir" && as_dir=.
> +    for ac_prog in grep ggrep; do
> +    for ac_exec_ext in '' $ac_executable_extensions; do
> +      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
> +      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
> +# Check for GNU ac_path_GREP and select it if it is found.
> +  # Check for GNU $ac_path_GREP
> +case `"$ac_path_GREP" --version 2>&1` in
> +*GNU*)
> +  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
> +*)
> +  ac_count=0
> +  $as_echo_n 0123456789 >"conftest.in"
> +  while :
> +  do
> +    cat "conftest.in" "conftest.in" >"conftest.tmp"
> +    mv "conftest.tmp" "conftest.in"
> +    cp "conftest.in" "conftest.nl"
> +    $as_echo 'GREP' >> "conftest.nl"
> +    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
> +    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
> +    as_fn_arith $ac_count + 1 && ac_count=$as_val
> +    if test $ac_count -gt ${ac_path_GREP_max-0}; then
> +      # Best one so far, save it but keep looking for a better one
> +      ac_cv_path_GREP="$ac_path_GREP"
> +      ac_path_GREP_max=$ac_count
> +    fi
> +    # 10*(2^10) chars as input seems more than enough
> +    test $ac_count -gt 10 && break
> +  done
> +  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
> +esac
> +
> +      $ac_path_GREP_found && break 3
> +    done
> +  done
> +  done
> +IFS=$as_save_IFS
> +  if test -z "$ac_cv_path_GREP"; then
> +    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
> +  fi
> +else
> +  ac_cv_path_GREP=$GREP
> +fi
> +
> +fi
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
> +$as_echo "$ac_cv_path_GREP" >&6; }
> + GREP="$ac_cv_path_GREP"
> +
> +
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
> +$as_echo_n "checking for egrep... " >&6; }
> +if ${ac_cv_path_EGREP+:} false; then :
> +  $as_echo_n "(cached) " >&6
> +else
> +  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
> +   then ac_cv_path_EGREP="$GREP -E"
> +   else
> +     if test -z "$EGREP"; then
> +  ac_path_EGREP_found=false
> +  # Loop through the user's path and test for each of PROGNAME-LIST
> +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
> +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
> +do
> +  IFS=$as_save_IFS
> +  test -z "$as_dir" && as_dir=.
> +    for ac_prog in egrep; do
> +    for ac_exec_ext in '' $ac_executable_extensions; do
> +      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
> +      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
> +# Check for GNU ac_path_EGREP and select it if it is found.
> +  # Check for GNU $ac_path_EGREP
> +case `"$ac_path_EGREP" --version 2>&1` in
> +*GNU*)
> +  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
> +*)
> +  ac_count=0
> +  $as_echo_n 0123456789 >"conftest.in"
> +  while :
> +  do
> +    cat "conftest.in" "conftest.in" >"conftest.tmp"
> +    mv "conftest.tmp" "conftest.in"
> +    cp "conftest.in" "conftest.nl"
> +    $as_echo 'EGREP' >> "conftest.nl"
> +    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
> +    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
> +    as_fn_arith $ac_count + 1 && ac_count=$as_val
> +    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
> +      # Best one so far, save it but keep looking for a better one
> +      ac_cv_path_EGREP="$ac_path_EGREP"
> +      ac_path_EGREP_max=$ac_count
> +    fi
> +    # 10*(2^10) chars as input seems more than enough
> +    test $ac_count -gt 10 && break
> +  done
> +  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
> +esac
> +
> +      $ac_path_EGREP_found && break 3
> +    done
> +  done
> +  done
> +IFS=$as_save_IFS
> +  if test -z "$ac_cv_path_EGREP"; then
> +    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
> +  fi
> +else
> +  ac_cv_path_EGREP=$EGREP
> +fi
> +
> +   fi
> +fi
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
> +$as_echo "$ac_cv_path_EGREP" >&6; }
> + EGREP="$ac_cv_path_EGREP"
> +
> +
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for big endian" >&5
> +$as_echo_n "checking for big endian... " >&6; }
> +if ${libc_cv_aarch64_be+:} false; then :
> +  $as_echo_n "(cached) " >&6
> +else
> +  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> +/* end confdefs.h.  */
> +#ifdef __AARCH64EB__
> +                      yes
> +                     #endif
> +
> +_ACEOF
> +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
> +  $EGREP "yes" >/dev/null 2>&1; then :
> +  libc_cv_aarch64_be=yes
> +else
> +  libc_cv_aarch64_be=no
> +fi
> +rm -f conftest*
> +
> +fi
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_be" >&5
> +$as_echo "$libc_cv_aarch64_be" >&6; }
> +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"
> +else
> +  config_vars="$config_vars
> +default-abi = lp64"
> +fi
> diff --git a/ports/sysdeps/aarch64/configure.ac b/ports/sysdeps/aarch64/configure.ac
> new file mode 100644
> index 0000000..7851dd4
> --- /dev/null
> +++ b/ports/sysdeps/aarch64/configure.ac
> @@ -0,0 +1,22 @@
> +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
> +# Local configure fragment for sysdeps/aarch64.
> +
> +# 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
> +# HAVE_AARCH64_BE to be defined in config.h and
> +# in include/libc-symbols.h and thus available to
> +# shlib-versions to select the appropriate name for
> +# the dynamic linker via %ifdef.
> +AC_CACHE_CHECK([for big endian],
> +  [libc_cv_aarch64_be],
> +  [AC_EGREP_CPP(yes,[#ifdef __AARCH64EB__
> +                      yes
> +                     #endif
> +  ], libc_cv_aarch64_be=yes, libc_cv_aarch64_be=no)])
> +if test $libc_cv_aarch64_be = yes; then
> +  AC_DEFINE(HAVE_AARCH64_BE)
> +  LIBC_CONFIG_VAR([default-abi], [lp64_be])
> +else
> +  LIBC_CONFIG_VAR([default-abi], [lp64])
> +fi
> diff --git a/ports/sysdeps/aarch64/shlib-versions b/ports/sysdeps/aarch64/shlib-versions
> index 82b227d..67f1911 100644
> --- a/ports/sysdeps/aarch64/shlib-versions
> +++ b/ports/sysdeps/aarch64/shlib-versions
> @@ -1,2 +1,7 @@
> aarch64.*-.*-linux.*    DEFAULT            GLIBC_2.17
> +
> +%ifdef HAVE_AARCH64_BE
> +aarch64.*-.*-linux.*    ld=ld-linux-aarch64_be.so.1
> +%else
> aarch64.*-.*-linux.*    ld=ld-linux-aarch64.so.1
> +%endif
> diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/Makefile b/ports/sysdeps/unix/sysv/linux/aarch64/Makefile
> index 8a3d76b..d3f1603 100644
> --- a/ports/sysdeps/unix/sysv/linux/aarch64/Makefile
> +++ b/ports/sysdeps/unix/sysv/linux/aarch64/Makefile
> @@ -22,3 +22,18 @@ endif
> ifeq ($(subdir),stdlib)
> gen-as-const-headers += ucontext_i.sym
> endif
> +
> +abi-variants := lp64
> +abi-variants += lp64_be
> +
> +ifeq (,$(filter $(default-abi),$(abi-variants)))
> +Unknown ABI, must be one of $(abi-variants)
> +endif
> +
> +abi-lp64-options := -U__AARCH64EB__
> +abi-lp64-condition := !defined __AARCH64EB__
> +abi-lp64-ld-soname := ld-linux-aarch64.so.1
> +
> +abi-lp64_be-options := -D__AARCH6464EB__
> +abi-lp64_be-condition := defined __AARCH64EB__
> +abi-lp64_be-ld-soname := ld-linux-aarch64_be.so.1
> diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/ldconfig.h b/ports/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
> index 10be197..b0e6b6a 100644
> --- a/ports/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
> +++ b/ports/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
> @@ -20,6 +20,7 @@
>
> #define SYSDEP_KNOWN_INTERPRETER_NAMES \
>  { "/lib/ld-linux-aarch64.so.1", FLAG_ELF_LIBC6 }, \
> +  { "/lib/ld-linux-aarch64_be.so.1", FLAG_ELF_LIBC6 }, \
>  { "/lib/ld-linux.so.3", FLAG_ELF_LIBC6 }, \
>  { "/lib/ld-linux-armhf.so.3", FLAG_ELF_LIBC6 },
> #define SYSDEP_KNOWN_LIBRARY_NAMES \
> --
> 1.8.3.2
>
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] [AArch64] Define BE loader name.

Andrew Pinski-3


> On Jan 1, 2014, at 11:31 AM, [hidden email] wrote:
>
>
>
>> On Jan 1, 2014, at 9:37 AM, Marcus Shawcroft <[hidden email]> wrote:
>>
>> Hi,
>>
>> This patch defines the BE loader name for aarch64 to be ld-linux-aarch64_be.so.1.
>
> We (Cavium and Montavista) already have a distro out in the wild for big-endian and I think changing this is a bad idea as you won't have both little-endian and big-endian on the same system ever. Also you forgot to change both GCC and binutils.

And since A GCC and a glibc has been released already that supports aarch64 big endian this is a huge abi change.

Thanks,
Andrew


>
> Thanks,
> Andrew
>
>>
>> Cheers
>> /Marcus
>>
>> ---
>> ports/ChangeLog.aarch64                          |  12 ++
>> ports/sysdeps/aarch64/configure                  | 174 +++++++++++++++++++++++
>> ports/sysdeps/aarch64/configure.ac               |  22 +++
>> ports/sysdeps/aarch64/shlib-versions             |   5 +
>> ports/sysdeps/unix/sysv/linux/aarch64/Makefile   |  15 ++
>> ports/sysdeps/unix/sysv/linux/aarch64/ldconfig.h |   1 +
>> 6 files changed, 229 insertions(+)
>> create mode 100644 ports/sysdeps/aarch64/configure
>> create mode 100644 ports/sysdeps/aarch64/configure.ac
>>
>> diff --git a/ports/ChangeLog.aarch64 b/ports/ChangeLog.aarch64
>> index bad3b91..c1602ce 100644
>> --- a/ports/ChangeLog.aarch64
>> +++ b/ports/ChangeLog.aarch64
>> @@ -1,5 +1,17 @@
>> 2014-01-01  Marcus Shawcroft  <[hidden email]>
>>
>> +    * sysdeps/aarch64/configure.ac: New file.
>> +    * sysdeps/aarch64/configure: New file.
>> +    * sysdeps/aarch64/shlib-versions: Define ld-linux-aarch64_be.so.1
>> +    * sysdeps/unix/sysv/linux/aarch64/Makefile (abi-variants)
>> +    (abi-lp64-options, abi-lp64-condition, abi-lp64-ld-soname)
>> +    (abi-lp64_be-options, abi-lp64_be-condition)
>> +    (abi-lp64_be-ld-soname) Define.
>> +    * sysdeps/unix/sysv/linux/aarch64/ldconfig.h
>> +    (SYSDEP_KNOWN_INTERPRETER_NAMES): Add ld-linux-aarch64_be.so.1
>> +
>> +2014-01-01  Marcus Shawcroft  <[hidden email]>
>> +
>>  * sysdeps/aarch64/abort-instr.h: New file.
>>
>> 2013-12-18  Marcus Shawcroft  <[hidden email]>
>> diff --git a/ports/sysdeps/aarch64/configure b/ports/sysdeps/aarch64/configure
>> new file mode 100644
>> index 0000000..af870b7
>> --- /dev/null
>> +++ b/ports/sysdeps/aarch64/configure
>> @@ -0,0 +1,174 @@
>> +# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
>> + # Local configure fragment for sysdeps/aarch64.
>> +
>> +# 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
>> +# HAVE_AARCH64_BE to be defined in config.h and
>> +# in include/libc-symbols.h and thus available to
>> +# shlib-versions to select the appropriate name for
>> +# the dynamic linker via %ifdef.
>> +
>> +
>> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
>> +$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
>> +if ${ac_cv_path_GREP+:} false; then :
>> +  $as_echo_n "(cached) " >&6
>> +else
>> +  if test -z "$GREP"; then
>> +  ac_path_GREP_found=false
>> +  # Loop through the user's path and test for each of PROGNAME-LIST
>> +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
>> +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
>> +do
>> +  IFS=$as_save_IFS
>> +  test -z "$as_dir" && as_dir=.
>> +    for ac_prog in grep ggrep; do
>> +    for ac_exec_ext in '' $ac_executable_extensions; do
>> +      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
>> +      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
>> +# Check for GNU ac_path_GREP and select it if it is found.
>> +  # Check for GNU $ac_path_GREP
>> +case `"$ac_path_GREP" --version 2>&1` in
>> +*GNU*)
>> +  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
>> +*)
>> +  ac_count=0
>> +  $as_echo_n 0123456789 >"conftest.in"
>> +  while :
>> +  do
>> +    cat "conftest.in" "conftest.in" >"conftest.tmp"
>> +    mv "conftest.tmp" "conftest.in"
>> +    cp "conftest.in" "conftest.nl"
>> +    $as_echo 'GREP' >> "conftest.nl"
>> +    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
>> +    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
>> +    as_fn_arith $ac_count + 1 && ac_count=$as_val
>> +    if test $ac_count -gt ${ac_path_GREP_max-0}; then
>> +      # Best one so far, save it but keep looking for a better one
>> +      ac_cv_path_GREP="$ac_path_GREP"
>> +      ac_path_GREP_max=$ac_count
>> +    fi
>> +    # 10*(2^10) chars as input seems more than enough
>> +    test $ac_count -gt 10 && break
>> +  done
>> +  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
>> +esac
>> +
>> +      $ac_path_GREP_found && break 3
>> +    done
>> +  done
>> +  done
>> +IFS=$as_save_IFS
>> +  if test -z "$ac_cv_path_GREP"; then
>> +    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
>> +  fi
>> +else
>> +  ac_cv_path_GREP=$GREP
>> +fi
>> +
>> +fi
>> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
>> +$as_echo "$ac_cv_path_GREP" >&6; }
>> + GREP="$ac_cv_path_GREP"
>> +
>> +
>> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
>> +$as_echo_n "checking for egrep... " >&6; }
>> +if ${ac_cv_path_EGREP+:} false; then :
>> +  $as_echo_n "(cached) " >&6
>> +else
>> +  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
>> +   then ac_cv_path_EGREP="$GREP -E"
>> +   else
>> +     if test -z "$EGREP"; then
>> +  ac_path_EGREP_found=false
>> +  # Loop through the user's path and test for each of PROGNAME-LIST
>> +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
>> +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
>> +do
>> +  IFS=$as_save_IFS
>> +  test -z "$as_dir" && as_dir=.
>> +    for ac_prog in egrep; do
>> +    for ac_exec_ext in '' $ac_executable_extensions; do
>> +      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
>> +      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
>> +# Check for GNU ac_path_EGREP and select it if it is found.
>> +  # Check for GNU $ac_path_EGREP
>> +case `"$ac_path_EGREP" --version 2>&1` in
>> +*GNU*)
>> +  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
>> +*)
>> +  ac_count=0
>> +  $as_echo_n 0123456789 >"conftest.in"
>> +  while :
>> +  do
>> +    cat "conftest.in" "conftest.in" >"conftest.tmp"
>> +    mv "conftest.tmp" "conftest.in"
>> +    cp "conftest.in" "conftest.nl"
>> +    $as_echo 'EGREP' >> "conftest.nl"
>> +    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
>> +    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
>> +    as_fn_arith $ac_count + 1 && ac_count=$as_val
>> +    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
>> +      # Best one so far, save it but keep looking for a better one
>> +      ac_cv_path_EGREP="$ac_path_EGREP"
>> +      ac_path_EGREP_max=$ac_count
>> +    fi
>> +    # 10*(2^10) chars as input seems more than enough
>> +    test $ac_count -gt 10 && break
>> +  done
>> +  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
>> +esac
>> +
>> +      $ac_path_EGREP_found && break 3
>> +    done
>> +  done
>> +  done
>> +IFS=$as_save_IFS
>> +  if test -z "$ac_cv_path_EGREP"; then
>> +    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
>> +  fi
>> +else
>> +  ac_cv_path_EGREP=$EGREP
>> +fi
>> +
>> +   fi
>> +fi
>> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
>> +$as_echo "$ac_cv_path_EGREP" >&6; }
>> + EGREP="$ac_cv_path_EGREP"
>> +
>> +
>> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for big endian" >&5
>> +$as_echo_n "checking for big endian... " >&6; }
>> +if ${libc_cv_aarch64_be+:} false; then :
>> +  $as_echo_n "(cached) " >&6
>> +else
>> +  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
>> +/* end confdefs.h.  */
>> +#ifdef __AARCH64EB__
>> +                      yes
>> +                     #endif
>> +
>> +_ACEOF
>> +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
>> +  $EGREP "yes" >/dev/null 2>&1; then :
>> +  libc_cv_aarch64_be=yes
>> +else
>> +  libc_cv_aarch64_be=no
>> +fi
>> +rm -f conftest*
>> +
>> +fi
>> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_be" >&5
>> +$as_echo "$libc_cv_aarch64_be" >&6; }
>> +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"
>> +else
>> +  config_vars="$config_vars
>> +default-abi = lp64"
>> +fi
>> diff --git a/ports/sysdeps/aarch64/configure.ac b/ports/sysdeps/aarch64/configure.ac
>> new file mode 100644
>> index 0000000..7851dd4
>> --- /dev/null
>> +++ b/ports/sysdeps/aarch64/configure.ac
>> @@ -0,0 +1,22 @@
>> +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
>> +# Local configure fragment for sysdeps/aarch64.
>> +
>> +# 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
>> +# HAVE_AARCH64_BE to be defined in config.h and
>> +# in include/libc-symbols.h and thus available to
>> +# shlib-versions to select the appropriate name for
>> +# the dynamic linker via %ifdef.
>> +AC_CACHE_CHECK([for big endian],
>> +  [libc_cv_aarch64_be],
>> +  [AC_EGREP_CPP(yes,[#ifdef __AARCH64EB__
>> +                      yes
>> +                     #endif
>> +  ], libc_cv_aarch64_be=yes, libc_cv_aarch64_be=no)])
>> +if test $libc_cv_aarch64_be = yes; then
>> +  AC_DEFINE(HAVE_AARCH64_BE)
>> +  LIBC_CONFIG_VAR([default-abi], [lp64_be])
>> +else
>> +  LIBC_CONFIG_VAR([default-abi], [lp64])
>> +fi
>> diff --git a/ports/sysdeps/aarch64/shlib-versions b/ports/sysdeps/aarch64/shlib-versions
>> index 82b227d..67f1911 100644
>> --- a/ports/sysdeps/aarch64/shlib-versions
>> +++ b/ports/sysdeps/aarch64/shlib-versions
>> @@ -1,2 +1,7 @@
>> aarch64.*-.*-linux.*    DEFAULT            GLIBC_2.17
>> +
>> +%ifdef HAVE_AARCH64_BE
>> +aarch64.*-.*-linux.*    ld=ld-linux-aarch64_be.so.1
>> +%else
>> aarch64.*-.*-linux.*    ld=ld-linux-aarch64.so.1
>> +%endif
>> diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/Makefile b/ports/sysdeps/unix/sysv/linux/aarch64/Makefile
>> index 8a3d76b..d3f1603 100644
>> --- a/ports/sysdeps/unix/sysv/linux/aarch64/Makefile
>> +++ b/ports/sysdeps/unix/sysv/linux/aarch64/Makefile
>> @@ -22,3 +22,18 @@ endif
>> ifeq ($(subdir),stdlib)
>> gen-as-const-headers += ucontext_i.sym
>> endif
>> +
>> +abi-variants := lp64
>> +abi-variants += lp64_be
>> +
>> +ifeq (,$(filter $(default-abi),$(abi-variants)))
>> +Unknown ABI, must be one of $(abi-variants)
>> +endif
>> +
>> +abi-lp64-options := -U__AARCH64EB__
>> +abi-lp64-condition := !defined __AARCH64EB__
>> +abi-lp64-ld-soname := ld-linux-aarch64.so.1
>> +
>> +abi-lp64_be-options := -D__AARCH6464EB__
>> +abi-lp64_be-condition := defined __AARCH64EB__
>> +abi-lp64_be-ld-soname := ld-linux-aarch64_be.so.1
>> diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/ldconfig.h b/ports/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
>> index 10be197..b0e6b6a 100644
>> --- a/ports/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
>> +++ b/ports/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
>> @@ -20,6 +20,7 @@
>>
>> #define SYSDEP_KNOWN_INTERPRETER_NAMES \
>> { "/lib/ld-linux-aarch64.so.1", FLAG_ELF_LIBC6 }, \
>> +  { "/lib/ld-linux-aarch64_be.so.1", FLAG_ELF_LIBC6 }, \
>> { "/lib/ld-linux.so.3", FLAG_ELF_LIBC6 }, \
>> { "/lib/ld-linux-armhf.so.3", FLAG_ELF_LIBC6 },
>> #define SYSDEP_KNOWN_LIBRARY_NAMES \
>> --
>> 1.8.3.2
>>
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] [AArch64] Define BE loader name.

Marcus
In reply to this post by Andrew Pinski-3
Hi,

On 1 January 2014 19:31,  <[hidden email]> wrote:
>
>
>> On Jan 1, 2014, at 9:37 AM, Marcus Shawcroft <[hidden email]> wrote:
>>
>> Hi,
>>
>> This patch defines the BE loader name for aarch64 to be ld-linux-aarch64_be.so.1.
>
> We (Cavium and Montavista) already have a distro out in the wild for big-endian and I think changing this is a bad idea as you won't have both little-endian and big-endian on the same system ever.

It is unfortunate that the loader name wasn't put in place before you
put code in the wild.

gcc has been able to configure and build for aarch64_be-none-linux-gnu
since it was upstreamed (4.8).  The 4.8 release of gcc was tested for
aarch64-elf, aarch64-linux-gnu and aarch64_be-elf , no
aarch64_be-linux-gnu kernel support was available for testing at the
time.  The BE gcc port of aarch64 is very much beta, there has been
flux in BE gcc support over the last year notably in advsimd support
and correctness.

glibc has been able to configure and build for aarch64_be since it was
upstreamed (2.17).  Releases 2.17 and 2.18 were tested for
aarch64-linux-gnu.  Neither were tested for aarch64_be-linux-gnu.  At
the time of those releases there was no functional BE linux port.

linux currently has no support for aarch64_be, the port will be  in
3.13 (due in a couple of weeks).

Therefore the situation right now for aarch64_be is that gcc is in a
state of flux and there is no released linux kernel kernel support.

Leaving the loader name overloaded between LE and BE closes doors for
the future, if it doesn't change now, a change further down the line
will be considerably more painful.

Cavium / montavista do have the option of creating a symlink in order
to ease the transition.

> Also you forgot to change both GCC and binutils.

Not forgotten. GCC will be posted shortly.  BINUTILS looks like it is
uses a broken loader name for both LE and BE, I'll sort that out
separately.

Cheers
/Marcus
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] [AArch64] Define BE loader name.

Andrew Pinski-3
On Mon, Jan 6, 2014 at 3:06 AM, Marcus Shawcroft
<[hidden email]> wrote:

> Hi,
>
> On 1 January 2014 19:31,  <[hidden email]> wrote:
>>
>>
>>> On Jan 1, 2014, at 9:37 AM, Marcus Shawcroft <[hidden email]> wrote:
>>>
>>> Hi,
>>>
>>> This patch defines the BE loader name for aarch64 to be ld-linux-aarch64_be.so.1.
>>
>> We (Cavium and Montavista) already have a distro out in the wild for big-endian and I think changing this is a bad idea as you won't have both little-endian and big-endian on the same system ever.
>
> It is unfortunate that the loader name wasn't put in place before you
> put code in the wild.
>
> gcc has been able to configure and build for aarch64_be-none-linux-gnu
> since it was upstreamed (4.8).  The 4.8 release of gcc was tested for
> aarch64-elf, aarch64-linux-gnu and aarch64_be-elf , no
> aarch64_be-linux-gnu kernel support was available for testing at the
> time.  The BE gcc port of aarch64 is very much beta, there has been
> flux in BE gcc support over the last year notably in advsimd support
> and correctness.

Then it should never have gone upstream.  I am sorry but this is a
huge ABI change and should have been mentioned that it was going to
change.  I hope ARM had been better at thinking this through in the
first place.  I think we should not change it at all.


>
> glibc has been able to configure and build for aarch64_be since it was
> upstreamed (2.17).  Releases 2.17 and 2.18 were tested for
> aarch64-linux-gnu.  Neither were tested for aarch64_be-linux-gnu.  At
> the time of those releases there was no functional BE linux port.
>
> linux currently has no support for aarch64_be, the port will be  in
> 3.13 (due in a couple of weeks).
>
> Therefore the situation right now for aarch64_be is that gcc is in a
> state of flux and there is no released linux kernel kernel support.

No, you can still use GCC 4.8.0 with a newer version of the kernel.

>
> Leaving the loader name overloaded between LE and BE closes doors for
> the future, if it doesn't change now, a change further down the line
> will be considerably more painful.

I think this is a bogus mention of why to change the ABI.  This ABI
was set when GCC/glibc support was added upstream.  If ARM does not
like it, then they should not have committed BE support to GCC/glibc
just yet.  I am sorry but this situation is broken and also there was
mention of this outside of these emails to any partners/licenses
before even posting of this patch.

>
> Cavium / montavista do have the option of creating a symlink in order
> to ease the transition.

No this still broken.

Thanks,
Andrew Pinski

>
>> Also you forgot to change both GCC and binutils.
>
> Not forgotten. GCC will be posted shortly.  BINUTILS looks like it is
> uses a broken loader name for both LE and BE, I'll sort that out
> separately.


>
> Cheers
> /Marcus
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] [AArch64] Define BE loader name.

Carlos O'Donell-6
On 01/06/2014 12:16 PM, Andrew Pinski wrote:
>> Cavium / montavista do have the option of creating a symlink in order
>> to ease the transition.
>
> No this still broken.

We need technical arguments from both sides to reach consensus.

Marcus has to come up with real reasons for needing the new dynamic
linker name.

Andrew, you need to come up with concrete reasons for not wanting to use
a symlink or a copy.

This is *exactly* the same kind of change we made for the 32-bit ARM
hard-float dynamic linker name change.

The only wrinkle is that a symlink doesn't actually work:
https://sourceware.org/ml/libc-alpha/2012-10/msg00670.html

If Markus is suggesting using a symlink he'll have to look into the
problem I posted, because the last time I checked the symlink setup
didn't work and required a hack to be used until all binaries had
been migrated.

Thankfully in the case of the hard-float dynamic linker name change
we had consensus that the name change was needed to support a mixed
environment.

Cheers,
Carlos.

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] [AArch64] Define BE loader name.

Steve McIntyre-4
[ I hope this threads OK - replying to the thread using the list
  archives... ]

Carlos wrote:
>
>We need technical arguments from both sides to reach consensus.
>
>Marcus has to come up with real reasons for needing the new dynamic
>linker name.

Carlos already contributed to a ML discussion that happened after
Linaro Connect in November last year, where we had broad consensus
from the distros about separating the dynamic linker names for BE and
LE systems:

  http://lists.linaro.org/pipermail/cross-distro/2013-November/000570.html

As a background to that, I'm the team lead for Big Endian work in the
Linaro Networking Group (LNG). For a variety of reasons we're working
on supporting both BE and LE code on a single system and we're
investigating various options. Yes, it's a *horrible* idea but there
are people who really want to use this. I can envisage places where we
may want to have have both BE and LE binaries co-existing in the same
system, and it would be nice if that's not locked out here.

I'll be honest: I *don't* think that the general purpose Linux distros
are likely to care about BE ARM or AArch64 systems in the same way as
us, but who knows what might come up?

>Andrew, you need to come up with concrete reasons for not wanting to
>use a symlink or a copy.
>
>This is *exactly* the same kind of change we made for the 32-bit ARM
>hard-float dynamic linker name change.

Yup, Been there, done that. In future, would it not make sense in
general to try and keep dynamic linkers separated by default?

>The only wrinkle is that a symlink doesn't actually work:
>https://sourceware.org/ml/libc-alpha/2012-10/msg00670.html
>
>If Markus is suggesting using a symlink he'll have to look into the
>problem I posted, because the last time I checked the symlink setup
>didn't work and required a hack to be used until all binaries had
>been migrated.

Yup. :-( I remember the hack I came up with, and I've pointed Marcus
at it to help him understand what we did and why:

  http://anonscm.debian.org/viewvc/pkg-glibc/glibc-package/trunk/debian/patches/arm/local-soname-hack.diff?view=markup

>Thankfully in the case of the hard-float dynamic linker name change
>we had consensus that the name change was needed to support a mixed
>environment.

Right.

Cheers,
--
Steve McIntyre                                [hidden email]
<http://www.linaro.org/> Linaro.org | Open source software for ARM SoCs

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] [AArch64] Define BE loader name.

Andrew Pinski-3
On Mon, Jan 13, 2014 at 10:16 AM, Steve McIntyre
<[hidden email]> wrote:

> [ I hope this threads OK - replying to the thread using the list
>   archives... ]
>
> Carlos wrote:
>>
>>We need technical arguments from both sides to reach consensus.
>>
>>Marcus has to come up with real reasons for needing the new dynamic
>>linker name.
>
> Carlos already contributed to a ML discussion that happened after
> Linaro Connect in November last year, where we had broad consensus
> from the distros about separating the dynamic linker names for BE and
> LE systems:
>
>   http://lists.linaro.org/pipermail/cross-distro/2013-November/000570.html
>
> As a background to that, I'm the team lead for Big Endian work in the
> Linaro Networking Group (LNG). For a variety of reasons we're working
> on supporting both BE and LE code on a single system and we're
> investigating various options. Yes, it's a *horrible* idea but there
> are people who really want to use this. I can envisage places where we
> may want to have have both BE and LE binaries co-existing in the same
> system, and it would be nice if that's not locked out here.
>
> I'll be honest: I *don't* think that the general purpose Linux distros
> are likely to care about BE ARM or AArch64 systems in the same way as
> us, but who knows what might come up?
>
>>Andrew, you need to come up with concrete reasons for not wanting to
>>use a symlink or a copy.
>>
>>This is *exactly* the same kind of change we made for the 32-bit ARM
>>hard-float dynamic linker name change.
>
> Yup, Been there, done that. In future, would it not make sense in
> general to try and keep dynamic linkers separated by default?
>
>>The only wrinkle is that a symlink doesn't actually work:
>>https://sourceware.org/ml/libc-alpha/2012-10/msg00670.html
>>
>>If Markus is suggesting using a symlink he'll have to look into the
>>problem I posted, because the last time I checked the symlink setup
>>didn't work and required a hack to be used until all binaries had
>>been migrated.
>
> Yup. :-( I remember the hack I came up with, and I've pointed Marcus
> at it to help him understand what we did and why:
>
>   http://anonscm.debian.org/viewvc/pkg-glibc/glibc-package/trunk/debian/patches/arm/local-soname-hack.diff?view=markup
>
>>Thankfully in the case of the hard-float dynamic linker name change
>>we had consensus that the name change was needed to support a mixed
>>environment.


I withdraw my objection to the patch.  Though I do feel this
discussion should have been done on the GCC/glibc list in addition to
the linaro cross distro list as not every one knows about that list.

Thanks,
Andrew Pinski

>
> Right.
>
> Cheers,
> --
> Steve McIntyre                                [hidden email]
> <http://www.linaro.org/> Linaro.org | Open source software for ARM SoCs
>
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] [AArch64] Define BE loader name.

Marcus
On 17 January 2014 23:04, Andrew Pinski <[hidden email]> wrote:

> I withdraw my objection to the patch.  Though I do feel this
> discussion should have been done on the GCC/glibc list in addition to
> the linaro cross distro list as not every one knows about that list.

Thank you, patch committed.
/Marcus
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] [AArch64] Define BE loader name.

Joseph Myers
On Mon, 20 Jan 2014, Marcus Shawcroft wrote:

> On 17 January 2014 23:04, Andrew Pinski <[hidden email]> wrote:
>
> > I withdraw my objection to the patch.  Though I do feel this
> > discussion should have been done on the GCC/glibc list in addition to
> > the linaro cross distro list as not every one knows about that list.
>
> Thank you, patch committed.

The committed patch has

+abi-lp64_be-options := -D__AARCH6464EB__

which looks like a typo to me ("6464").

--
Joseph S. Myers
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Policy: Require new dynamic loader names for entirely new ABIs?

Carlos O'Donell-6
In reply to this post by Andrew Pinski-3
On 01/17/2014 06:04 PM, Andrew Pinski wrote:
> I withdraw my objection to the patch.  Though I do feel this
> discussion should have been done on the GCC/glibc list in addition to
> the linaro cross distro list as not every one knows about that list.

I feel your pain here.

I was also frustrated by lack of transparency
when it cam to agreement on ABI details for
ARM hard-float. At the time I was working for
Mentor Graphics and we had to scramble to
implement a solution.

I support it because changing the dynamic loader
name now is less painful than later, we have
users that need it, and a workaround.

The only thing I can say is that we make it
policy that entirely new ABI's should always
use a unique dynamic loader name unless the
submitter can argue otherwise.

That way in the future we never see this
problem.

Thoughts?

Cheers,
Carlos.

Reply | Threaded
Open this post in threaded view
|

Re: Policy: Require new dynamic loader names for entirely new ABIs?

Steve McIntyre-4
On Mon, Jan 20, 2014 at 11:15:52AM -0500, Carlos O'Donell wrote:
>On 01/17/2014 06:04 PM, Andrew Pinski wrote:
>> I withdraw my objection to the patch.  Though I do feel this
>> discussion should have been done on the GCC/glibc list in addition to
>> the linaro cross distro list as not every one knows about that list.
>
>I feel your pain here.

Yes, this could have worked much better. Multiple people spoke about
posting patches and discussing things more widely, but it fell through
the cracks. :-(

>I was also frustrated by lack of transparency
>when it cam to agreement on ABI details for
>ARM hard-float. At the time I was working for
>Mentor Graphics and we had to scramble to
>implement a solution.

ACK. That was more painful because we left things later than we should
have done in terms of defining the ABI, and various groups were
already publically using the same loader name for different things. In
the case of the discussion around the BE AArch64 loader, it seemed
that nobody was (yet) producing anything so there wouldn't be any
problems. Andrew: apologies for the hassle to you here...

>I support it because changing the dynamic loader
>name now is less painful than later, we have
>users that need it, and a workaround.
>
>The only thing I can say is that we make it
>policy that entirely new ABI's should always
>use a unique dynamic loader name unless the
>submitter can argue otherwise.
>
>That way in the future we never see this
>problem.
>
>Thoughts?

That would be lovely. I don't see much of a downside so long as this
is understood up front for new ports/ABIs etc. - there's very little
cost to it at that point.

Cheers,
--
Steve McIntyre                                [hidden email]
<http://www.linaro.org/> Linaro.org | Open source software for ARM SoCs