git: c33e542eaa66 - stable/12 - Undefine HAVE_(DE)REGISTER_FRAME in llvm's config.h on arm

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Sat, 25 Dec 2021 11:55:31 UTC
The branch stable/12 has been updated by dim:

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

commit c33e542eaa66855bf73889568ed7c1ce50e83cd3
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2021-06-16 18:27:33 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2021-12-25 11:51:08 +0000

    Undefine HAVE_(DE)REGISTER_FRAME in llvm's config.h on arm
    
    Otherwise, the lli tool (enable by WITH_CLANG_EXTRAS) won't link on arm,
    stating that __register_frame is undefined. This function is normally
    provided by libunwind, but explicitly not for the ARM Exception ABI.
    
    Reported by:    oh
    PR:             255570
    MFC after:      6 weeks
    
    (cherry picked from commit f336b45e943c7f9a90ffcea1a6c4c7039e54c73c)
---
 lib/clang/include/llvm/Config/config.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/clang/include/llvm/Config/config.h b/lib/clang/include/llvm/Config/config.h
index d00cb511c9a8..ab8be211be67 100644
--- a/lib/clang/include/llvm/Config/config.h
+++ b/lib/clang/include/llvm/Config/config.h
@@ -59,11 +59,13 @@
 /* Define if dladdr() is available on this platform. */
 #define HAVE_DLADDR 1
 
+#if !defined(__arm__) || defined(__USING_SJLJ_EXCEPTIONS__) || defined(__ARM_DWARF_EH__)
 /* Define to 1 if we can register EH frames on this platform. */
 #define HAVE_REGISTER_FRAME 1
 
 /* Define to 1 if we can deregister EH frames on this platform. */
 #define HAVE_DEREGISTER_FRAME 1
+#endif // !arm || USING_SJLJ_EXCEPTIONS || ARM_DWARF_EH_
 
 /* Define to 1 if you have the <errno.h> header file. */
 #define HAVE_ERRNO_H 1