Skip to content

[openmp] Support CET in z_Linux_asm.S #123213

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

Merged
merged 1 commit into from
Jan 17, 2025
Merged

Conversation

nikic
Copy link
Contributor

@nikic nikic commented Jan 16, 2025

When libomp is built with -cf-protection, add endbr instructions to the start of functions for Intel CET support.

When libomp is built with -cf-protection, add endbr instructions
to the start of functions for Intel CET support.
@llvmbot llvmbot added the openmp:libomp OpenMP host runtime label Jan 16, 2025

# if !defined(_CET_ENDBR)
# define _CET_ENDBR
# endif
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is adopted from

#if defined(__ELF__) && defined(__CET__) && defined(__has_include)
#if __has_include(<cet.h>)
#include <cet.h>
#endif
#endif
#if !defined(_CET_ENDBR)
#define _CET_ENDBR
#endif
We have a couple minor variants of this in different asm files.

Copy link
Contributor

@mjklemm mjklemm left a comment

Choose a reason for hiding this comment

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

LGTM

@nikic nikic merged commit 90a05f3 into llvm:main Jan 17, 2025
8 checks passed
@nikic nikic deleted the openmp-cet-support branch January 17, 2025 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openmp:libomp OpenMP host runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants