Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Feb 2022 20:47:50 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: bbf4df172206 - main - libthr: Disable stack unwinding on ARM.
Message-ID:  <202202102047.21AKloo2016930@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb:

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

commit bbf4df1722060fb78939419476fb624114fb303d
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-02-10 20:47:08 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-02-10 20:47:08 +0000

    libthr: Disable stack unwinding on ARM.
    
    When a thread exits, _Unwind_ForcedUnwind() is used to walk up stack
    frames executing pending cleanups pushed by pthread_cleanup_push().
    The cleanups are popped by thread_unwind_stop() which is passed as a
    callback function to _Unwind_ForcedUnwind().
    
    LLVM's libunwind uses a different function type for the callback on
    32-bit ARM relative to all other platforms.  The previous unwind.h
    header (as well as the unwind.h from libcxxrt) use the non-ARM type on
    all platforms, so this has likely been broken on 32-bit arm since it
    switched to using LLVM's libunwind.
    
    For now, just disable stack unwinding on 32-bit arm to unbreak the
    build until a proper fix is tested.
---
 lib/libthr/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/libthr/Makefile b/lib/libthr/Makefile
index 8fbd685e9f4b..062f5eec5d88 100644
--- a/lib/libthr/Makefile
+++ b/lib/libthr/Makefile
@@ -35,6 +35,10 @@ CFLAGS.thr_symbols.c+=	-Wno-missing-variable-declarations
 CFLAGS.thr_sig.c+=	-fno-sanitize=address
 .endif
 
+.if ${MACHINE_CPUARCH} == "arm"
+NO_THREAD_UNWIND_STACK= yes
+.endif
+
 .ifndef NO_THREAD_UNWIND_STACK
 CFLAGS+=-fexceptions
 CFLAGS+=-D_PTHREAD_FORCED_UNWIND



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202202102047.21AKloo2016930>