diff mbox series

[v2] arc: Cleanup arcbe

Message ID 20240923122852.2606010-1-kozlov@synopsys.com
State New
Headers show
Series [v2] arc: Cleanup arcbe | expand

Commit Message

Pavel Kozlov Sept. 23, 2024, 12:28 p.m. UTC
From: Pavel Kozlov <pavel.kozlov@synopsys.com>

Remove the mention of arcbe ABI to avoid any mislead.
ARC big endian ABI is no longer supported.
---
This is an addition to the original patch series by Florian Weimer
"scripts: Remove arceb-linux-gnu from build-many-glibcs.py"
This patch offers extra arcbe cleanups to be applied after the
original patch.

Tested for arc with build-many-glibcs.py.

 sysdeps/arc/bits/endianness.h        | 8 ++------
 sysdeps/arc/configure                | 2 +-
 sysdeps/arc/configure.ac             | 2 +-
 sysdeps/unix/sysv/linux/arc/Makefile | 9 ---------
 4 files changed, 4 insertions(+), 17 deletions(-)

Comments

Sam James Sept. 23, 2024, 12:42 p.m. UTC | #1
Pavel Kozlov <Pavel.Kozlov@synopsys.com> writes:

> From: Pavel Kozlov <pavel.kozlov@synopsys.com>
>
> Remove the mention of arcbe ABI to avoid any mislead.
> ARC big endian ABI is no longer supported.
> ---
> This is an addition to the original patch series by Florian Weimer
> "scripts: Remove arceb-linux-gnu from build-many-glibcs.py"
> This patch offers extra arcbe cleanups to be applied after the
> original patch.
>
> Tested for arc with build-many-glibcs.py.
>
>  sysdeps/arc/bits/endianness.h        | 8 ++------
>  sysdeps/arc/configure                | 2 +-
>  sysdeps/arc/configure.ac             | 2 +-
>  sysdeps/unix/sysv/linux/arc/Makefile | 9 ---------
>  4 files changed, 4 insertions(+), 17 deletions(-)
>
> diff --git a/sysdeps/arc/bits/endianness.h b/sysdeps/arc/bits/endianness.h
> index 8f17ca84b485..4a6e7d4c1579 100644
> --- a/sysdeps/arc/bits/endianness.h
> +++ b/sysdeps/arc/bits/endianness.h
> @@ -5,11 +5,7 @@
>  # error "Never use <bits/endian.h> directly; include <endian.h> instead."
>  #endif
>  
> -/* ARC has selectable endianness.  */
> -#ifdef __BIG_ENDIAN__
> -# define __BYTE_ORDER __BIG_ENDIAN
> -#else
> -# define __BYTE_ORDER __LITTLE_ENDIAN
> -#endif
> +/* Only little-endian ARC is supported.  */
> +#define __BYTE_ORDER __LITTLE_ENDIAN
>  
>  #endif /* bits/endianness.h */
> diff --git a/sysdeps/arc/configure b/sysdeps/arc/configure
> index 66d5fadcddb2..b4192983bf37 100644
> --- a/sysdeps/arc/configure
> +++ b/sysdeps/arc/configure
> @@ -10,7 +10,7 @@ libc_cv_asm_line_sep='`'
>  printf "%s\n" "#define ASM_LINE_SEP $libc_cv_asm_line_sep" >>confdefs.h
>  
>  
> -# For big endian ABI, generate a symbol for selecting right dynamic linker
> +# ARC big endian ABI is no longer supported.
>  
>  
>  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5
> diff --git a/sysdeps/arc/configure.ac b/sysdeps/arc/configure.ac
> index 4d79ccb00da6..48dc6f5b9b13 100644
> --- a/sysdeps/arc/configure.ac
> +++ b/sysdeps/arc/configure.ac
> @@ -9,7 +9,7 @@ libc_cv_have_sdata_section=no
>  libc_cv_asm_line_sep='`'
>  AC_DEFINE_UNQUOTED(ASM_LINE_SEP, $libc_cv_asm_line_sep)
>  
> -# For big endian ABI, generate a symbol for selecting right dynamic linker
> +# ARC big endian ABI is no longer supported.

Why do we need to keep this configure check? Florian's patch removed its
use but not the check itself.

>  AC_CACHE_CHECK([for big endian],
>    [libc_cv_arc_be],
>    [AC_EGREP_CPP(yes,[#ifdef __BIG_ENDIAN__
> diff --git a/sysdeps/unix/sysv/linux/arc/Makefile b/sysdeps/unix/sysv/linux/arc/Makefile
> index eca9a9fd3a55..dd3da52c394c 100644
> --- a/sysdeps/unix/sysv/linux/arc/Makefile
> +++ b/sysdeps/unix/sysv/linux/arc/Makefile
> @@ -11,12 +11,3 @@ ifeq ($(subdir),misc)
>  sysdep_headers += sys/cachectl.h
>  sysdep_routines += cacheflush
>  endif
> -
> -abi-variants := arcle arcbe
> -
> -ifeq (,$(filter $(default-abi),$(abi-variants)))
> -$(error Unknown ABI $(default-abi), must be one of $(abi-variants))
> -endif
> -
> -abi-arcle-condition := !defined __BIG_ENDIAN__
> -abi-arcbe-condition := defined __BIG_ENDIAN__
Florian Weimer Sept. 23, 2024, 12:47 p.m. UTC | #2
* Sam James:

>> -# For big endian ABI, generate a symbol for selecting right dynamic linker
>> +# ARC big endian ABI is no longer supported.
>
> Why do we need to keep this configure check? Florian's patch removed its
> use but not the check itself.

I should have updated the comment:

 # For big endian ABI, generate a symbol for selecting right dynamic linker
 AC_CACHE_CHECK([for big endian],
   [libc_cv_arc_be],
   [AC_EGREP_CPP(yes,[#ifdef __BIG_ENDIAN__
                       yes
                      #endif
   ], libc_cv_arc_be=yes, libc_cv_arc_be=no)])
 if test $libc_cv_arc_be = yes; then
-  # For shlib-versions.
-  AC_DEFINE(HAVE_ARC_BE)
-  LIBC_CONFIG_VAR([default-abi], [arcbe])
-else
-  LIBC_CONFIG_VAR([default-abi], [arcle])
+  AC_MSG_ERROR([big-endian not supported])
 fi
+LIBC_CONFIG_VAR([default-abi], [arcle])

I think it's valuable to fail here instead of producing an incorrect
ABI.

Thanks,
Florian
Sam James Sept. 23, 2024, 12:53 p.m. UTC | #3
Florian Weimer <fweimer@redhat.com> writes:

> * Sam James:
>
>>> -# For big endian ABI, generate a symbol for selecting right dynamic linker
>>> +# ARC big endian ABI is no longer supported.
>>
>> Why do we need to keep this configure check? Florian's patch removed its
>> use but not the check itself.
>
> I should have updated the comment:
>
>  # For big endian ABI, generate a symbol for selecting right dynamic linker
>  AC_CACHE_CHECK([for big endian],
>    [libc_cv_arc_be],
>    [AC_EGREP_CPP(yes,[#ifdef __BIG_ENDIAN__
>                        yes
>                       #endif
>    ], libc_cv_arc_be=yes, libc_cv_arc_be=no)])
>  if test $libc_cv_arc_be = yes; then
> -  # For shlib-versions.
> -  AC_DEFINE(HAVE_ARC_BE)
> -  LIBC_CONFIG_VAR([default-abi], [arcbe])
> -else
> -  LIBC_CONFIG_VAR([default-abi], [arcle])
> +  AC_MSG_ERROR([big-endian not supported])
>  fi
> +LIBC_CONFIG_VAR([default-abi], [arcle])
>
> I think it's valuable to fail here instead of producing an incorrect
> ABI.

Yeah, agreed. Thanks.

>
> Thanks,
> Florian
Florian Weimer Sept. 25, 2024, 9:26 a.m. UTC | #4
* Pavel Kozlov:

> From: Pavel Kozlov <pavel.kozlov@synopsys.com>
>
> Remove the mention of arcbe ABI to avoid any mislead.
> ARC big endian ABI is no longer supported.
> ---
> This is an addition to the original patch series by Florian Weimer
> "scripts: Remove arceb-linux-gnu from build-many-glibcs.py"
> This patch offers extra arcbe cleanups to be applied after the
> original patch.
>
> Tested for arc with build-many-glibcs.py.

I've pushed the removal patches, so this is now good to go in.

Reviewed-by: Florian Weimer <fweimer@redhat.com>

Thanks,
Florian
Pavel Kozlov Sept. 25, 2024, 3:07 p.m. UTC | #5
>> From: Pavel Kozlov <pavel.kozlov@synopsys.com>
>>
>> Remove the mention of arcbe ABI to avoid any mislead.
>> ARC big endian ABI is no longer supported.
>> ---
>> This is an addition to the original patch series by Florian Weimer
>> "scripts: Remove arceb-linux-gnu from build-many-glibcs.py"
>> This patch offers extra arcbe cleanups to be applied after the
>> original patch.
>>
>> Tested for arc with build-many-glibcs.py.

> I've pushed the removal patches, so this is now good to go in.
>
> Reviewed-by: Florian Weimer <fweimer@redhat.com>
>
> Thanks,
> Florian

Thanks! I've pushed the patch.

Pavel
diff mbox series

Patch

diff --git a/sysdeps/arc/bits/endianness.h b/sysdeps/arc/bits/endianness.h
index 8f17ca84b485..4a6e7d4c1579 100644
--- a/sysdeps/arc/bits/endianness.h
+++ b/sysdeps/arc/bits/endianness.h
@@ -5,11 +5,7 @@ 
 # error "Never use <bits/endian.h> directly; include <endian.h> instead."
 #endif
 
-/* ARC has selectable endianness.  */
-#ifdef __BIG_ENDIAN__
-# define __BYTE_ORDER __BIG_ENDIAN
-#else
-# define __BYTE_ORDER __LITTLE_ENDIAN
-#endif
+/* Only little-endian ARC is supported.  */
+#define __BYTE_ORDER __LITTLE_ENDIAN
 
 #endif /* bits/endianness.h */
diff --git a/sysdeps/arc/configure b/sysdeps/arc/configure
index 66d5fadcddb2..b4192983bf37 100644
--- a/sysdeps/arc/configure
+++ b/sysdeps/arc/configure
@@ -10,7 +10,7 @@  libc_cv_asm_line_sep='`'
 printf "%s\n" "#define ASM_LINE_SEP $libc_cv_asm_line_sep" >>confdefs.h
 
 
-# For big endian ABI, generate a symbol for selecting right dynamic linker
+# ARC big endian ABI is no longer supported.
 
 
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5
diff --git a/sysdeps/arc/configure.ac b/sysdeps/arc/configure.ac
index 4d79ccb00da6..48dc6f5b9b13 100644
--- a/sysdeps/arc/configure.ac
+++ b/sysdeps/arc/configure.ac
@@ -9,7 +9,7 @@  libc_cv_have_sdata_section=no
 libc_cv_asm_line_sep='`'
 AC_DEFINE_UNQUOTED(ASM_LINE_SEP, $libc_cv_asm_line_sep)
 
-# For big endian ABI, generate a symbol for selecting right dynamic linker
+# ARC big endian ABI is no longer supported.
 AC_CACHE_CHECK([for big endian],
   [libc_cv_arc_be],
   [AC_EGREP_CPP(yes,[#ifdef __BIG_ENDIAN__
diff --git a/sysdeps/unix/sysv/linux/arc/Makefile b/sysdeps/unix/sysv/linux/arc/Makefile
index eca9a9fd3a55..dd3da52c394c 100644
--- a/sysdeps/unix/sysv/linux/arc/Makefile
+++ b/sysdeps/unix/sysv/linux/arc/Makefile
@@ -11,12 +11,3 @@  ifeq ($(subdir),misc)
 sysdep_headers += sys/cachectl.h
 sysdep_routines += cacheflush
 endif
-
-abi-variants := arcle arcbe
-
-ifeq (,$(filter $(default-abi),$(abi-variants)))
-$(error Unknown ABI $(default-abi), must be one of $(abi-variants))
-endif
-
-abi-arcle-condition := !defined __BIG_ENDIAN__
-abi-arcbe-condition := defined __BIG_ENDIAN__