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

[OMPD] Runtime Entry Point functions for OMPD in libomp.so need C linkage as per standard. #79246

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

vigbalu
Copy link
Contributor

@vigbalu vigbalu commented Jan 24, 2024

Adding extern "C" to all the entry point functions to make sure that these functions are not mangled.

@llvmbot llvmbot added the openmp:libomp OpenMP host runtime label Jan 24, 2024
@jprotze
Copy link
Collaborator

jprotze commented Jan 24, 2024

The header file published by the OpenMP LC just has one big extern "C" scope: https://github.com/OpenMP/sources/blob/main/include/omp-tools.h

Is there any good reason, to not follow this approach?

Encapsulating required OMPD and OMPT data structures and signatures within
extern "C" as per the supplementary soure file for omp-tools.h provided by
the OpenMP spec
https://github.com/OpenMP/sources/blob/main/include/omp-tools.h,
thus ensuring that the OMPD runtime entry point functions have C linkage
and are not mangled.
@vigbalu vigbalu force-pushed the OMPD_demangle_runtime_entry_fns branch from ae2c66c to 9c3eb85 Compare January 29, 2024 10:37
@vigbalu
Copy link
Contributor Author

vigbalu commented Jan 29, 2024

Joachim, have modified as per supplement provided by standard.
thanks for the suggestion.

Copy link
Collaborator

@jprotze jprotze left a comment

Choose a reason for hiding this comment

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

Lgtm

@jprotze jprotze merged commit edfc21a into llvm:main Feb 6, 2024
4 checks passed
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.

None yet

3 participants