lldb 3.4 rc1 is failing with gcc 4.6

Hello,

I am working on the port of lldb on the various Debian architectures
[1]. On some of them (sparc, s390x, powerpc, ia64, ...),
the version of gcc used is 4.6 and lldb fails to build because of this
declaration.
    Mutex *m_mutex = nullptr;
in include/lldb/Utility/Iterable.h

It fails with:

/«BUILDDIR»/llvm-toolchain-3.4-3.4~+rc1/tools/lldb/source/../include/lldb/Utility/Iterable.h:197:22: sorry, unimplemented: non-static data member initializers
/«BUILDDIR»/llvm-toolchain-3.4-3.4~+rc1/tools/lldb/source/../include/lldb/Utility/Iterable.h:197:22: error: 'constexpr' needed for in-class initialization of static data member 'm_mutex' of non-integral type
/«BUILDDIR»/llvm-toolchain-3.4-3.4~+rc1/tools/lldb/source/../include/lldb/Utility/Iterable.h: In constructor 'lldb_private::LockingAdaptedIterable<C, E, A>::LockingAdaptedIterable(C&, lldb_private::Mutex&)':
/«BUILDDIR»/llvm-toolchain-3.4-3.4~+rc1/tools/lldb/source/../include/lldb/Utility/Iterable.h:201:9: error: class 'lldb_private::LockingAdaptedIterable<C, E, A>' does not have any field named 'm_mutex'
/«BUILDDIR»/llvm-toolchain-3.4-3.4~+rc1/tools/lldb/source/../include/lldb/Utility/Iterable.h:203:9: error: 'm_mutex' was not declared in this scope
/«BUILDDIR»/llvm-toolchain-3.4-3.4~+rc1/tools/lldb/source/../include/lldb/Utility/Iterable.h: In constructor 'lldb_private::LockingAdaptedIterable<C, E, A>::LockingAdaptedIterable(lldb_private::LockingAdaptedIterable<C, E, A>&&)':
/«BUILDDIR»/llvm-toolchain-3.4-3.4~+rc1/tools/lldb/source/../include/lldb/Utility/Iterable.h:208:9: error: class 'lldb_private::LockingAdaptedIterable<C, E, A>' does not have any field named 'm_mutex'
/«BUILDDIR»/llvm-toolchain-3.4-3.4~+rc1/tools/lldb/source/../include/lldb/Utility/Iterable.h: In destructor 'lldb_private::LockingAdaptedIterable<C, E, A>::~LockingAdaptedIterable()':
/«BUILDDIR»/llvm-toolchain-3.4-3.4~+rc1/tools/lldb/source/../include/lldb/Utility/Iterable.h:215:13: error: 'm_mutex' was not declared in this scope

Is there a workaround to tackle this limitation ? I could switch to gcc
4.8 but it would break the backport of lldb on http://llvm.org/apt/
(especially on old Ubuntu without gcc 4.8)

Thanks,
Sylvestre

[1] https://buildd.debian.org/status/package.php?p=llvm-toolchain-3.4

The kFreeBSD-amd64 failure there is a missing
lldb_private::Host::LaunchProcess. Is testing for __GLIBC__ as well
reasonable?

diff --git a/source/Host/common/Host.cpp b/source/Host/common/Host.cpp
index d812ae0..787d165 100644
--- a/source/Host/common/Host.cpp
+++ b/source/Host/common/Host.cpp
@@ -1569,7 +1569,7 @@ Host::RunShellCommand (const char *command,
     return error;
}

-#if defined(__linux__) or defined(__FreeBSD__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__GLIBC__)
// The functions below implement process launching via posix_spawn() for Linux
// and FreeBSD.

Hello,

Hello,

I am working on the port of lldb on the various Debian architectures
[1].

The kFreeBSD-amd64 failure there is a missing
lldb_private::Host::LaunchProcess. Is testing for __GLIBC__ as well
reasonable?

diff --git a/source/Host/common/Host.cpp b/source/Host/common/Host.cpp
index d812ae0..787d165 100644
--- a/source/Host/common/Host.cpp
+++ b/source/Host/common/Host.cpp
@@ -1569,7 +1569,7 @@ Host::RunShellCommand (const char *command,
     return error;
}

-#if defined(__linux__) or defined(__FreeBSD__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__GLIBC__)
// The functions below implement process launching via posix_spawn() for Linux
// and FreeBSD.

Actually, your patch fixed my build issue. I was a mix up in the patches
on my side (sorry!)

The llvm toolchain is now fine on debian kfreebsd-{i386,amd64}
https://buildd.debian.org/status/package.php?p=llvm-toolchain-3.4

You can apply this patch.

Thanks,
Sylvestre