Often atexit is implemented using __cxa_atexit. I have not implemented __cxa_atexit here because it potentially requires more discussion. It is unique for llvm-libc (I think) that it is an exported symbol that wouldn’t be defined in any spec file because it doesn’t have a header. Implementing it will be trivial given what is here already, but I figured it would be more contentious so it can be implemented later.
Details
Details
Diff Detail
Diff Detail
Event Timeline
libc/test/src/stdlib/CMakeLists.txt | ||
---|---|---|
204–236 | if these tests need LLVM_LIBC_FULL_BUILD, why don't you wrap them entirely inside if(LLVM_LIBC_FULL_BUILD) instead of early return? This might be surprising for someone adding new tests to the end of the file. |
Comment Actions
Few notes:
- I see an empty diff between 407760 and 407900.
- While not required for this patch __cxa_atexit need not be considered as an entry point. You can implement it in a helper object library.
- We should not need LLVM_LIBC_HAS_MALLOC. It is not setup that way now so we should fix it before we end up with a lot of these conditionals. One should be able to use allocators from another libc even in full mode.
libc/src/stdlib/atexit.cpp | ||
---|---|---|
10 | please run clang format on this patch before committing. |
clang-format: please reformat the code