Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc][docs] stub out pthread.h support #122497

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

nickdesaulniers
Copy link
Member

@nickdesaulniers nickdesaulniers commented Jan 10, 2025

Link: #122006

@llvmbot llvmbot added the libc label Jan 10, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 10, 2025

@llvm/pr-subscribers-libc

Author: Nick Desaulniers (nickdesaulniers)

Changes

Link: #122006


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

3 Files Affected:

  • (modified) libc/docs/CMakeLists.txt (+1)
  • (modified) libc/docs/headers/index.rst (+1)
  • (added) libc/utils/docgen/pthread.yaml (+260)
diff --git a/libc/docs/CMakeLists.txt b/libc/docs/CMakeLists.txt
index 5a3f8275bb932e..01f1aaf94e08a7 100644
--- a/libc/docs/CMakeLists.txt
+++ b/libc/docs/CMakeLists.txt
@@ -40,6 +40,7 @@ if (SPHINX_FOUND)
       float
       inttypes
       locale
+      pthread
       setjmp
       signal
       stdbit
diff --git a/libc/docs/headers/index.rst b/libc/docs/headers/index.rst
index 07ab6dd9b26742..3cdbafd550b8f8 100644
--- a/libc/docs/headers/index.rst
+++ b/libc/docs/headers/index.rst
@@ -14,6 +14,7 @@ Implementation Status
    inttypes
    locale
    math/index.rst
+   pthread
    search
    setjmp
    signal
diff --git a/libc/utils/docgen/pthread.yaml b/libc/utils/docgen/pthread.yaml
new file mode 100644
index 00000000000000..e189fe9b08761a
--- /dev/null
+++ b/libc/utils/docgen/pthread.yaml
@@ -0,0 +1,260 @@
+functions:
+  pthread_atfork:
+    in-latest-posix: ''
+  pthread_attr_destroy:
+    in-latest-posix: ''
+  pthread_attr_getdetachstate:
+    in-latest-posix: ''
+  pthread_attr_getguardsize:
+    in-latest-posix: ''
+  pthread_attr_getinheritsched:
+    in-latest-posix: ''
+  pthread_attr_getschedparam:
+    in-latest-posix: ''
+  pthread_attr_getschedpolicy:
+    in-latest-posix: ''
+  pthread_attr_getscope:
+    in-latest-posix: ''
+  pthread_attr_getstack:
+    in-latest-posix: ''
+  pthread_attr_getstacksize:
+    in-latest-posix: ''
+  pthread_attr_init:
+    in-latest-posix: ''
+  pthread_attr_setdetachstate:
+    in-latest-posix: ''
+  pthread_attr_setguardsize:
+    in-latest-posix: ''
+  pthread_attr_setinheritsched:
+    in-latest-posix: ''
+  pthread_attr_setschedparam:
+    in-latest-posix: ''
+  pthread_attr_setschedpolicy:
+    in-latest-posix: ''
+  pthread_attr_setscope:
+    in-latest-posix: ''
+  pthread_attr_setstack:
+    in-latest-posix: ''
+  pthread_attr_setstacksize:
+    in-latest-posix: ''
+  pthread_barrier_destroy:
+    in-latest-posix: ''
+  pthread_barrier_init:
+    in-latest-posix: ''
+  pthread_barrier_wait:
+    in-latest-posix: ''
+  pthread_barrierattr_destroy:
+    in-latest-posix: ''
+  pthread_barrierattr_getpshared:
+    in-latest-posix: ''
+  pthread_barrierattr_init:
+    in-latest-posix: ''
+  pthread_barrierattr_setpshared:
+    in-latest-posix: ''
+  pthread_cancel:
+    in-latest-posix: ''
+  pthread_cleanup_pop:
+    in-latest-posix: ''
+  pthread_cleanup_push:
+    in-latest-posix: ''
+  pthread_cond_broadcast:
+    in-latest-posix: ''
+  pthread_cond_clockwait:
+    in-latest-posix: ''
+  pthread_cond_destroy:
+    in-latest-posix: ''
+  pthread_cond_init:
+    in-latest-posix: ''
+  pthread_cond_signal:
+    in-latest-posix: ''
+  pthread_cond_timedwait:
+    in-latest-posix: ''
+  pthread_cond_wait:
+    in-latest-posix: ''
+  pthread_condattr_destroy:
+    in-latest-posix: ''
+  pthread_condattr_getclock:
+    in-latest-posix: ''
+  pthread_condattr_getpshared:
+    in-latest-posix: ''
+  pthread_condattr_init:
+    in-latest-posix: ''
+  pthread_condattr_setclock:
+    in-latest-posix: ''
+  pthread_condattr_setpshared:
+    in-latest-posix: ''
+  pthread_create:
+    in-latest-posix: ''
+  pthread_detach:
+    in-latest-posix: ''
+  pthread_equal:
+    in-latest-posix: ''
+  pthread_exit:
+    in-latest-posix: ''
+  pthread_getcpuclockid:
+    in-latest-posix: ''
+  pthread_getschedparam:
+    in-latest-posix: ''
+  pthread_getspecific:
+    in-latest-posix: ''
+  pthread_join:
+    in-latest-posix: ''
+  pthread_key_create:
+    in-latest-posix: ''
+  pthread_key_delete:
+    in-latest-posix: ''
+  pthread_mutex_clocklock:
+    in-latest-posix: ''
+  pthread_mutex_destroy:
+    in-latest-posix: ''
+  pthread_mutex_getprioceiling:
+    in-latest-posix: ''
+  pthread_mutex_init:
+    in-latest-posix: ''
+  pthread_mutex_lock:
+    in-latest-posix: ''
+  pthread_mutex_setprioceiling:
+    in-latest-posix: ''
+  pthread_mutex_timedlock:
+    in-latest-posix: ''
+  pthread_mutex_trylock:
+    in-latest-posix: ''
+  pthread_mutex_unlock:
+    in-latest-posix: ''
+  pthread_mutexattr_destroy:
+    in-latest-posix: ''
+  pthread_mutexattr_getprioceiling:
+    in-latest-posix: ''
+  pthread_mutexattr_getprotocol:
+    in-latest-posix: ''
+  pthread_mutexattr_getpshared:
+    in-latest-posix: ''
+  pthread_mutexattr_getrobust:
+    in-latest-posix: ''
+  pthread_mutexattr_gettype:
+    in-latest-posix: ''
+  pthread_mutexattr_init:
+    in-latest-posix: ''
+  pthread_mutexattr_setprioceiling:
+    in-latest-posix: ''
+  pthread_mutexattr_setprotocol:
+    in-latest-posix: ''
+  pthread_mutexattr_setpshared:
+    in-latest-posix: ''
+  pthread_mutexattr_setrobust:
+    in-latest-posix: ''
+  pthread_mutexattr_settype:
+    in-latest-posix: ''
+  pthread_once:
+    in-latest-posix: ''
+  pthread_rwlock_clockrdlock:
+    in-latest-posix: ''
+  pthread_rwlock_clockwrlock:
+    in-latest-posix: ''
+  pthread_rwlock_destroy:
+    in-latest-posix: ''
+  pthread_rwlock_init:
+    in-latest-posix: ''
+  pthread_rwlock_rdlock:
+    in-latest-posix: ''
+  pthread_rwlock_timedrdlock:
+    in-latest-posix: ''
+  pthread_rwlock_timedwrlock:
+    in-latest-posix: ''
+  pthread_rwlock_tryrdlock:
+    in-latest-posix: ''
+  pthread_rwlock_trywrlock:
+    in-latest-posix: ''
+  pthread_rwlock_unlock:
+    in-latest-posix: ''
+  pthread_rwlock_wrlock:
+    in-latest-posix: ''
+  pthread_rwlockattr_destroy:
+    in-latest-posix: ''
+  pthread_rwlockattr_getpshared:
+    in-latest-posix: ''
+  pthread_rwlockattr_init:
+    in-latest-posix: ''
+  pthread_rwlockattr_setpshared:
+    in-latest-posix: ''
+  pthread_self:
+    in-latest-posix: ''
+  pthread_setcancelstate:
+    in-latest-posix: ''
+  pthread_setcanceltype:
+    in-latest-posix: ''
+  pthread_setschedparam:
+    in-latest-posix: ''
+  pthread_setschedprio:
+    in-latest-posix: ''
+  pthread_setspecific:
+    in-latest-posix: ''
+  pthread_spin_destroy:
+    in-latest-posix: ''
+  pthread_spin_init:
+    in-latest-posix: ''
+  pthread_spin_lock:
+    in-latest-posix: ''
+  pthread_spin_trylock:
+    in-latest-posix: ''
+  pthread_spin_unlock:
+    in-latest-posix: ''
+  pthread_testcancel:
+    in-latest-posix: ''
+macros:
+  PTHREAD_BARRIER_SERIAL_THREAD:
+    in-latest-posix: ''
+  PTHREAD_CANCELED:
+    in-latest-posix: ''
+  PTHREAD_CANCEL_ASYNCHRONOUS:
+    in-latest-posix: ''
+  PTHREAD_CANCEL_DEFERRED:
+    in-latest-posix: ''
+  PTHREAD_CANCEL_DISABLE:
+    in-latest-posix: ''
+  PTHREAD_CANCEL_ENABLE:
+    in-latest-posix: ''
+  PTHREAD_COND_INITIALIZER:
+    in-latest-posix: ''
+  PTHREAD_CREATE_DETACHED:
+    in-latest-posix: ''
+  PTHREAD_CREATE_JOINABLE:
+    in-latest-posix: ''
+  PTHREAD_EXPLICIT_SCHED:
+    in-latest-posix: ''
+  PTHREAD_INHERIT_SCHED:
+    in-latest-posix: ''
+  PTHREAD_MUTEX_DEFAULT:
+    in-latest-posix: ''
+  PTHREAD_MUTEX_ERRORCHECK:
+    in-latest-posix: ''
+  PTHREAD_MUTEX_INITIALIZER:
+    in-latest-posix: ''
+  PTHREAD_MUTEX_NORMAL:
+    in-latest-posix: ''
+  PTHREAD_MUTEX_RECURSIVE:
+    in-latest-posix: ''
+  PTHREAD_MUTEX_ROBUST:
+    in-latest-posix: ''
+  PTHREAD_MUTEX_STALLED:
+    in-latest-posix: ''
+  PTHREAD_NULL:
+    in-latest-posix: ''
+  PTHREAD_ONCE_INIT:
+    in-latest-posix: ''
+  PTHREAD_PRIO_INHERIT:
+    in-latest-posix: ''
+  PTHREAD_PRIO_NONE:
+    in-latest-posix: ''
+  PTHREAD_PRIO_PROTECT:
+    in-latest-posix: ''
+  PTHREAD_PROCESS_PRIVATE:
+    in-latest-posix: ''
+  PTHREAD_PROCESS_SHARED:
+    in-latest-posix: ''
+  PTHREAD_RWLOCK_INITIALIZER:
+    in-latest-posix: ''
+  PTHREAD_SCOPE_PROCESS:
+    in-latest-posix: ''
+  PTHREAD_SCOPE_SYSTEM:
+    in-latest-posix: ''

@nickdesaulniers
Copy link
Member Author

cc @StarOne01 why don't you review this one?

@StarOne01
Copy link
Contributor

Me.. Thanks for that!

@nickdesaulniers nickdesaulniers merged commit 539b15b into llvm:main Jan 14, 2025
8 of 10 checks passed
@nickdesaulniers nickdesaulniers deleted the docs_pthread branch January 14, 2025 16:48
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 14, 2025

LLVM Buildbot has detected a new failure on builder openmp-offload-libc-amdgpu-runtime running on omp-vega20-1 while building libc at step 7 "Add check check-offload".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/73/builds/11697

Here is the relevant piece of the build log for the reference
Step 7 (Add check check-offload) failure: test (failure)
******************** TEST 'libomptarget :: amdgcn-amd-amdhsa :: offloading/pgo1.c' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang -fopenmp    -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src  -nogpulib -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib  -fopenmp-targets=amdgcn-amd-amdhsa /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/pgo1.c -o /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/Output/pgo1.c.tmp -Xoffload-linker -lc -Xoffload-linker -lm /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib/libomptarget.devicertl.a -fprofile-instr-generate      -Xclang "-fprofile-instrument=clang"
# executed command: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang -fopenmp -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -nogpulib -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib -fopenmp-targets=amdgcn-amd-amdhsa /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/pgo1.c -o /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/Output/pgo1.c.tmp -Xoffload-linker -lc -Xoffload-linker -lm /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib/libomptarget.devicertl.a -fprofile-instr-generate -Xclang -fprofile-instrument=clang
# RUN: at line 3
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/Output/pgo1.c.tmp 2>&1 | /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/pgo1.c      --check-prefix="CLANG-PGO"
# executed command: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/Output/pgo1.c.tmp
# executed command: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/pgo1.c --check-prefix=CLANG-PGO
# RUN: at line 5
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang -fopenmp    -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src  -nogpulib -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib  -fopenmp-targets=amdgcn-amd-amdhsa /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/pgo1.c -o /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/Output/pgo1.c.tmp -Xoffload-linker -lc -Xoffload-linker -lm /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib/libomptarget.devicertl.a -fprofile-generate      -Xclang "-fprofile-instrument=llvm"
# executed command: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang -fopenmp -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -nogpulib -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib -fopenmp-targets=amdgcn-amd-amdhsa /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/pgo1.c -o /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/Output/pgo1.c.tmp -Xoffload-linker -lc -Xoffload-linker -lm /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib/libomptarget.devicertl.a -fprofile-generate -Xclang -fprofile-instrument=llvm
# RUN: at line 7
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/Output/pgo1.c.tmp 2>&1 | /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/pgo1.c      --check-prefix="LLVM-PGO"
# executed command: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/Output/pgo1.c.tmp
# executed command: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/pgo1.c --check-prefix=LLVM-PGO
# .---command stderr------------
# | /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/pgo1.c:55:19: error: LLVM-PGO-NEXT: expected string not found in input
# | // LLVM-PGO-NEXT: [ 20 10 2 1 ]
# |                   ^
# | <stdin>:3:28: note: scanning from here
# | ======== Counters =========
# |                            ^
# | <stdin>:4:1: note: possible intended match here
# | [ 20 10 3 1 ]
# | ^
# | 
# | Input file: <stdin>
# | Check file: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/pgo1.c
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            1: ======= GPU Profile ======= 
# |            2: Target: amdgcn-amd-amdhsa 
# |            3: ======== Counters ========= 
# | next:55'0                                X error: no match found
# |            4: [ 20 10 3 1 ] 
# | next:55'0     ~~~~~~~~~~~~~~
# | next:55'1     ?              possible intended match
# |            5: [ 10 ] 
# | next:55'0     ~~~~~~~
# |            6: [ 20 ] 
# | next:55'0     ~~~~~~~
# |            7: ========== Data =========== 
# | next:55'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...

paulhuggett pushed a commit to paulhuggett/llvm-project that referenced this pull request Jan 16, 2025
DKLoehr pushed a commit to DKLoehr/llvm-project that referenced this pull request Jan 17, 2025
nickdesaulniers added a commit to nickdesaulniers/llvm-project that referenced this pull request Jan 21, 2025
Having a target named pthreads is breaking when multiple runtimes are enabled.
Disable this target for now so that the builds go back to green (and sites get
updated).

Link: llvm/llvm-zorg#359 (comment)
Link: llvm#122006
Link: llvm#122497
Link: llvm#123821
nickdesaulniers added a commit that referenced this pull request Jan 22, 2025
Having a target named pthreads is breaking when multiple runtimes are enabled.
Disable this target for now so that the builds go back to green (and sites get
updated).

Link: llvm/llvm-zorg#359 (comment)
Link: #122006
Link: #122497
Link: #123821
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants