This is an archive of the discontinued LLVM Phabricator instance.

[libc] Align the stack pointer in the start function.
ClosedPublic

Authored by sivachandra on Mar 7 2022, 1:44 AM.

Details

Summary

The loader TLS test for x86_64, which now passes, has been enabled.
A future change should enable the test for aarch64 as well.

Diff Detail

Event Timeline

sivachandra created this revision.Mar 7 2022, 1:44 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 7 2022, 1:44 AM
sivachandra requested review of this revision.Mar 7 2022, 1:44 AM

Nice find - A couple comments within.

libc/loader/linux/x86_64/start.cpp
96

Would attribute((aligned)) not work here? If not, it would be nice to say why

libc/test/loader/linux/CMakeLists.txt
60

It might be nice to have this be a constexpr of tls_enabled or similar for arch bringup.

Add a comment explaining why a compiler attribute to align
the stack pointer will not help.

sivachandra added inline comments.Mar 7 2022, 9:31 AM
libc/loader/linux/x86_64/start.cpp
96

Added comment now explaining why an attribute will not help.

libc/test/loader/linux/CMakeLists.txt
60

Can you explain how you envision this constexpr to be used? Is it CMake variable or a variable in the source code?

jeffbailey accepted this revision.Mar 7 2022, 9:33 AM
jeffbailey added inline comments.
libc/test/loader/linux/CMakeLists.txt
60

Sorry - I was clearly not awake this morning and through this was in the C++ code.

This revision is now accepted and ready to land.Mar 7 2022, 9:33 AM
This revision was automatically updated to reflect the committed changes.