[libc-commits] [PATCH] D147985: [LIBC] Implement `sched_yield()`

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Apr 11 23:30:57 PDT 2023


sivachandra accepted this revision.
sivachandra added a comment.

OK from my side but please wait for @michaelrj who is leading this review.



================
Comment at: libc/test/src/sched/yield_test.cpp:9
+
+#include "src/__support/OSUtil/syscall.h"
+#include "src/errno/libc_errno.h"
----------------
goldstein.w.n wrote:
> sivachandra wrote:
> > goldstein.w.n wrote:
> > > michaelrj wrote:
> > > > Nit: I'm not sure you need to include syscall here.
> > > Fixed. 1 more unrelated question if you have the time.
> > > 
> > > I'm working on adding support for proper attr handling in `pthread_create`, but am finding normal libc tests / build doesn't include pthread (on linux).
> > > 
> > > Any idea for the extra steps to build/test pthread?
> > > I'm working on adding support for proper attr handling in `pthread_create`, but am finding normal libc tests / build doesn't include pthread (on linux).
> > > 
> > > Any idea for the extra steps to build/test pthread?
> > 
> > Depends on what you mean by "normal libc tests". If you are running `check-libc` on linux, it should already be including the pthread tests. But, you can run pthread tests by running `libc-integration-tests` or use a more focused target `libc-pthread-integration-tests`. The tests live here: https://github.com/llvm/llvm-project/tree/main/libc/test/integration/src/pthread
> > > I'm working on adding support for proper attr handling in `pthread_create`, but am finding normal libc tests / build doesn't include pthread (on linux).
> > > 
> > > Any idea for the extra steps to build/test pthread?
> > 
> > Depends on what you mean by "normal libc tests". If you are running `check-libc` on linux, it should already be including the pthread tests. 
> 
> Hmm, I'm noticing in a variety of cases some tests are skipped (including the entire pthread suite).
> Building:
> ```
> cmake -S llvm -B build -G Ninja -DLLVM_ENABLE_PROJECTS='libc;llvm;clang' -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS="-O1 -Wno-address" -DCMAKE_C_FLAGS="-O1 -Wno-address" -DLLVM_ENABLE_RTTI=ON -DLLVM_ENABLE_EH=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_INSTALL_PREFIX=/home/noah/programs/opensource/llvm-dev/build -DLLVM_CCACHE_BUILD=ON -DLLVM_BINUTILS_INCDIR=/home/noah/programs/opensource/binutils-dev/src/binutils-gdb/include/plugin-api.h
> ```
> 
> and testing with `ninja check-libc`
> 
> Anything inherently wrong with that?
> 
> > But, you can run pthread tests by running `libc-integration-tests` or use a more focused target `libc-pthread-integration-tests`. The tests live here: https://github.com/llvm/llvm-project/tree/main/libc/test/integration/src/pthread
> 
> 
Ah! Parts like pthread which depend on type definitions are only available in the full build mode: `-DLLVM_LIBC_FULL_BUILD=ON`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147985/new/

https://reviews.llvm.org/D147985



More information about the libc-commits mailing list