git: 0f497b4088a2 - main - devel/libunwind: Fix build on 14-CURRENT on armv6/armv7

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Tue, 02 May 2023 16:27:27 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0f497b4088a2053bffbdc534bac05f21a9a3f9e7

commit 0f497b4088a2053bffbdc534bac05f21a9a3f9e7
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-05-02 16:17:41 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-05-02 16:17:41 +0000

    devel/libunwind: Fix build on 14-CURRENT on armv6/armv7
    
    ptrace/_UPT_access_fpreg.c:107:25: error: no member named 'fpr' in 'struct fpreg'
              memcpy(&fpreg.fpr[reg], val, sizeof(unw_fpreg_t));
                      ~~~~~ ^
    ptrace/_UPT_access_fpreg.c:123:30: error: no member named 'fpr' in 'struct fpreg'
              memcpy(val, &fpreg.fpr[reg], sizeof(unw_fpreg_t));
                           ~~~~~ ^
    2 errors generated.
    
    Reported by:    Mark Millard <marklmi@yahoo.com>
    Obtained from:  https://github.com/libunwind/libunwind/commit/99fb31d5f05ff6c96ca3a9350c792618fab23f2d
    Reference:      https://pkg-status.freebsd.org/beefy8/data/main-armv6-default/pdf5b273c8e36_s83d5725005/logs/libunwind-20211201_2.log
                    https://pkg-status.freebsd.org/ampere2/data/main-armv7-default/p519c178336e5_scb3c414f2f/logs/libunwind-20211201_2.log
---
 devel/libunwind/files/patch-armv7 | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/devel/libunwind/files/patch-armv7 b/devel/libunwind/files/patch-armv7
new file mode 100644
index 000000000000..e22e4b42fbd4
--- /dev/null
+++ b/devel/libunwind/files/patch-armv7
@@ -0,0 +1,29 @@
+Obtained from:	https://github.com/libunwind/libunwind/commit/99fb31d5f05ff6c96ca3a9350c792618fab23f2d
+
+--- src/ptrace/_UPT_access_fpreg.c.orig	2021-11-26 16:58:55 UTC
++++ src/ptrace/_UPT_access_fpreg.c
+@@ -104,7 +104,11 @@ _UPT_access_fpreg (unw_addr_space_t as, unw_regnum_t r
+ #elif defined(__i386__)
+           memcpy(&fpreg.fpr_acc[reg], val, sizeof(unw_fpreg_t));
+ #elif defined(__arm__)
++#  if __FreeBSD_version >= 1400079
++          memcpy(&fpreg.fpr_r[reg], val, sizeof(unw_fpreg_t));
++#  else
+           memcpy(&fpreg.fpr[reg], val, sizeof(unw_fpreg_t));
++#  endif
+ #elif defined(__aarch64__)
+           memcpy(&fpreg.fp_q[reg], val, sizeof(unw_fpreg_t));
+ #elif defined(__powerpc64__)
+@@ -120,7 +124,11 @@ _UPT_access_fpreg (unw_addr_space_t as, unw_regnum_t r
+ #elif defined(__i386__)
+           memcpy(val, &fpreg.fpr_acc[reg], sizeof(unw_fpreg_t));
+ #elif defined(__arm__)
+-          memcpy(val, &fpreg.fpr[reg], sizeof(unw_fpreg_t));
++#  if __FreeBSD_version >= 1400079
++          memcpy(&fpreg.fpr_r[reg], val, sizeof(unw_fpreg_t));
++#  else
++          memcpy(&fpreg.fpr[reg], val, sizeof(unw_fpreg_t));
++#  endif
+ #elif defined(__aarch64__)
+           memcpy(val, &fpreg.fp_q[reg], sizeof(unw_fpreg_t));
+ #elif defined(__powerpc64__)