<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/libc, 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] Add missing dependencies for arpa/inet.h header. (#168951)</title>
<updated>2025-11-20T22:04:05+00:00</updated>
<author>
<name>Alexey Samsonov</name>
<email>vonosmas@gmail.com</email>
</author>
<published>2025-11-20T22:04:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=11362395615a6d728f98440e41bbebb3976d1941'/>
<id>11362395615a6d728f98440e41bbebb3976d1941</id>
<content type='text'>
Add dependency on headers with `in_addr` and `in_addr_t` type
definitions to ensure that these headers will be properly installed by
"install-libc" CMake target.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add dependency on headers with `in_addr` and `in_addr_t` type
definitions to ensure that these headers will be properly installed by
"install-libc" CMake target.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Removed unused flags from baremetal cache files (#168942)</title>
<updated>2025-11-20T20:44:17+00:00</updated>
<author>
<name>Petr Hosek</name>
<email>phosek@google.com</email>
</author>
<published>2025-11-20T20:44:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=91e777f26d9e4cd298f10c51aba76a6c452682be'/>
<id>91e777f26d9e4cd298f10c51aba76a6c452682be</id>
<content type='text'>
These flags are not needed for building libc.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These flags are not needed for building libc.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][math] Add float-only implementation for atanf. (#167004)</title>
<updated>2025-11-20T14:42:13+00:00</updated>
<author>
<name>lntue</name>
<email>lntue@google.com</email>
</author>
<published>2025-11-20T14:42:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=aa3f930931e65b02bacac0c7dfa52a181a0fd5bb'/>
<id>aa3f930931e65b02bacac0c7dfa52a181a0fd5bb</id>
<content type='text'>
Algorithm:
```
  1)  atan(x) = sign(x) * atan(|x|)

  2)  If |x| &gt; 1 + 1/32, atan(|x|) = pi/2 - atan(1/|x|)

  3)  For 1/16 &lt; |x| &lt; 1 + 1/32, we find k such that: | |x| - k/16 | &lt;= 1/32.
      Let y = |x| - k/16, then using the angle summation formula, we have:
    atan(|x|) = atan(k/16) + atan( (|x| - k/16) / (1 + |x| * k/16) )
              = atan(k/16) + atan( y / (1 + (y + k/16) * k/16 )
              = atan(k/16) + atan( y / ((1 + k^2/256) + y * k/16) )

  4)  Let u = y / (1 + k^2/256), then we can rewritten the above as:
    atan(|x|) = atan(k/16) + atan( u / (1 + u * k/16) )
              ~ atan(k/16) + (u - k/16 * u^2 + (k^2/256 - 1/3) * u^3 +
                              + (k/16 - (k/16)^3) * u^4) + O(u^5)
```

With all the computations are done in single precision (float), the
total of approximation errors and rounding errors is bounded by 4 ULPs.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Algorithm:
```
  1)  atan(x) = sign(x) * atan(|x|)

  2)  If |x| &gt; 1 + 1/32, atan(|x|) = pi/2 - atan(1/|x|)

  3)  For 1/16 &lt; |x| &lt; 1 + 1/32, we find k such that: | |x| - k/16 | &lt;= 1/32.
      Let y = |x| - k/16, then using the angle summation formula, we have:
    atan(|x|) = atan(k/16) + atan( (|x| - k/16) / (1 + |x| * k/16) )
              = atan(k/16) + atan( y / (1 + (y + k/16) * k/16 )
              = atan(k/16) + atan( y / ((1 + k^2/256) + y * k/16) )

  4)  Let u = y / (1 + k^2/256), then we can rewritten the above as:
    atan(|x|) = atan(k/16) + atan( u / (1 + u * k/16) )
              ~ atan(k/16) + (u - k/16 * u^2 + (k^2/256 - 1/3) * u^3 +
                              + (k/16 - (k/16)^3) * u^4) + O(u^5)
```

With all the computations are done in single precision (float), the
total of approximation errors and rounding errors is bounded by 4 ULPs.</pre>
</div>
</content>
</entry>
<entry>
<title>[Clang] Gut the libc wrapper headers and simplify (#168438)</title>
<updated>2025-11-19T13:18:13+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2025-11-19T13:18:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7fe35641672b6431134e99af658bd79fd438da54'/>
<id>7fe35641672b6431134e99af658bd79fd438da54</id>
<content type='text'>
Summary:
These were originally intended to represent the functions that are
present on the GPU as to be provided by the LLVM libc implementation.
The original plan was that LLVM libc would report which functions were
supported and then the offload interface would mark those as supported.
The problem is that these wrapper headers are very difficult to make
work given the various libc extensions everyone does so they were
extremely fragile.

OpenMP already declares all functions used inside of a target region as
implicitly host / device, while these headers weren't even used for CUDA
/ HIP yet anyway. The only things we need to define right now are the
stdio FILE types. If we want to make this work for CUDA we'd need to
define these manually, but we're a ways off and that's way easier
because they do proper overloading.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
These were originally intended to represent the functions that are
present on the GPU as to be provided by the LLVM libc implementation.
The original plan was that LLVM libc would report which functions were
supported and then the offload interface would mark those as supported.
The problem is that these wrapper headers are very difficult to make
work given the various libc extensions everyone does so they were
extremely fragile.

OpenMP already declares all functions used inside of a target region as
implicitly host / device, while these headers weren't even used for CUDA
/ HIP yet anyway. The only things we need to define right now are the
stdio FILE types. If we want to make this work for CUDA we'd need to
define these manually, but we're a ways off and that's way easier
because they do proper overloading.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Fix -Wshorten-64-to-32 in fileop_test. (#168451)</title>
<updated>2025-11-19T05:41:55+00:00</updated>
<author>
<name>Alexey Samsonov</name>
<email>vonosmas@gmail.com</email>
</author>
<published>2025-11-19T05:41:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5bba4fd75dd513423ff8bb905f89b60558099578'/>
<id>5bba4fd75dd513423ff8bb905f89b60558099578</id>
<content type='text'>
Explicitly cast 0 to size_t type to match fread() return type. This
follows the pattern used elsewhere in this file, and fixes
-Wshorten-64-to-32 warnings when building the test.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Explicitly cast 0 to size_t type to match fread() return type. This
follows the pattern used elsewhere in this file, and fixes
-Wshorten-64-to-32 warnings when building the test.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Implement pkey_alloc/free/get/set/mprotect for x86_64 linux (#162362)</title>
<updated>2025-11-18T22:30:15+00:00</updated>
<author>
<name>Jackson Stogel</name>
<email>jtstogel@gmail.com</email>
</author>
<published>2025-11-18T22:30:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=db71cc58ec9471c67c6b80996930a19222dd9f03'/>
<id>db71cc58ec9471c67c6b80996930a19222dd9f03</id>
<content type='text'>
This patch provides definitions for `pkey_*` functions for linux x86_64.

`pkey_alloc`, `pkey_free`, and `pkey_mprotect` are simple syscall
wrappers. `pkey_set` and `pkey_get` modify architecture-specific
registers. The logic for these live in architecture specific
directories:

* `libc/src/sys/mman/linux/x86_64/pkey_common.h` has a real
implementation
* `libc/src/sys/mman/linux/generic/pkey_common.h` contains stubs that
just return `ENOSYS`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch provides definitions for `pkey_*` functions for linux x86_64.

`pkey_alloc`, `pkey_free`, and `pkey_mprotect` are simple syscall
wrappers. `pkey_set` and `pkey_get` modify architecture-specific
registers. The logic for these live in architecture specific
directories:

* `libc/src/sys/mman/linux/x86_64/pkey_common.h` has a real
implementation
* `libc/src/sys/mman/linux/generic/pkey_common.h` contains stubs that
just return `ENOSYS`.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] implement inet_addr (#167708)</title>
<updated>2025-11-18T02:17:19+00:00</updated>
<author>
<name>Connector Switch</name>
<email>c8ef@outlook.com</email>
</author>
<published>2025-11-18T02:17:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a5590a2aabc29f37f9c3d0ce738553e612e13e5c'/>
<id>a5590a2aabc29f37f9c3d0ce738553e612e13e5c</id>
<content type='text'>
This patch adds the posix function `inet_addr`. Since most of the
parsing logic is delegated to `inet_aton`, I have only included some
basic smoke tests for testing purposes.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds the posix function `inet_addr`. Since most of the
parsing logic is delegated to `inet_aton`, I have only included some
basic smoke tests for testing purposes.</pre>
</div>
</content>
</entry>
<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] Implement wcstod and wcstold. (#168020)</title>
<updated>2025-11-17T21:42:12+00:00</updated>
<author>
<name>Alexey Samsonov</name>
<email>vonosmas@gmail.com</email>
</author>
<published>2025-11-17T21:42:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=92c8c87c49100e3f14e3ec46abf47f27191f8b53'/>
<id>92c8c87c49100e3f14e3ec46abf47f27191f8b53</id>
<content type='text'>
These are simply implemented as specializations of strtofloatingpoint
for double / long double and for wchar_t. The unit tests are copied from
the strtod / strtold ones.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These are simply implemented as specializations of strtofloatingpoint
for double / long double and for wchar_t. The unit tests are copied from
the strtod / strtold ones.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][Github] Perform baremetal libc builds (#167583)</title>
<updated>2025-11-17T20:08:39+00:00</updated>
<author>
<name>Prabhu Rajasekaran</name>
<email>prabhukr@google.com</email>
</author>
<published>2025-11-17T20:08:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b32c434426a181590234f65f2e32f43735bf5b5a'/>
<id>b32c434426a181590234f65f2e32f43735bf5b5a</id>
<content type='text'>
Currently there are no 32 bit presubmit builds for libc. This PR
performs 32 bit build only (no test) to check any changes that land in
libc break 32 bit builds.

Co-authored-by: Aiden Grossman &lt;aidengrossman@google.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently there are no 32 bit presubmit builds for libc. This PR
performs 32 bit build only (no test) to check any changes that land in
libc break 32 bit builds.

Co-authored-by: Aiden Grossman &lt;aidengrossman@google.com&gt;</pre>
</div>
</content>
</entry>
</feed>
