[Bug 233664] enable LLVM libunwind for armv7, armv6, arm

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Nov 30 13:57:28 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233664

            Bug ID: 233664
           Summary: enable LLVM libunwind for armv7, armv6, arm
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: misc
          Assignee: bugs at FreeBSD.org
          Reporter: emaste at freebsd.org
            Blocks: 233094

arm currently uses Clang and LLD, but LLVM_LIBUNWIND is not enabled.

For armv7 there are a couple of minor conflicts with other unwind helpers, and
we need to update the symbol version map.  The hack below gets it to build, but
needs to be cleaned up.

arm and armv6 fail with:
/.../arm.arm/tmp/usr/lib/libcxxrt.so: undefined reference to
`__gnu_unwind_frame at GCC_3.5'
/.../arm.arm/tmp/usr/lib/libcxxrt.so: undefined reference to
`_Unwind_VRS_Set at GCC_3.5'
/.../arm.arm/tmp/usr/lib/libcxxrt.so: undefined reference to
`_Unwind_VRS_Get at GCC_3.5'

armv7 hack patch:

diff --git a/contrib/compiler-rt/lib/builtins/gcc_personality_v0.c
b/contrib/compiler-rt/lib/builtins/gcc_personality_v0.c
index 0bc765624564..034d323814c4 100644
--- a/contrib/compiler-rt/lib/builtins/gcc_personality_v0.c
+++ b/contrib/compiler-rt/lib/builtins/gcc_personality_v0.c
@@ -145,6 +145,7 @@ static uintptr_t readEncodedPointer(const uint8_t** data,
uint8_t encoding)
 #if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) &&                
\
     !defined(__ARM_DWARF_EH__)
 #define USING_ARM_EHABI 1
+struct _Unwind_Exception;
 _Unwind_Reason_Code __gnu_unwind_frame(struct _Unwind_Exception *,
                                        struct _Unwind_Context *);
 #endif
diff --git a/contrib/compiler-rt/lib/builtins/unwind-ehabi-helpers.h
b/contrib/compiler-rt/lib/builtins/unwind-ehabi-helpers.h
index ccb0765975a9..864dba716e9b 100644
--- a/contrib/compiler-rt/lib/builtins/unwind-ehabi-helpers.h
+++ b/contrib/compiler-rt/lib/builtins/unwind-ehabi-helpers.h
@@ -39,8 +39,6 @@
 #define _URC_OK       0
 #define _URC_FAILURE  9

-typedef uint32_t _Unwind_State;
-
 #if !defined(_US_UNWIND_FRAME_STARTING)
 #define _US_UNWIND_FRAME_STARTING ((_Unwind_State)1)
 #endif
diff --git a/lib/libgcc_s/Version.map b/lib/libgcc_s/Version.map
index 622732edb447..42a3b757d513 100644
--- a/lib/libgcc_s/Version.map
+++ b/lib/libgcc_s/Version.map
@@ -126,6 +126,12 @@ GCC_3.4.4 {
        __subvti3;
 } GCC_3.4.2;

+GCC_3.5 {
+       __aeabi_unwind_cpp_pr0;
+       __aeabi_unwind_cpp_pr1;
+       __aeabi_unwind_cpp_pr2;
+};
+
 GCC_4.0.0 {
        __divdc3;
        __divsc3;


Referenced Bugs:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233094
[Bug 233094] [meta] Base system tool chain modernization tracking
-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list