set env UNW_ARM_UNWIND_METHOD value on ARM platform 56/126756/4
authorInhwan Lee <ideal.lee@samsung.com>
Tue, 25 Apr 2017 04:55:35 +0000 (13:55 +0900)
committerInhwan Lee <ideal.lee@samsung.com>
Tue, 25 Apr 2017 07:02:43 +0000 (16:02 +0900)
Change-Id: Iab10502bc55f5bea33cf553a14838bdb56f6afd2

NativeLauncher/launcher/dotnet/dotnet_launcher.cc
NativeLauncher/launcher/dotnet/scd_launcher.cc

index d3df80e..c0b5300 100644 (file)
@@ -73,6 +73,20 @@ CoreRuntime::~CoreRuntime()
 
 int CoreRuntime::initialize(bool standalone)
 {
+#ifdef __arm__
+       // libunwind library is used to unwind stack frame, but libunwind for ARM
+       // does not support ARM vfpv3/NEON registers in DWARF format correctly.
+       // Therefore let's disable stack unwinding using DWARF information
+       // See https://github.com/dotnet/coreclr/issues/6698
+       //
+       // libunwind use following methods to unwind stack frame.
+       // UNW_ARM_METHOD_ALL          0xFF
+       // UNW_ARM_METHOD_DWARF        0x01
+       // UNW_ARM_METHOD_FRAME        0x02
+       // UNW_ARM_METHOD_EXIDX        0x04
+       putenv(const_cast<char *>("UNW_ARM_UNWIND_METHOD=6"));
+#endif // __arm__
+
        if (standalone) {
                const char *deviceApiDirectory = getenv("__deviceAPIDirectory");
                const char *runtimeDirectory = getenv("__runtimeDirectory");
index 029e93c..7bbd883 100644 (file)
@@ -266,7 +266,7 @@ int executeManagedAssembly(const char* currentExeAbsolutePath,
        // Indicates failure
        int exitCode = -1;
 
-#ifdef _ARM_
+#ifdef __arm__
        // libunwind library is used to unwind stack frame, but libunwind for ARM
        // does not support ARM vfpv3/NEON registers in DWARF format correctly.
        // Therefore let's disable stack unwinding using DWARF information
@@ -278,7 +278,7 @@ int executeManagedAssembly(const char* currentExeAbsolutePath,
        // UNW_ARM_METHOD_FRAME                 0x02
        // UNW_ARM_METHOD_EXIDX                 0x04
        putenv(const_cast<char *>("UNW_ARM_UNWIND_METHOD=6"));
-#endif  // _ARM_
+#endif  // __arm__
 
        std::string coreClrDllPath(clrFilesAbsolutePath);
        coreClrDllPath.append("/");