New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal linkage in Picolib breaks libcxx module tests #76980
Comments
@llvm/issue-subscribers-clang-modules Author: Mark de Wever (mordante)
At least since [C11](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf#%5B%7B%22num%22%3A429%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22XYZ%22%7D%2C-27%2C816%2Cnull%5D) "Any declaration of a library function shall have external linkage." This is important for C++20 modules. Named declarations with internal linkage can't be exported, which prevents using these declarations in the C++23 `std` and `std.compat` module.
Several declarations in Picolib have internal linkage, for |
To reproduce, check out the branch https://github.com/llvm/llvm-project/tree/users/mordante/adds_module_testing and remove the PicoLib xfail:
Then make sure you have clang 16.x or higher, and qemu-system-arm 8.1.3 or greater.
The builder downloads the picolib release each time, might have to hack in a local path for that as you make changes. The version in use now is 1.8.5. |
I've brought this to the attention of the team at Arm handling this area. |
Thanks! Note that this issue is not just needed for libc++, it's required for conformance with the C standard too. |
External linkage is required by C11. Not conforming to this results in issues in implementation of C++ modules. [1] llvm/llvm-project#76980
External linkage is required by C11. Not conforming to this results in issues in implementation of C++ modules. [1] llvm/llvm-project#76980
I am trying to sort out the There are other errors related to |
Where available, picolibc uses the Example: file-1.c:
file-2.c:
Note that the inline and extern versions generate different results (which is "wrong", but useful for testing).
As you can see, |
Great to hear.
I noticed that too, I just added a fix here f8bf61f @keith-packard is this the current situation or the proposed change? In the example |
|
The updated picolibc version has "isblank" function with external linkage. This is required for C++ modules support.[1] [1] llvm#76980
The updated picolibc version has "isblank" function with external linkage. This is required for C++ modules support. This should solve all the problems reported in #76980, but we'll wait to validate this with the modules build without closing that issue.
The updated picolibc version has "isblank" function with external linkage. This is required for C++ modules support. This should solve all the problems reported in llvm#76980, but we'll wait to validate this with the modules build without closing that issue.
With the picolib updates this issue is resolved and modules are now tested with Picolib in the CI. |
At least since C11 "Any declaration of a library function shall have external linkage." This is important for C++20 modules. Named declarations with internal linkage can't be exported, which prevents using these declarations in the C++23
std
andstd.compat
module.Several declarations in Picolib have internal linkage, for example
static __inline int isblank(int c)
. See https://buildkite.com/llvm-project/libcxx-ci/builds/32428#018c9247-50ba-4728-b13d-fb064eba3707 for more issues. This prevents using this library in the C++ modulesThe text was updated successfully, but these errors were encountered: