From 3f640c1037b9ee899a61a4a9de941524e3bb738b Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Wed, 22 May 2024 09:36:24 +0000 Subject: [PATCH] Fix compilation errors with musl libc 1. According to POSIX specification, basename(3) belongs to libgen.h 2. __cpu_mask is an internal type of glibc's cpu_set implementation, not part of the POSIX definition, so musl does not support it too. Signed-off-by: Sv. Lockal --- rocclr/os/os.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rocclr/os/os.hpp b/rocclr/os/os.hpp index 8509cc362..9b8689207 100644 --- a/rocclr/os/os.hpp +++ b/rocclr/os/os.hpp @@ -29,6 +29,7 @@ #if defined(__linux__) #include +#include #endif #ifdef _WIN32 @@ -374,6 +375,10 @@ ALWAYSINLINE address Os::currentStackPtr() { #if defined(__linux__) +#ifndef __GLIBC__ +typedef unsigned long int __cpu_mask; +#endif + inline void Os::ThreadAffinityMask::init() { CPU_ZERO(&mask_); } inline void Os::ThreadAffinityMask::set(uint cpu) { CPU_SET(cpu, &mask_); }