git: 33b6e6744554 - stable/12 - Reapply r355803 (by mmel):

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Wed, 22 Dec 2021 10:05:43 UTC
The branch stable/12 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=33b6e67445548c4a5e81fe6d626dbb29c9246042

commit 33b6e67445548c4a5e81fe6d626dbb29c9246042
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2020-08-06 19:08:28 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2021-12-22 09:58:21 +0000

    Reapply r355803 (by mmel):
    
    Fix LLVM libunwnwind _Unwind_Backtrace symbol version for ARM.
    In original  GNU libgcc, _Unwind_Backtrace is published with GCC_3.3 version
    for all architectures but ARM. For ARM should be publishes with GCC_4.3.0
    version. This was originally omitted in r255095, fixed in r318024 and omitted
    aging in LLVM libunwind implementation in r354347.
    
    For ARM _Unwind_Backtrace should be published as default with GCC_4.3.0
    version , (because this is right original version) and again as
    normal(not-default) with GCC_3.3 version (to maintain ABI compatibility
    compiled/linked with wrong pre r318024 libgcc)
    
    PR:     233664
    (cherry picked from commit e8141ad1df2098dd3f6d627c49ce99307315f5fd)
---
 contrib/llvm-project/libunwind/src/UnwindLevel1-gcc-ext.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/contrib/llvm-project/libunwind/src/UnwindLevel1-gcc-ext.c b/contrib/llvm-project/libunwind/src/UnwindLevel1-gcc-ext.c
index 30f9cabf241f..ca1a972fc124 100644
--- a/contrib/llvm-project/libunwind/src/UnwindLevel1-gcc-ext.c
+++ b/contrib/llvm-project/libunwind/src/UnwindLevel1-gcc-ext.c
@@ -181,6 +181,10 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref) {
     }
   }
 }
+#ifdef __arm__
+/* Preserve legacy libgcc (pre r318024) ARM ABI mistake */
+__sym_compat(_Unwind_Backtrace, _Unwind_Backtrace, GCC_3.3);
+#endif
 
 
 /// Find DWARF unwind info for an address 'pc' in some function.