diff mbox series

package/libunwind: Upstep to v1.6.2

Message ID b3533f15-b70a-9c5c-7509-f372d9f60994@essensium.com
State Accepted
Headers show
Series package/libunwind: Upstep to v1.6.2 | expand

Commit Message

Frederik Van Bogaert June 14, 2022, 5:03 p.m. UTC
This also removes an old patch to fix atomic_ops for ARM pre-ARMv6.
atomic_ops support has been replaced with C11 atomics, so the patch
     did not apply anymore, and should be unnecessary.

This does mean compilation will fail with systems that don't support
     C11 atomics, i.e. GCC versions older than 4.9

Signed-off-by: Frederik Van Bogaert <frederik.vanbogaert@mind.be>
---
  ...O_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch | 56 -------------------
  package/libunwind/Config.in                   |  2 +
  package/libunwind/libunwind.hash              |  2 +-
  package/libunwind/libunwind.mk                |  6 +-
  4 files changed, 4 insertions(+), 62 deletions(-)
  delete mode 100644 
package/libunwind/0001-Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch

      --disable-tests \
      $(if 
$(BR2_INSTALL_LIBSTDCPP),--enable-cxx-exceptions,--disable-cxx-exceptions)
-ifeq ($(BR2_PACKAGE_LIBATOMIC_OPS),y)
-LIBUNWIND_DEPENDENCIES += libatomic_ops
-endif
-
  $(eval $(autotools-package))

Comments

Arnout Vandecappelle July 23, 2022, 5:18 p.m. UTC | #1
On 14/06/2022 19:03, Frederik Van Bogaert wrote:
> This also removes an old patch to fix atomic_ops for ARM pre-ARMv6.
> atomic_ops support has been replaced with C11 atomics, so the patch
>      did not apply anymore, and should be unnecessary.
> 
> This does mean compilation will fail with systems that don't support
>      C11 atomics, i.e. GCC versions older than 4.9
> 
> Signed-off-by: Frederik Van Bogaert <frederik.vanbogaert@mind.be>
> ---
>   ...O_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch | 56 -------------------
>   package/libunwind/Config.in                   |  2 +
>   package/libunwind/libunwind.hash              |  2 +-
>   package/libunwind/libunwind.mk                |  6 +-
>   4 files changed, 4 insertions(+), 62 deletions(-)

[snip]
> diff --git a/package/libunwind/Config.in b/package/libunwind/Config.in
> index 5284b5864c..b914cd46f7 100644
> --- a/package/libunwind/Config.in
> +++ b/package/libunwind/Config.in
> @@ -23,6 +23,8 @@ config BR2_PACKAGE_LIBUNWIND
>       bool "libunwind"
>       depends on BR2_TOOLCHAIN_HAS_THREADS
>       depends on BR2_PACKAGE_LIBUNWIND_ARCH_SUPPORTS
> +    # GCC 4.9 is the first to implement C11 atomics
> +    depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9

  This also needs to be added to the comment below:

comment "libunwind needs a toolchain w/ threads, dynamic library, gcc >= 4.9"
	depends on BR2_PACKAGE_LIBUNWIND_ARCH_SUPPORTS
	depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS || \
		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_9

  Applied to master with that fixed, thanks.

  Regards,
  Arnout

>       # forcefully links against libgcc_s, only available in dynamic
>       # linking configurations
>       depends on !BR2_STATIC_LIBS
> diff --git a/package/libunwind/libunwind.hash b/package/libunwind/libunwind.hash
> index de00c59988..1d532a7830 100644
> --- a/package/libunwind/libunwind.hash
> +++ b/package/libunwind/libunwind.hash
> @@ -1,5 +1,5 @@
>   # Locally calculated after checking pgp signature
> -sha256 90337653d92d4a13de590781371c604f9031cdb50520366aa1e3a91e1efb1017 
> libunwind-1.5.0.tar.gz
> +sha256 4a6aec666991fb45d0889c44aede8ad6eb108071c3554fcdff671f9c94794976 
> libunwind-1.6.2.tar.gz
>   # Hash for license file
>   sha256 6a0dbbdaec2b3136b7bf045586f4212bdf74e7af688bf9dfe9154607cf5ec156 COPYING
> diff --git a/package/libunwind/libunwind.mk b/package/libunwind/libunwind.mk
> index aaa33464a9..9cd587d0a3 100644
> --- a/package/libunwind/libunwind.mk
> +++ b/package/libunwind/libunwind.mk
> @@ -4,7 +4,7 @@
>   #
>   ################################################################################
> -LIBUNWIND_VERSION = 1.5.0
> +LIBUNWIND_VERSION = 1.6.2
>   LIBUNWIND_SITE = http://download.savannah.gnu.org/releases/libunwind
>   LIBUNWIND_INSTALL_STAGING = YES
>   LIBUNWIND_LICENSE_FILES = COPYING
> @@ -16,8 +16,4 @@ LIBUNWIND_CONF_OPTS = \
>       --disable-tests \
>       $(if 
> $(BR2_INSTALL_LIBSTDCPP),--enable-cxx-exceptions,--disable-cxx-exceptions)
> -ifeq ($(BR2_PACKAGE_LIBATOMIC_OPS),y)
> -LIBUNWIND_DEPENDENCIES += libatomic_ops
> -endif
> -
>   $(eval $(autotools-package))
>
diff mbox series

Patch

diff --git 
a/package/libunwind/0001-Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch 
b/package/libunwind/0001-Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch
deleted file mode 100644
index 2a37ed7784..0000000000
--- a/package/libunwind/0001-Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch
+++ /dev/null
@@ -1,56 +0,0 @@ 
-From 24484e80b3e329c9edee1995e102f8612eedb79c Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-Date: Tue, 13 May 2014 23:32:27 +0200
-Subject: [PATCH] Add AO_REQUIRE_CAS to fix build on ARM < v6
-
-ARM earlier than ARMv6, such as ARMv4 and ARMv5 do not provide
-optimize atomic operations in libatomic_ops. Since libunwind is using
-such operations, it should define AO_REQUIRE_CAS before including
-<atomic_ops.h> so that libatomic_ops knows it should use emulated
-atomic operations instead (even though they are obviously a lot more
-expensive).
-
-Also, while real atomic operations are all inline functions and
-therefore linking against libatomic_ops was not required, the emulated
-atomic operations actually require linking against libatomic_ops, so
-the commented AC_CHECK_LIB test in acinclude.m4 is uncommented to make
-sure we link against libatomic_ops.
-
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
----
- acinclude.m4          | 8 +-------
- include/libunwind_i.h | 1 +
- 2 files changed, 2 insertions(+), 7 deletions(-)
-
-diff --git a/acinclude.m4 b/acinclude.m4
-index 497f7c2..9c15af1 100644
---- a/acinclude.m4
-+++ b/acinclude.m4
-@@ -22,11 +22,5 @@ fi])
- AC_DEFUN([CHECK_ATOMIC_OPS],
- [dnl Check whether the system has the atomic_ops package installed.
-   AC_CHECK_HEADERS(atomic_ops.h)
--#
--# Don't link against libatomic_ops for now.  We don't want libunwind
--# to depend on libatomic_ops.so.  Fortunately, none of the platforms
--# we care about so far need libatomic_ops.a (everything is done via
--# inline macros).
--#
--#  AC_CHECK_LIB(atomic_ops, main)
-+  AC_CHECK_LIB(atomic_ops, main)
- ])
-diff --git a/include/libunwind_i.h b/include/libunwind_i.h
-index 23f615e..deabdfd 100644
---- a/include/libunwind_i.h
-+++ b/include/libunwind_i.h
-@@ -95,6 +95,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.  */
-     (pthread_mutex_unlock != NULL ? pthread_mutex_unlock (l) : 0)
-
- #ifdef HAVE_ATOMIC_OPS_H
-+# define AO_REQUIRE_CAS
- # include <atomic_ops.h>
- static inline int
- cmpxchg_ptr (void *addr, void *old, void *new)
---
-1.9.2
-
diff --git a/package/libunwind/Config.in b/package/libunwind/Config.in
index 5284b5864c..b914cd46f7 100644
--- a/package/libunwind/Config.in
+++ b/package/libunwind/Config.in
@@ -23,6 +23,8 @@  config BR2_PACKAGE_LIBUNWIND
      bool "libunwind"
      depends on BR2_TOOLCHAIN_HAS_THREADS
      depends on BR2_PACKAGE_LIBUNWIND_ARCH_SUPPORTS
+    # GCC 4.9 is the first to implement C11 atomics
+    depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
      # forcefully links against libgcc_s, only available in dynamic
      # linking configurations
      depends on !BR2_STATIC_LIBS
diff --git a/package/libunwind/libunwind.hash 
b/package/libunwind/libunwind.hash
index de00c59988..1d532a7830 100644
--- a/package/libunwind/libunwind.hash
+++ b/package/libunwind/libunwind.hash
@@ -1,5 +1,5 @@ 
  # Locally calculated after checking pgp signature
-sha256 90337653d92d4a13de590781371c604f9031cdb50520366aa1e3a91e1efb1017 
libunwind-1.5.0.tar.gz
+sha256 4a6aec666991fb45d0889c44aede8ad6eb108071c3554fcdff671f9c94794976 
libunwind-1.6.2.tar.gz
  # Hash for license file
  sha256 
6a0dbbdaec2b3136b7bf045586f4212bdf74e7af688bf9dfe9154607cf5ec156 COPYING
diff --git a/package/libunwind/libunwind.mk b/package/libunwind/libunwind.mk
index aaa33464a9..9cd587d0a3 100644
--- a/package/libunwind/libunwind.mk
+++ b/package/libunwind/libunwind.mk
@@ -4,7 +4,7 @@ 
  #
  ################################################################################
-LIBUNWIND_VERSION = 1.5.0
+LIBUNWIND_VERSION = 1.6.2
  LIBUNWIND_SITE = http://download.savannah.gnu.org/releases/libunwind
  LIBUNWIND_INSTALL_STAGING = YES
  LIBUNWIND_LICENSE_FILES = COPYING
@@ -16,8 +16,4 @@  LIBUNWIND_CONF_OPTS = \