[compiler-rt] Fix rtsan build with musl (PR #119674)

via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 12 00:35:09 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Yi Kong (kongy)

<details>
<summary>Changes</summary>

fd_set is defined by sys/select.h. On musl, this header is not transitively included by the other headers.

Failure message:
compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp:761:37: error: unknown type name 'fd_set'; did you mean 'fd_t'?
  761 | INTERCEPTOR(int, pselect, int nfds, fd_set *readfds, fd_set *writefds,
      |                                     ^~~~~~
      |                                     fd_t

---
Full diff: https://github.com/llvm/llvm-project/pull/119674.diff


1 Files Affected:

- (modified) compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp (+1) 


``````````diff
diff --git a/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp b/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
index f076c7eae9a226..f000deb3039a8c 100644
--- a/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
+++ b/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
@@ -46,6 +46,7 @@ void OSSpinLockLock(volatile OSSpinLock *__lock);
 #include <pthread.h>
 #include <stdarg.h>
 #include <stdio.h>
+#include <sys/select.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <time.h>

``````````

</details>


https://github.com/llvm/llvm-project/pull/119674


More information about the llvm-commits mailing list