<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/libc/src/stdlib, 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] Move mbtowc, mbstowcs and inverse functions to stdlib.h (#168455)</title>
<updated>2025-11-17T23:43:42+00:00</updated>
<author>
<name>Alexey Samsonov</name>
<email>vonosmas@gmail.com</email>
</author>
<published>2025-11-17T23:43:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=da61dd28c6dd77901058580e391cb8c88bb506f2'/>
<id>da61dd28c6dd77901058580e391cb8c88bb506f2</id>
<content type='text'>
These functions should be declared in `stdlib.h`, not `wchar.h`, as
confusing as it is. Move them to the proper header file and matching
directories in src/ and test/ trees.

This was discovered while testing libc++ build against llvm-libc, which
re-declares functions like mbtowc in std-namespace in `&lt;cstdlib&gt;`
header, and then uses those functions in its locale implementation.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These functions should be declared in `stdlib.h`, not `wchar.h`, as
confusing as it is. Move them to the proper header file and matching
directories in src/ and test/ trees.

This was discovered while testing libc++ build against llvm-libc, which
re-declares functions like mbtowc in std-namespace in `&lt;cstdlib&gt;`
header, and then uses those functions in its locale implementation.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Add printf error handling (with fixes #2) (#166517)</title>
<updated>2025-11-05T21:09:53+00:00</updated>
<author>
<name>Marcell Leleszi</name>
<email>59964679+mleleszi@users.noreply.github.com</email>
</author>
<published>2025-11-05T21:09:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9e2f73fe9052a4fbf382a06e30b2441c6d99fb7e'/>
<id>9e2f73fe9052a4fbf382a06e30b2441c6d99fb7e</id>
<content type='text'>
https://github.com/llvm/llvm-project/issues/159474

Another try of trying to land
https://github.com/llvm/llvm-project/pull/166382
- Fix some leftover tests checking for specific  errnos
- Guard errno checking tests to not run on the GPU

@michaelrj-google</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/llvm/llvm-project/issues/159474

Another try of trying to land
https://github.com/llvm/llvm-project/pull/166382
- Fix some leftover tests checking for specific  errnos
- Guard errno checking tests to not run on the GPU

@michaelrj-google</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Migrate ctype_utils to use char instead of int where applicable. (#166225)</title>
<updated>2025-11-05T19:02:28+00:00</updated>
<author>
<name>Alexey Samsonov</name>
<email>vonosmas@gmail.com</email>
</author>
<published>2025-11-05T19:02:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=120689e46679c6db37cd9e839ec0721e80a22d4f'/>
<id>120689e46679c6db37cd9e839ec0721e80a22d4f</id>
<content type='text'>
Functions like isalpha / tolower can operate on chars internally. This
allows us to get rid of unnecessary casts and open a way to creating
wchar_t overloads with the same names (e.g. for isalpha), that would
simplify templated code for conversion functions (see
315dfe5865962d8a3d60e21d1fffce5214fe54ef).

Add the int-&gt;char converstion to public entrypoints implementation
instead. We also need to introduce bounds check on the input argument
values - these functions' behavior is unspecified if the argument is
neither EOF nor fits in "unsigned char" range, but the tests we've had
verified that they always return false for small negative values. To
preserve this behavior, cover it explicitly.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Functions like isalpha / tolower can operate on chars internally. This
allows us to get rid of unnecessary casts and open a way to creating
wchar_t overloads with the same names (e.g. for isalpha), that would
simplify templated code for conversion functions (see
315dfe5865962d8a3d60e21d1fffce5214fe54ef).

Add the int-&gt;char converstion to public entrypoints implementation
instead. We also need to introduce bounds check on the input argument
values - these functions' behavior is unspecified if the argument is
neither EOF nor fits in "unsigned char" range, but the tests we've had
verified that they always return false for small negative values. To
preserve this behavior, cover it explicitly.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert commit d8e5698 and 15b19c7 (#166498)</title>
<updated>2025-11-05T03:43:16+00:00</updated>
<author>
<name>Kewen Meng</name>
<email>Kewen.Meng@amd.com</email>
</author>
<published>2025-11-05T03:43:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c5aaee0bb07b221e5d3314bbdcf1abc4a604d6bd'/>
<id>c5aaee0bb07b221e5d3314bbdcf1abc4a604d6bd</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Add printf error handling (with fixes) (#166382)</title>
<updated>2025-11-05T00:20:51+00:00</updated>
<author>
<name>Marcell Leleszi</name>
<email>59964679+mleleszi@users.noreply.github.com</email>
</author>
<published>2025-11-05T00:20:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d8e56988f87ecdfa0b9bfdb269f6d904840cc6dd'/>
<id>d8e56988f87ecdfa0b9bfdb269f6d904840cc6dd</id>
<content type='text'>
https://github.com/llvm/llvm-project/issues/159474

Resubmitting https://github.com/llvm/llvm-project/pull/162876 with fixes
as it broke some buildbots:
 - Fix comparisons of integer expressions of different signedness
- Not check for specific errnos in tests, as they might not be available
on all platforms</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/llvm/llvm-project/issues/159474

Resubmitting https://github.com/llvm/llvm-project/pull/162876 with fixes
as it broke some buildbots:
 - Fix comparisons of integer expressions of different signedness
- Not check for specific errnos in tests, as they might not be available
on all platforms</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[libc] Add printf error handling" (#166232)</title>
<updated>2025-11-03T20:50:11+00:00</updated>
<author>
<name>Kewen Meng</name>
<email>Kewen.Meng@amd.com</email>
</author>
<published>2025-11-03T20:50:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=346da3dfd3e70ca82a7df968c79666ff0b8c77c5'/>
<id>346da3dfd3e70ca82a7df968c79666ff0b8c77c5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Add printf error handling (#162876)</title>
<updated>2025-11-03T19:15:14+00:00</updated>
<author>
<name>Marcell Leleszi</name>
<email>59964679+mleleszi@users.noreply.github.com</email>
</author>
<published>2025-11-03T19:15:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0c707c9713f0657f7208b8f9a95a13af749d95c5'/>
<id>0c707c9713f0657f7208b8f9a95a13af749d95c5</id>
<content type='text'>
[#159474](https://github.com/llvm/llvm-project/issues/159474)

- All printf variants set errno and consistently return -1 on error,
instead of returning various predefined error codes
- Return value overflow handling is added</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[#159474](https://github.com/llvm/llvm-project/issues/159474)

- All printf variants set errno and consistently return -1 on error,
instead of returning various predefined error codes
- Return value overflow handling is added</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Change __builtin_memcpy to inline_memcpy. (#158345)</title>
<updated>2025-09-12T21:57:08+00:00</updated>
<author>
<name>lntue</name>
<email>lntue@google.com</email>
</author>
<published>2025-09-12T21:57:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f019e2368b137371d248a7ddbe37f76466c2d44d'/>
<id>f019e2368b137371d248a7ddbe37f76466c2d44d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<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>
</feed>
