[PATCH] D87114: [CMake][ExecutionEngine] add HAVE_(DE)REGISTER_FRAME as a config.h macros
David Tenty via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 10 10:11:33 PST 2020
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGae032e271467: [CMake][ExecutionEngine] add HAVE_(DE)REGISTER_FRAME as a config.h macros (authored by daltenty).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87114/new/
https://reviews.llvm.org/D87114
Files:
llvm/cmake/config-ix.cmake
llvm/cmake/unwind.h
llvm/include/llvm/Config/config.h.cmake
llvm/lib/ExecutionEngine/JITLink/EHFrameSupport.cpp
llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp
Index: llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp
===================================================================
--- llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp
+++ llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp
@@ -31,16 +31,8 @@
RTDyldMemoryManager::~RTDyldMemoryManager() {}
-// Determine whether we can register EH tables.
-#if (defined(__GNUC__) && !defined(__ARM_EABI__) && !defined(__ia64__) && \
- !(defined(_AIX) && defined(__ibmxl__)) && !defined(__MVS__) && \
- !defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__))
-#define HAVE_EHTABLE_SUPPORT 1
-#else
-#define HAVE_EHTABLE_SUPPORT 0
-#endif
-
-#if HAVE_EHTABLE_SUPPORT
+#if defined(HAVE_REGISTER_FRAME) && defined(HAVE_DEREGISTER_FRAME) && \
+ !defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)
extern "C" void __register_frame(void *);
extern "C" void __deregister_frame(void *);
#else
Index: llvm/lib/ExecutionEngine/JITLink/EHFrameSupport.cpp
===================================================================
--- llvm/lib/ExecutionEngine/JITLink/EHFrameSupport.cpp
+++ llvm/lib/ExecutionEngine/JITLink/EHFrameSupport.cpp
@@ -10,6 +10,7 @@
#include "EHFrameSupportImpl.h"
#include "llvm/BinaryFormat/Dwarf.h"
+#include "llvm/Config/config.h"
#include "llvm/Support/DynamicLibrary.h"
#define DEBUG_TYPE "jitlink"
@@ -629,16 +630,8 @@
return PC.G.addAnonymousSymbol(*B, Addr - B->getAddress(), 0, false, false);
}
-// Determine whether we can register EH tables.
-#if (defined(__GNUC__) && !defined(__ARM_EABI__) && !defined(__ia64__) && \
- !(defined(_AIX) && defined(__ibmxl__)) && !defined(__MVS__) && \
- !defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__))
-#define HAVE_EHTABLE_SUPPORT 1
-#else
-#define HAVE_EHTABLE_SUPPORT 0
-#endif
-
-#if HAVE_EHTABLE_SUPPORT
+#if defined(HAVE_REGISTER_FRAME) && defined(HAVE_DEREGISTER_FRAME) && \
+ !defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)
extern "C" void __register_frame(const void *);
extern "C" void __deregister_frame(const void *);
Index: llvm/include/llvm/Config/config.h.cmake
===================================================================
--- llvm/include/llvm/Config/config.h.cmake
+++ llvm/include/llvm/Config/config.h.cmake
@@ -58,6 +58,12 @@
/* Define if dladdr() is available on this platform. */
#cmakedefine HAVE_DLADDR ${HAVE_DLADDR}
+/* Define to 1 if we can register EH frames on this platform. */
+#cmakedefine HAVE_REGISTER_FRAME ${HAVE_REGISTER_FRAME}
+
+/* Define to 1 if we can deregister EH frames on this platform. */
+#cmakedefine HAVE_DEREGISTER_FRAME ${HAVE_DEREGISTER_FRAME}
+
/* Define to 1 if you have the <errno.h> header file. */
#cmakedefine HAVE_ERRNO_H ${HAVE_ERRNO_H}
Index: llvm/cmake/unwind.h
===================================================================
--- /dev/null
+++ llvm/cmake/unwind.h
@@ -0,0 +1,7 @@
+// NOLINT: llvm-header-guard
+// __register_frame() is used with dynamically generated code to register the
+// FDE for a generated (JIT) code. This header provides protypes, since the gcc
+// version of unwind.h may not, so CMake can check if the corresponding symbols
+// exist in the runtime.
+extern void __register_frame(const void *fde); // NOLINT
+extern void __deregister_frame(const void *fde); // NOLINT
Index: llvm/cmake/config-ix.cmake
===================================================================
--- llvm/cmake/config-ix.cmake
+++ llvm/cmake/config-ix.cmake
@@ -207,6 +207,10 @@
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror=unguarded-availability-new")
endif()
+# Determine whether we can register EH tables.
+check_symbol_exists(__register_frame "${CMAKE_CURRENT_LIST_DIR}/unwind.h" HAVE_REGISTER_FRAME)
+check_symbol_exists(__deregister_frame "${CMAKE_CURRENT_LIST_DIR}/unwind.h" HAVE_DEREGISTER_FRAME)
+
check_symbol_exists(_Unwind_Backtrace "unwind.h" HAVE__UNWIND_BACKTRACE)
check_symbol_exists(getpagesize unistd.h HAVE_GETPAGESIZE)
check_symbol_exists(sysconf unistd.h HAVE_SYSCONF)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87114.304246.patch
Type: text/x-patch
Size: 4098 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201110/17d86e70/attachment.bin>
More information about the llvm-commits
mailing list