[Openmp-commits] [openmp] [OMPD] Runtime Entry Point functions for OMPD in libomp.so need C linkage as per standard. (PR #79246)

via Openmp-commits openmp-commits at lists.llvm.org
Tue Jan 23 19:11:39 PST 2024


https://github.com/vigbalu created https://github.com/llvm/llvm-project/pull/79246

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

>From ae2c66c8b6c1f94e8b66cad205c6f880089ebb0a Mon Sep 17 00:00:00 2001
From: Vignesh Balasubramanian <Vignesh.Balasubrmanian at amd.com>
Date: Wed, 24 Jan 2024 08:07:39 +0530
Subject: [PATCH] [OMPD] Runtime Entry Point functions for OMPD in libomp.so is
 mangled.

Adding extern "C" to all the entry point functions to make sure
that these functions are not mangled.
---
 openmp/runtime/src/include/omp-tools.h.var | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/openmp/runtime/src/include/omp-tools.h.var b/openmp/runtime/src/include/omp-tools.h.var
index a3ec0309db18c14..449f1a8dbe43d40 100644
--- a/openmp/runtime/src/include/omp-tools.h.var
+++ b/openmp/runtime/src/include/omp-tools.h.var
@@ -1229,20 +1229,44 @@ typedef struct ompd_callbacks_t {
       get_thread_context_for_thread_id;
 } ompd_callbacks_t;
 
+#if defined(__cplusplus)
+extern "C"
+#endif
 void ompd_bp_parallel_begin(void);
 
+#if defined(__cplusplus)
+extern "C"
+#endif
 void ompd_bp_parallel_end(void);
 
+#if defined(__cplusplus)
+extern "C"
+#endif
 void ompd_bp_task_begin(void);
 
+#if defined(__cplusplus)
+extern "C"
+#endif
 void ompd_bp_task_end(void);
 
+#if defined(__cplusplus)
+extern "C"
+#endif
 void ompd_bp_thread_begin(void);
 
+#if defined(__cplusplus)
+extern "C"
+#endif
 void ompd_bp_thread_end(void);
 
+#if defined(__cplusplus)
+extern "C"
+#endif
 void ompd_bp_device_begin(void);
 
+#if defined(__cplusplus)
+extern "C"
+#endif
 void ompd_bp_device_end(void);
 
 ompd_rc_t ompd_initialize(ompd_word_t api_version,



More information about the Openmp-commits mailing list