<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/libc/src/threads, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[libc] Refactor AUXV handling with new auxv.h header library (#162326)</title>
<updated>2025-10-08T14:00:05+00:00</updated>
<author>
<name>Schrodinger ZHU Yifan</name>
<email>yifanzhu@rochester.edu</email>
</author>
<published>2025-10-08T14:00:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0db5ba0ce6c36c78f93ebfe992c0f9ed807328bb'/>
<id>0db5ba0ce6c36c78f93ebfe992c0f9ed807328bb</id>
<content type='text'>
Closes https://github.com/llvm/llvm-project/issues/153666

This patch introduces a new centralized AUXV (auxiliary vector) handling
mechanism for LLVM libc on Linux, replacing the previous scattered
implementation across multiple files.

## Key Changes:

### New Files:
- **libc/src/__support/OSUtil/linux/auxv.h**: New header library
providing
  a clean interface for AUXV access with:
  - `auxv::Entry` struct for AUXV entries (type and value)
  - `auxv::Vector` class with iterator support for traversing AUXV
  - `auxv::get()` function for retrieving specific AUXV values
- Thread-safe initialization with fallback mechanisms (prctl and
/proc/self/auxv)

### Modified Files:

1. **libc/src/__support/OSUtil/linux/CMakeLists.txt**:
   - Added `auxv` header library declaration with proper dependencies:
     - libc.hdr.fcntl_macros
     - libc.src.__support.OSUtil.osutil
     - libc.src.__support.common
     - libc.src.__support.CPP.optional
     - libc.src.__support.threads.callonce

2. **libc/config/linux/app.h**:
   - Removed `AuxEntry` struct (moved to auxv.h as `auxv::Entry`)
   - Removed `auxv_ptr` from `AppProperties` struct
   - Simplified application properties structure

3. **libc/src/sys/auxv/linux/getauxval.cpp**:
   - Completely refactored to use new auxv.h interface
   - Removed ~200 lines of complex initialization code
   - Simplified to just call `auxv::get()` function
- Removed dependencies to external symbols (mman, prctl, fcntl, read,
close, open)

4. **libc/src/sys/auxv/linux/CMakeLists.txt**:
   - Updated dependencies to use new auxv header library
- Removed dependencies to external symbols (prctl, mman, fcntl, unistd,
etc.)

5. **libc/startup/linux/do_start.cpp**:
   - Updated to use new `auxv::Vector` interface
   - Changed from pointer-based to iterator-based AUXV traversal
- Updated field names (`aux_entry-&gt;id` → `aux_entry.type`,
`aux_entry-&gt;value` → `aux_entry.val`)
- Added call to `auxv::Vector::initialize_unsafe()` for early AUXV setup

6. **libc/startup/linux/CMakeLists.txt**:
   - Added dependency on `libc.src.__support.OSUtil.linux.auxv`</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes https://github.com/llvm/llvm-project/issues/153666

This patch introduces a new centralized AUXV (auxiliary vector) handling
mechanism for LLVM libc on Linux, replacing the previous scattered
implementation across multiple files.

## Key Changes:

### New Files:
- **libc/src/__support/OSUtil/linux/auxv.h**: New header library
providing
  a clean interface for AUXV access with:
  - `auxv::Entry` struct for AUXV entries (type and value)
  - `auxv::Vector` class with iterator support for traversing AUXV
  - `auxv::get()` function for retrieving specific AUXV values
- Thread-safe initialization with fallback mechanisms (prctl and
/proc/self/auxv)

### Modified Files:

1. **libc/src/__support/OSUtil/linux/CMakeLists.txt**:
   - Added `auxv` header library declaration with proper dependencies:
     - libc.hdr.fcntl_macros
     - libc.src.__support.OSUtil.osutil
     - libc.src.__support.common
     - libc.src.__support.CPP.optional
     - libc.src.__support.threads.callonce

2. **libc/config/linux/app.h**:
   - Removed `AuxEntry` struct (moved to auxv.h as `auxv::Entry`)
   - Removed `auxv_ptr` from `AppProperties` struct
   - Simplified application properties structure

3. **libc/src/sys/auxv/linux/getauxval.cpp**:
   - Completely refactored to use new auxv.h interface
   - Removed ~200 lines of complex initialization code
   - Simplified to just call `auxv::get()` function
- Removed dependencies to external symbols (mman, prctl, fcntl, read,
close, open)

4. **libc/src/sys/auxv/linux/CMakeLists.txt**:
   - Updated dependencies to use new auxv header library
- Removed dependencies to external symbols (prctl, mman, fcntl, unistd,
etc.)

5. **libc/startup/linux/do_start.cpp**:
   - Updated to use new `auxv::Vector` interface
   - Changed from pointer-based to iterator-based AUXV traversal
- Updated field names (`aux_entry-&gt;id` → `aux_entry.type`,
`aux_entry-&gt;value` → `aux_entry.val`)
- Added call to `auxv::Vector::initialize_unsafe()` for early AUXV setup

6. **libc/startup/linux/CMakeLists.txt**:
   - Added dependency on `libc.src.__support.OSUtil.linux.auxv`</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Move libc_errno.h to libc/src/__support and make LIBC_ERRNO_MODE_SYSTEM to be header-only. (#143187)</title>
<updated>2025-06-11T20:25:27+00:00</updated>
<author>
<name>lntue</name>
<email>lntue@google.com</email>
</author>
<published>2025-06-11T20:25:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d87eea35fac5a34a841c637db8908128409a184e'/>
<id>d87eea35fac5a34a841c637db8908128409a184e</id>
<content type='text'>
This is the first step in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the first step in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] suppress more clang-cl warnings (#117718)</title>
<updated>2024-11-26T20:15:58+00:00</updated>
<author>
<name>Schrodinger ZHU Yifan</name>
<email>yifanzhu@rochester.edu</email>
</author>
<published>2024-11-26T20:15:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c71418574f1bb9e4678428901775c8b633cded09'/>
<id>c71418574f1bb9e4678428901775c8b633cded09</id>
<content type='text'>
- migrate more `-O3` to `${libc_opt_high_flag}`
- workaround a issue with `LLP64` in test. The overflow testing is
guarded by a constexpr but the literal overflow itself will still
trigger warnings.

Notice that for math smoke test, for some reasons, the
`${libc_opt_high_flag}` will be passed into `lld-link` which confuses
the linker so there are still some warnings leftover there. I can
investigate more when I have time.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- migrate more `-O3` to `${libc_opt_high_flag}`
- workaround a issue with `LLP64` in test. The overflow testing is
guarded by a constexpr but the literal overflow itself will still
trigger warnings.

Notice that for math smoke test, for some reasons, the
`${libc_opt_high_flag}` will be passed into `lld-link` which confuses
the linker so there are still some warnings leftover there. I can
investigate more when I have time.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] remove errno.h includes (#110934)</title>
<updated>2024-10-05T23:31:36+00:00</updated>
<author>
<name>Job Henandez Lara</name>
<email>jobhdezlara93@gmail.com</email>
</author>
<published>2024-10-05T23:31:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=46944b0cbc9a9d8daad0182c40fcd3560bc9ca35'/>
<id>46944b0cbc9a9d8daad0182c40fcd3560bc9ca35</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration (#98597)</title>
<updated>2024-07-12T16:28:41+00:00</updated>
<author>
<name>Petr Hosek</name>
<email>phosek@google.com</email>
</author>
<published>2024-07-12T16:28:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5ff3ff33ff930e4ec49da7910612d8a41eb068cb'/>
<id>5ff3ff33ff930e4ec49da7910612d8a41eb068cb</id>
<content type='text'>
This is a part of #97655.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a part of #97655.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration" (#98593)</title>
<updated>2024-07-12T07:12:13+00:00</updated>
<author>
<name>Mehdi Amini</name>
<email>joker.eph@gmail.com</email>
</author>
<published>2024-07-12T07:12:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ce9035f5bd3aa09cbd899489cdbc7f6c18acf1e3'/>
<id>ce9035f5bd3aa09cbd899489cdbc7f6c18acf1e3</id>
<content type='text'>
Reverts llvm/llvm-project#98075

bots are broken</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#98075

bots are broken</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration (#98075)</title>
<updated>2024-07-11T19:35:22+00:00</updated>
<author>
<name>Petr Hosek</name>
<email>phosek@google.com</email>
</author>
<published>2024-07-11T19:35:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3f30effe1bd81fa1b039218a9bfe79c3b03fafad'/>
<id>3f30effe1bd81fa1b039218a9bfe79c3b03fafad</id>
<content type='text'>
This is a part of #97655.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a part of #97655.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] rework mutex (#92168)</title>
<updated>2024-06-01T01:57:18+00:00</updated>
<author>
<name>Schrodinger ZHU Yifan</name>
<email>yifanzhu@rochester.edu</email>
</author>
<published>2024-06-01T01:57:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=142afde0eba4940f2b331274e9a3535fee960f35'/>
<id>142afde0eba4940f2b331274e9a3535fee960f35</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][__support] move CndVar to __support (#89329)</title>
<updated>2024-05-21T22:49:42+00:00</updated>
<author>
<name>Nick Desaulniers (paternity leave)</name>
<email>nickdesaulniers@users.noreply.github.com</email>
</author>
<published>2024-05-21T22:49:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5442e15a152614628e2e2bef250c91eacf75fc9c'/>
<id>5442e15a152614628e2e2bef250c91eacf75fc9c</id>
<content type='text'>
We should be able to reuse this between the implementation of C11 cnd_t
condition variables and POSIX pthread_cond_t condition variables.

The current implementation is hyper linux specific, making use of Futex. That
obviously wont work outside of linux, so split the OS specific functions off
into their own source outside of the header.

Modifies the return values of the to-be-shared impl to return 0 on success and
-1 on error.  This pattern was shamelessly stolen from Bionic's
[__bionic_thrd_error](https://android.googlesource.com/platform/bionic/+/refs/heads/main/libc/include/bits/threads_inlines.h#41).

Fixes: #88580
Link: #88583
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We should be able to reuse this between the implementation of C11 cnd_t
condition variables and POSIX pthread_cond_t condition variables.

The current implementation is hyper linux specific, making use of Futex. That
obviously wont work outside of linux, so split the OS specific functions off
into their own source outside of the header.

Modifies the return values of the to-be-shared impl to return 0 on success and
-1 on error.  This pattern was shamelessly stolen from Bionic's
[__bionic_thrd_error](https://android.googlesource.com/platform/bionic/+/refs/heads/main/libc/include/bits/threads_inlines.h#41).

Fixes: #88580
Link: #88583
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Replace `MutexLock` with `cpp::lock_guard` (#89340)</title>
<updated>2024-05-09T07:06:18+00:00</updated>
<author>
<name>Vlad Mishel</name>
<email>43666597+vmishelcs@users.noreply.github.com</email>
</author>
<published>2024-05-09T07:06:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c4a3d184db5fdffe798208b8281dfe944616f9ed'/>
<id>c4a3d184db5fdffe798208b8281dfe944616f9ed</id>
<content type='text'>
This PR address issue #89002.

#### Changes in this PR

* Added a simple implementation of `cpp::lock_guard` (an equivalent of
`std::lock_guard`) in libc/src/__support/CPP inspired by the libstdc++
implementation
* Added tests for `cpp::lock_guard` in
/libc/test/src/__support/CPP/mutex_test.cpp
* Replaced all references to `MutexLock` with `cpp::lock_guard`

---------

Co-authored-by: Guillaume Chatelet &lt;gchatelet@google.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR address issue #89002.

#### Changes in this PR

* Added a simple implementation of `cpp::lock_guard` (an equivalent of
`std::lock_guard`) in libc/src/__support/CPP inspired by the libstdc++
implementation
* Added tests for `cpp::lock_guard` in
/libc/test/src/__support/CPP/mutex_test.cpp
* Replaced all references to `MutexLock` with `cpp::lock_guard`

---------

Co-authored-by: Guillaume Chatelet &lt;gchatelet@google.com&gt;</pre>
</div>
</content>
</entry>
</feed>
