summaryrefslogtreecommitdiff
path: root/packaging/Enable_build_with_FEATURE_DBGIPC.patch
blob: ae468780a01620bf5d13956151be3fdefd626f3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 524f53e95807f856aa099ccf4f4a950e0fb9d5dc Mon Sep 17 00:00:00 2001
From: Jonghyun Park <parjong@gmail.com>
Date: Thu, 27 Apr 2017 13:45:39 +0900
Subject: [PATCH] [ARM/Linux] Enable build with FEATURE_DBGIPC=0

---
 src/debug/di/cordb.cpp | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/debug/di/cordb.cpp b/src/debug/di/cordb.cpp
index e6ed44d..8fb67cf 100644
--- a/src/debug/di/cordb.cpp
+++ b/src/debug/di/cordb.cpp
@@ -20,6 +20,13 @@
 #include "dbgtransportmanager.h"
 #endif // FEATURE_DBGIPC_TRANSPORT_DI
 
+#if defined(PLATFORM_UNIX) || defined(__ANDROID__)
+// _aligned_malloc and _aligned_free are unavailable on POSIX and Android
+#define HAVE_ALIGNED_MALLOC 0
+#else
+#define HAVE_ALIGNED_MALLOC 1
+#endif
+
 //********** Globals. *********************************************************
 #ifndef FEATURE_PAL
 HINSTANCE       g_hInst;                // Instance handle to this piece of code.
@@ -499,7 +506,7 @@ DbiGetThreadContext(HANDLE hThread,
     DT_CONTEXT *lpContext)
 {
     // if we aren't local debugging this isn't going to work
-#if !defined(_ARM_) || defined(FEATURE_DBGIPC_TRANSPORT_DI) || defined(__ANDROID__)
+#if !defined(_ARM_) || defined(FEATURE_DBGIPC_TRANSPORT_DI) || !HAVE_ALIGNED_MALLOC
     _ASSERTE(!"Can't use local GetThreadContext remotely, this needed to go to datatarget");
     return FALSE;
 #else
@@ -538,7 +545,7 @@ BOOL
 DbiSetThreadContext(HANDLE hThread,
     const DT_CONTEXT *lpContext)
 {
-#if !defined(_ARM_) || defined(FEATURE_DBGIPC_TRANSPORT_DI) || defined(__ANDROID__)
+#if !defined(_ARM_) || defined(FEATURE_DBGIPC_TRANSPORT_DI) || !HAVE_ALIGNED_MALLOC
     _ASSERTE(!"Can't use local GetThreadContext remotely, this needed to go to datatarget");
     return FALSE;
 #else