-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc++] Add "using-if-exists" to timespec_get in modules #78686
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
Conversation
@llvm/pr-subscribers-libcxx Author: Dominik Wójt (domin144) ChangesPicolibc does not provide timespec_get function. Adding "using-if-exists" attribute fixes the modules. This is a follow up patch for #78580 Full diff: https://github.com/llvm/llvm-project/pull/78686.diff 3 Files Affected:
diff --git a/libcxx/modules/std.compat/ctime.inc b/libcxx/modules/std.compat/ctime.inc
index 92e3403a5e58e27..6e621f494348d74 100644
--- a/libcxx/modules/std.compat/ctime.inc
+++ b/libcxx/modules/std.compat/ctime.inc
@@ -24,5 +24,5 @@ export {
using ::mktime;
using ::strftime;
using ::time;
- using ::timespec_get;
+ using ::timespec_get _LIBCPP_USING_IF_EXISTS;
} // export
diff --git a/libcxx/modules/std/ctime.inc b/libcxx/modules/std/ctime.inc
index c407ffc35e3fe3c..c98cb28e649b85e 100644
--- a/libcxx/modules/std/ctime.inc
+++ b/libcxx/modules/std/ctime.inc
@@ -24,5 +24,5 @@ export namespace std {
using std::mktime;
using std::strftime;
using std::time;
- using std::timespec_get;
+ using std::timespec_get _LIBCPP_USING_IF_EXISTS;
} // namespace std
diff --git a/libcxx/test/std/modules/std.compat.pass.cpp b/libcxx/test/std/modules/std.compat.pass.cpp
index 9a2f330d722edde..a33ed3b6b64533a 100644
--- a/libcxx/test/std/modules/std.compat.pass.cpp
+++ b/libcxx/test/std/modules/std.compat.pass.cpp
@@ -11,10 +11,6 @@
// UNSUPPORTED: libcpp-has-no-std-modules
// UNSUPPORTED: clang-modules-build
-// picolibc does not provide the required timespec_get function, and the
-// "using-if-exists" mechanism apparently did not work here.
-// XFAIL: LIBCXX-PICOLIBC-FIXME
-
// A minimal test to validate import works.
import std.compat;
|
After rebasing the patch I re-run the tests and realized the test is skipped now. Not sure why, and if this is intentional. |
Ok, I can see, that now the module tests have to be enabled with |
The patches to make modules work with older CMake versions have been reverted. I expect I can reland that patch soon. After that you can rebase this patch on main again and we can test it again. |
I've just relanded the dependencies for this patch. Could you rebase this patch to see whether the CI is green? |
Picolibc does not provide timespec_get function. Adding "using-if-exists" attribute fixes the modules.
e3e526d
to
7443ba5
Compare
Thanks for an update. I rebased and I can see the picolibc tests passed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Great to see Picolib working for modules! Since we're getting close the branching I'll directly merge the patch.
Picolibc does not provide timespec_get function. Adding "using-if-exists" attribute fixes the modules.
This is a follow up patch for #78580