Skip to content

Commit

Permalink
Fix compilation errors with musl libc
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
AngryLoki committed Aug 1, 2024
1 parent cda4b7d commit 3f640c1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rocclr/os/os.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#if defined(__linux__)
#include <sched.h>
#include <libgen.h>
#endif

#ifdef _WIN32
Expand Down Expand Up @@ -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_); }
Expand Down

0 comments on commit 3f640c1

Please sign in to comment.