Skip to content

Commit d25d159

Browse files
committed
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 <[email protected]>
1 parent 7bacd27 commit d25d159

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rocclr/os/os.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
#if defined(__linux__)
3131
#include <sched.h>
32+
#include <libgen.h>
3233
#endif
3334

3435
#ifdef _WIN32
@@ -374,6 +375,10 @@ ALWAYSINLINE address Os::currentStackPtr() {
374375

375376
#if defined(__linux__)
376377

378+
#ifndef __GLIBC__
379+
typedef unsigned long int __cpu_mask;
380+
#endif
381+
377382
inline void Os::ThreadAffinityMask::init() { CPU_ZERO(&mask_); }
378383

379384
inline void Os::ThreadAffinityMask::set(uint cpu) { CPU_SET(cpu, &mask_); }

0 commit comments

Comments
 (0)