Index: llvm/lib/Support/CMakeLists.txt =================================================================== --- llvm/lib/Support/CMakeLists.txt +++ llvm/lib/Support/CMakeLists.txt @@ -36,6 +36,10 @@ if( FUCHSIA ) set(system_libs ${system_libs} zircon) endif() + if ( HAIKU ) + add_definitions(-D_BSD_SOURCE) + set(system_libs ${system_libs} bsd) + endif() endif( MSVC OR MINGW ) # Delay load shell32.dll if possible to speed up process startup. Index: llvm/lib/Support/Unix/Program.inc =================================================================== --- llvm/lib/Support/Unix/Program.inc +++ llvm/lib/Support/Unix/Program.inc @@ -448,8 +448,12 @@ if (ProcStat) { std::chrono::microseconds UserT = toDuration(Info.ru_utime); std::chrono::microseconds KernelT = toDuration(Info.ru_stime); +#ifndef __HAIKU__ uint64_t PeakMemory = static_cast(Info.ru_maxrss); *ProcStat = ProcessStatistics{UserT + KernelT, UserT, PeakMemory}; +#else + *ProcStat = ProcessStatistics{UserT + KernelT, UserT, 0}; +#endif } // Return the proper exit status. Detect error conditions