Skip to content
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

[libc] add an _Exit declaration to the _Exit proxy func header #114904

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Jobhdez
Copy link
Member

@Jobhdez Jobhdez commented Nov 5, 2024

This improves/fixes this pr #114718. In this pr we added an _Exit declaration to hdr/func/_Exit.h instead of the stdlib.h header based on comments from @nickdesaulniers.

@llvmbot
Copy link
Collaborator

llvmbot commented Nov 5, 2024

@llvm/pr-subscribers-libc

Author: Job Henandez Lara (Jobhdez)

Changes

This improves/fixes this pr #114718. In this pr we added an _Exit declaration to hdr/func/_Exit.h instead of the stdlib.h header based on comments from @nickdesaulniers.


Full diff: https://github.com/llvm/llvm-project/pull/114904.diff

1 Files Affected:

  • (modified) libc/hdr/func/_Exit.h (+1-2)
diff --git a/libc/hdr/func/_Exit.h b/libc/hdr/func/_Exit.h
index e024a651a50bcf..b8160e9af3e4e3 100644
--- a/libc/hdr/func/_Exit.h
+++ b/libc/hdr/func/_Exit.h
@@ -10,8 +10,7 @@
 #define LLVM_LIBC_HDR_FUNC_EXIT_H
 
 #ifdef LIBC_FULL_BUILD
-// We will use the `_Exit` declaration from our generated stdlib.h
-#include <stdlib.h>
+extern "C" [[noreturn]] void _Exit(int) noexcept;
 
 #else // Overlay mode
 

Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need a proxy header for _Exit at all? Why don't we just call our internal _Exit in the atexit and atquickexit tests?

@Jobhdez
Copy link
Member Author

Jobhdez commented Nov 5, 2024

Why do we need a proxy header for _Exit at all? Why don't we just call our internal _Exit in the atexit and atquickexit tests?

Yeah this makes sense. I will update the PR to remove the _Exit proxy header, and switch those 2 tests to use LIBC_NAMESPACE::_Exit instead. Can you please just confirm that this is what we’re going to do? Thanks

@michaelrj-google
Copy link
Contributor

Yes that sounds like the correct thing to do. Thank you!

@Jobhdez
Copy link
Member Author

Jobhdez commented Nov 5, 2024

Yes that sounds like the correct thing to do. Thank you!

No problem!

Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please update the title and description

@Jobhdez
Copy link
Member Author

Jobhdez commented Nov 7, 2024

LGTM, please update the title and description

ok I will. do you want me to merge after I change the title? or do you want to merge yourself?

Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fine to merge as-is. I'd recommend waiting until the morning to merge it (so that people can help troubleshoot if necessary), but it's up to you.

@Jobhdez
Copy link
Member Author

Jobhdez commented Nov 7, 2024

This should be fine to merge as-is. I'd recommend waiting until the morning to merge it (so that people can help troubleshoot if necessary), but it's up to you.

ok ill wait until tomorrow morning. thanks. can you please suggest a new title for the pr? thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants