changeset 1213:4db6f80bd483

dev/lldb: fix build with musl
author David Demelier <markand@malikania.fr>
date Tue, 19 Nov 2019 20:05:00 +0100
parents 38fb7d4d0335
children fccafe36014b
files dev/lldb/lldb.sh dev/lldb/patch-musl.patch
diffstat 2 files changed, 172 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dev/lldb/lldb.sh	Fri Nov 15 20:20:00 2019 +0100
+++ b/dev/lldb/lldb.sh	Tue Nov 19 20:05:00 2019 +0100
@@ -59,6 +59,7 @@
 	tar xvf $PKGNAME-$PKGVERSION.src.tar.xz
 	cd $PKGNAME-$PKGVERSION.src
 
+	patch -p0 < ../patch-musl.patch
 	mkdir build && cd build
 	cmake .. -Wno-dev \
 		-DCMAKE_BUILD_TYPE=Release \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dev/lldb/patch-musl.patch	Tue Nov 19 20:05:00 2019 +0100
@@ -0,0 +1,171 @@
+--- source/API/SBStream.cpp.orig	2019-11-15 09:29:17.692459204 +0100
++++ source/API/SBStream.cpp	2019-11-15 09:29:29.880459578 +0100
+@@ -105,7 +105,7 @@
+ }
+ 
+ void SBStream::RedirectToFileHandle(FILE *fh, bool transfer_fh_ownership) {
+-  LLDB_RECORD_METHOD(void, SBStream, RedirectToFileHandle, (FILE *, bool), fh,
++  LLDB_RECORD_DUMMY(void, SBStream, RedirectToFileHandle, (FILE *, bool), fh,
+                      transfer_fh_ownership);
+ 
+   if (fh == nullptr)
+--- source/API/SBCommandReturnObject.cpp.orig	2019-11-18 08:52:26.912463944 +0000
++++ source/API/SBCommandReturnObject.cpp	2019-11-18 08:53:28.696465842 +0000
+@@ -106,7 +106,7 @@
+ }
+ 
+ size_t SBCommandReturnObject::PutOutput(FILE *fh) {
+-  LLDB_RECORD_METHOD(size_t, SBCommandReturnObject, PutOutput, (FILE *), fh);
++  LLDB_RECORD_DUMMY(size_t, SBCommandReturnObject, PutOutput, (FILE *), fh);
+ 
+   if (fh) {
+     size_t num_bytes = GetOutputSize();
+@@ -117,7 +117,7 @@
+ }
+ 
+ size_t SBCommandReturnObject::PutError(FILE *fh) {
+-  LLDB_RECORD_METHOD(size_t, SBCommandReturnObject, PutError, (FILE *), fh);
++  LLDB_RECORD_DUMMY(size_t, SBCommandReturnObject, PutError, (FILE *), fh);
+ 
+   if (fh) {
+     size_t num_bytes = GetErrorSize();
+@@ -230,14 +230,14 @@
+ }
+ 
+ void SBCommandReturnObject::SetImmediateOutputFile(FILE *fh) {
+-  LLDB_RECORD_METHOD(void, SBCommandReturnObject, SetImmediateOutputFile,
++  LLDB_RECORD_DUMMY(void, SBCommandReturnObject, SetImmediateOutputFile,
+                      (FILE *), fh);
+ 
+   SetImmediateOutputFile(fh, false);
+ }
+ 
+ void SBCommandReturnObject::SetImmediateErrorFile(FILE *fh) {
+-  LLDB_RECORD_METHOD(void, SBCommandReturnObject, SetImmediateErrorFile,
++  LLDB_RECORD_DUMMY(void, SBCommandReturnObject, SetImmediateErrorFile,
+                      (FILE *), fh);
+ 
+   SetImmediateErrorFile(fh, false);
+@@ -245,7 +245,7 @@
+ 
+ void SBCommandReturnObject::SetImmediateOutputFile(FILE *fh,
+                                                    bool transfer_ownership) {
+-  LLDB_RECORD_METHOD(void, SBCommandReturnObject, SetImmediateOutputFile,
++  LLDB_RECORD_DUMMY(void, SBCommandReturnObject, SetImmediateOutputFile,
+                      (FILE *, bool), fh, transfer_ownership);
+ 
+   if (m_opaque_up)
+@@ -254,7 +254,7 @@
+ 
+ void SBCommandReturnObject::SetImmediateErrorFile(FILE *fh,
+                                                   bool transfer_ownership) {
+-  LLDB_RECORD_METHOD(void, SBCommandReturnObject, SetImmediateErrorFile,
++  LLDB_RECORD_DUMMY(void, SBCommandReturnObject, SetImmediateErrorFile,
+                      (FILE *, bool), fh, transfer_ownership);
+ 
+   if (m_opaque_up)
+--- source/API/SBDebugger.cpp.orig	2019-11-18 08:59:25.852476813 +0000
++++ source/API/SBDebugger.cpp	2019-11-18 09:06:47.496490379 +0000
+@@ -339,7 +339,7 @@
+ // of problems; don't want users trying to switch modes in the middle of a
+ // debugging session.
+ void SBDebugger::SetInputFileHandle(FILE *fh, bool transfer_ownership) {
+-  LLDB_RECORD_METHOD(void, SBDebugger, SetInputFileHandle, (FILE *, bool), fh,
++  LLDB_RECORD_DUMMY(void, SBDebugger, SetInputFileHandle, (FILE *, bool), fh,
+                      transfer_ownership);
+ 
+   if (!m_opaque_sp)
+@@ -357,7 +357,7 @@
+ }
+ 
+ void SBDebugger::SetOutputFileHandle(FILE *fh, bool transfer_ownership) {
+-  LLDB_RECORD_METHOD(void, SBDebugger, SetOutputFileHandle, (FILE *, bool), fh,
++  LLDB_RECORD_DUMMY(void, SBDebugger, SetOutputFileHandle, (FILE *, bool), fh,
+                      transfer_ownership);
+ 
+   if (m_opaque_sp)
+@@ -365,7 +365,7 @@
+ }
+ 
+ void SBDebugger::SetErrorFileHandle(FILE *fh, bool transfer_ownership) {
+-  LLDB_RECORD_METHOD(void, SBDebugger, SetErrorFileHandle, (FILE *, bool), fh,
++  LLDB_RECORD_DUMMY(void, SBDebugger, SetErrorFileHandle, (FILE *, bool), fh,
+                      transfer_ownership);
+ 
+ 
+@@ -376,33 +376,18 @@
+ FILE *SBDebugger::GetInputFileHandle() {
+   LLDB_RECORD_METHOD_NO_ARGS(FILE *, SBDebugger, GetInputFileHandle);
+ 
+-  if (m_opaque_sp) {
+-    StreamFileSP stream_file_sp(m_opaque_sp->GetInputFile());
+-    if (stream_file_sp)
+-      return LLDB_RECORD_RESULT(stream_file_sp->GetFile().GetStream());
+-  }
+   return nullptr;
+ }
+ 
+ FILE *SBDebugger::GetOutputFileHandle() {
+   LLDB_RECORD_METHOD_NO_ARGS(FILE *, SBDebugger, GetOutputFileHandle);
+ 
+-  if (m_opaque_sp) {
+-    StreamFileSP stream_file_sp(m_opaque_sp->GetOutputFile());
+-    if (stream_file_sp)
+-      return LLDB_RECORD_RESULT(stream_file_sp->GetFile().GetStream());
+-  }
+   return nullptr;
+ }
+ 
+ FILE *SBDebugger::GetErrorFileHandle() {
+   LLDB_RECORD_METHOD_NO_ARGS(FILE *, SBDebugger, GetErrorFileHandle);
+ 
+-  if (m_opaque_sp) {
+-    StreamFileSP stream_file_sp(m_opaque_sp->GetErrorFile());
+-    if (stream_file_sp)
+-      return LLDB_RECORD_RESULT(stream_file_sp->GetFile().GetStream());
+-  }
+   return nullptr;
+ }
+ 
+@@ -483,7 +468,7 @@
+ void SBDebugger::HandleProcessEvent(const SBProcess &process,
+                                     const SBEvent &event, FILE *out,
+                                     FILE *err) {
+-  LLDB_RECORD_METHOD(
++  LLDB_RECORD_DUMMY(
+       void, SBDebugger, HandleProcessEvent,
+       (const lldb::SBProcess &, const lldb::SBEvent &, FILE *, FILE *), process,
+       event, out, err);
+--- source/API/SBInstruction.cpp.orig	2019-11-18 09:18:56.628512777 +0000
++++ source/API/SBInstruction.cpp	2019-11-18 09:19:17.728513425 +0000
+@@ -256,7 +256,7 @@
+ }
+ 
+ void SBInstruction::Print(FILE *out) {
+-  LLDB_RECORD_METHOD(void, SBInstruction, Print, (FILE *), out);
++  LLDB_RECORD_DUMMY(void, SBInstruction, Print, (FILE *), out);
+ 
+   if (out == nullptr)
+     return;
+--- source/API/SBInstructionList.cpp.orig	2019-11-18 09:22:29.268519309 +0000
++++ source/API/SBInstructionList.cpp	2019-11-18 09:22:37.372519558 +0000
+@@ -117,7 +117,7 @@
+ }
+ 
+ void SBInstructionList::Print(FILE *out) {
+-  LLDB_RECORD_METHOD(void, SBInstructionList, Print, (FILE *), out);
++  LLDB_RECORD_DUMMY(void, SBInstructionList, Print, (FILE *), out);
+ 
+   if (out == nullptr)
+     return;
+--- source/API/SBProcess.cpp.orig	2019-11-18 11:41:31.220775555 +0000
++++ source/API/SBProcess.cpp	2019-11-18 11:42:28.364777311 +0000
+@@ -332,7 +332,7 @@
+ }
+ 
+ void SBProcess::ReportEventState(const SBEvent &event, FILE *out) const {
+-  LLDB_RECORD_METHOD_CONST(void, SBProcess, ReportEventState,
++  LLDB_RECORD_DUMMY(void, SBProcess, ReportEventState,
+                            (const lldb::SBEvent &, FILE *), event, out);
+ 
+   if (out == nullptr)