Index: source/Host/linux/HostThreadLinux.cpp =================================================================== --- source/Host/linux/HostThreadLinux.cpp +++ source/Host/linux/HostThreadLinux.cpp @@ -30,12 +30,18 @@ void HostThreadLinux::SetName(lldb::thread_t thread, llvm::StringRef name) { +#if defined(__GLIBC__) && defined(_GNU_SOURCE) ::pthread_setname_np(thread, name.data()); +#else + (void) thread; + (void) name; +#endif } void HostThreadLinux::GetName(lldb::thread_t thread, llvm::SmallVectorImpl &name) { +#if defined(__GLIBC__) && defined(_GNU_SOURCE) // Read /proc/$TID/comm file. lldb::DataBufferSP buf_sp = process_linux::ProcFileReader::ReadIntoDataBuffer(thread, "comm"); const char *comm_str = (const char *)buf_sp->GetBytes(); @@ -44,4 +50,8 @@ name.clear(); name.append(comm_str, comm_str + length); +#else + (void) thread; + (void) name; +#endif }