<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/libc/src/stdlib, branch users/mingmingl-llvm/samplefdo-profile-format</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] Fix undefined exit symbol for the NVPTX build</title>
<updated>2025-09-04T17:11:11+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2025-09-04T17:10:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8bdaa12b7ca4450d0f29b93646f1be27c0d717bd'/>
<id>8bdaa12b7ca4450d0f29b93646f1be27c0d717bd</id>
<content type='text'>
Summary:
NVPTX does not support external weak symbols being defined, disable this
to get the bots working.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
NVPTX does not support external weak symbols being defined, disable this
to get the bots working.
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] ensure tls dtors are called in main thread (#133641)</title>
<updated>2025-09-03T13:02:03+00:00</updated>
<author>
<name>Schrodinger ZHU Yifan</name>
<email>yifanzhu@rochester.edu</email>
</author>
<published>2025-09-03T13:02:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=71641049a91253f7547f792ec2fcb6609794ea4f'/>
<id>71641049a91253f7547f792ec2fcb6609794ea4f</id>
<content type='text'>
This is a part of allocator patch since I want to make sure the TLS for
allocators are correctly handled.

TLS dtors are not invoked on exit previously. This departures from major
libc implementations.

This PR fixes the issue by aligning the behavior with bionic.


https://android.googlesource.com/platform/bionic/+/refs/heads/main/libc/bionic/exit.cpp

I believe the finalization order is also consistent with glibc now:

On main thread exiting:

- pthread_key dtors are not called (unless exiting with `pthread_exit`)
- `__cxa` based tls dtors are called
- `::__cxa_atexit` and `::atexit` dtors are called
- `.fini` dtors are called


![image](https://github.com/user-attachments/assets/737c4845-cab6-47a9-aa00-32997be141bd)</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a part of allocator patch since I want to make sure the TLS for
allocators are correctly handled.

TLS dtors are not invoked on exit previously. This departures from major
libc implementations.

This PR fixes the issue by aligning the behavior with bionic.


https://android.googlesource.com/platform/bionic/+/refs/heads/main/libc/bionic/exit.cpp

I believe the finalization order is also consistent with glibc now:

On main thread exiting:

- pthread_key dtors are not called (unless exiting with `pthread_exit`)
- `__cxa` based tls dtors are called
- `::__cxa_atexit` and `::atexit` dtors are called
- `.fini` dtors are called


![image](https://github.com/user-attachments/assets/737c4845-cab6-47a9-aa00-32997be141bd)</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][NFC] Add stdint.h proxy header to fix dependency issue with &lt;stdint.h&gt; includes. (#150303)</title>
<updated>2025-07-24T00:19:52+00:00</updated>
<author>
<name>lntue</name>
<email>lntue@google.com</email>
</author>
<published>2025-07-24T00:19:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=66603dd1f10e0f6c0510273378334971159f6b69'/>
<id>66603dd1f10e0f6c0510273378334971159f6b69</id>
<content type='text'>
https://github.com/llvm/llvm-project/issues/149993</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/llvm/llvm-project/issues/149993</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Efficiently implement `aligned_alloc` for AMDGPU (#146585)</title>
<updated>2025-07-02T14:25:57+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2025-07-02T14:25:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=24828c8c45d7f258159afca251aa853a5fc59150'/>
<id>24828c8c45d7f258159afca251aa853a5fc59150</id>
<content type='text'>
Summary:
This patch uses the actual allocator interface to implement
`aligned_alloc`. We do this by simply rounding up the amount allocated.
Because of how index calculation works, any offset within an allocated
pointer will still map to the same chunk, so we can just adjust
internally and it will free all the same.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
This patch uses the actual allocator interface to implement
`aligned_alloc`. We do this by simply rounding up the amount allocated.
Because of how index calculation works, any offset within an allocated
pointer will still map to the same chunk, so we can just adjust
internally and it will free all the same.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Efficiently implement 'realloc' for AMDGPU devices (#145960)</title>
<updated>2025-06-30T13:39:40+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2025-06-30T13:39:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=10445acfa64a80800272e09f70be4799877a237f'/>
<id>10445acfa64a80800272e09f70be4799877a237f</id>
<content type='text'>
Summary:
Now that we have `malloc` we can implement `realloc` efficiently. This
uses the known chunk sizes to avoid unnecessary allocations. We just
return nullptr for NVPTX. I'd remove the list for the entrypoint but
then the libc++ code would stop working. When someone writes the NVPTX
support this will be trivial.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
Now that we have `malloc` we can implement `realloc` efficiently. This
uses the known chunk sizes to avoid unnecessary allocations. We just
return nullptr for NVPTX. I'd remove the list for the entrypoint but
then the libc++ code would stop working. When someone writes the NVPTX
support this will be trivial.</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>qsort_r.h: qsort_r() is POSIX now. (#138545)</title>
<updated>2025-05-05T20:19:58+00:00</updated>
<author>
<name>enh-google</name>
<email>enh@google.com</email>
</author>
<published>2025-05-05T20:19:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=673047ea2b49439d8b746adc03eb882d582e0625'/>
<id>673047ea2b49439d8b746adc03eb882d582e0625</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] implement `memalignment` (#132493)</title>
<updated>2025-03-28T23:07:57+00:00</updated>
<author>
<name>Mohamed Emad</name>
<email>73320969+hulxv@users.noreply.github.com</email>
</author>
<published>2025-03-28T23:07:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=48408954670e1f564bd92eed6b54bf155238201c'/>
<id>48408954670e1f564bd92eed6b54bf155238201c</id>
<content type='text'>
This patch adds the `memalignment` function to LLVM-libc, following its
description in [WG14 N3220,
§7.24.2.1](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf#page=387).

- [x] Add the implementation of `memalignment` in
[`/src/stdlib`](https://github.com/llvm/llvm-project/tree/main/libc/src/stdlib)
- [x] Add tests for `memalignment` in
[`/test/src/stdlib`](https://github.com/llvm/llvm-project/tree/main/libc/test/src/stdlib)
- [x] Add `memalignment` to
[`entrypoints.txt`](https://github.com/llvm/llvm-project/blob/main/libc/config/linux/x86_64/entrypoints.txt)
for at least x86_64 and whatever you're building on
- [x] Add `memalignment` to
[`include/stdlib.yaml`](https://github.com/llvm/llvm-project/blob/main/libc/include/stdlib.yaml)




Closes #132300

---------

Co-authored-by: Joseph Huber &lt;huberjn@outlook.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds the `memalignment` function to LLVM-libc, following its
description in [WG14 N3220,
§7.24.2.1](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf#page=387).

- [x] Add the implementation of `memalignment` in
[`/src/stdlib`](https://github.com/llvm/llvm-project/tree/main/libc/src/stdlib)
- [x] Add tests for `memalignment` in
[`/test/src/stdlib`](https://github.com/llvm/llvm-project/tree/main/libc/test/src/stdlib)
- [x] Add `memalignment` to
[`entrypoints.txt`](https://github.com/llvm/llvm-project/blob/main/libc/config/linux/x86_64/entrypoints.txt)
for at least x86_64 and whatever you're building on
- [x] Add `memalignment` to
[`include/stdlib.yaml`](https://github.com/llvm/llvm-project/blob/main/libc/include/stdlib.yaml)




Closes #132300

---------

Co-authored-by: Joseph Huber &lt;huberjn@outlook.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Template the writing mode for the writer class (#111559)</title>
<updated>2025-03-12T18:51:44+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2025-03-12T18:51:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=598e882ee88a1e3349fb6d8dcd68f6d3b1c6334f'/>
<id>598e882ee88a1e3349fb6d8dcd68f6d3b1c6334f</id>
<content type='text'>
Summary:
Currently we dispatch the writing mode off of a runtime enum passed in
by the constructor. This causes very unfortunate codegen for the GPU
targets where we get worst-case codegen because of the unused function
pointer for `sprintf`. Instead, this patch moves all of this to a
template so it can be masked out. This results in no dynamic stack and
uses 60 VGPRs instead of 117. It also compiles about 5x as fast.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
Currently we dispatch the writing mode off of a runtime enum passed in
by the constructor. This causes very unfortunate codegen for the GPU
targets where we get worst-case codegen because of the unused function
pointer for `sprintf`. Instead, this patch moves all of this to a
template so it can be masked out. This results in no dynamic stack and
uses 60 VGPRs instead of 117. It also compiles about 5x as fast.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Add `-Wno-sign-conversion` &amp; re-attempt `-Wconversion` (#129811)</title>
<updated>2025-03-10T15:57:09+00:00</updated>
<author>
<name>Vinay Deshmukh</name>
<email>32487576+vinay-deshmukh@users.noreply.github.com</email>
</author>
<published>2025-03-10T15:57:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=257e48371546f75623482071fc39eef4b64fbd88'/>
<id>257e48371546f75623482071fc39eef4b64fbd88</id>
<content type='text'>
Relates to
https://github.com/llvm/llvm-project/issues/119281#issuecomment-2699470459</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Relates to
https://github.com/llvm/llvm-project/issues/119281#issuecomment-2699470459</pre>
</div>
</content>
</entry>
</feed>
