Added
Link Here
|
1 |
diff --git projects/openmp/libomptarget/plugins/exports projects/openmp/libomptarget/plugins/exports |
2 |
index a14bedf0791a..cc7beda183af 100644 |
3 |
--- projects/openmp/libomptarget/plugins/exports |
4 |
+++ projects/openmp/libomptarget/plugins/exports |
5 |
@@ -1,16 +1,6 @@ |
6 |
VERS1.0 { |
7 |
global: |
8 |
- __tgt_rtl_is_valid_binary; |
9 |
- __tgt_rtl_number_of_devices; |
10 |
- __tgt_rtl_init_requires; |
11 |
- __tgt_rtl_init_device; |
12 |
- __tgt_rtl_load_binary; |
13 |
- __tgt_rtl_data_alloc; |
14 |
- __tgt_rtl_data_submit; |
15 |
- __tgt_rtl_data_retrieve; |
16 |
- __tgt_rtl_data_delete; |
17 |
- __tgt_rtl_run_target_team_region; |
18 |
- __tgt_rtl_run_target_region; |
19 |
+ __tgt_rtl*; |
20 |
local: |
21 |
*; |
22 |
}; |
23 |
diff --git projects/openmp/runtime/cmake/LibompHandleFlags.cmake projects/openmp/runtime/cmake/LibompHandleFlags.cmake |
24 |
index 0b8e3a35c888..cacc192eb378 100644 |
25 |
--- projects/openmp/runtime/cmake/LibompHandleFlags.cmake |
26 |
+++ projects/openmp/runtime/cmake/LibompHandleFlags.cmake |
27 |
@@ -94,7 +94,6 @@ function(libomp_get_ldflags ldflags) |
28 |
IF_DEFINED CMAKE_C_OSX_CURRENT_VERSION_FLAG) |
29 |
libomp_append(ldflags_local "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}${LIBOMP_VERSION_MAJOR}.${LIBOMP_VERSION_MINOR}" |
30 |
IF_DEFINED CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG) |
31 |
- libomp_append(ldflags_local -Wl,--warn-shared-textrel LIBOMP_HAVE_WARN_SHARED_TEXTREL_FLAG) |
32 |
libomp_append(ldflags_local -Wl,--as-needed LIBOMP_HAVE_AS_NEEDED_FLAG) |
33 |
libomp_append(ldflags_local "-Wl,--version-script=${LIBOMP_SRC_DIR}/exports_so.txt" LIBOMP_HAVE_VERSION_SCRIPT_FLAG) |
34 |
libomp_append(ldflags_local -static-libgcc LIBOMP_HAVE_STATIC_LIBGCC_FLAG) |
35 |
diff --git projects/openmp/runtime/cmake/config-ix.cmake projects/openmp/runtime/cmake/config-ix.cmake |
36 |
index 3419dd8cd788..fb7a644155e2 100644 |
37 |
--- projects/openmp/runtime/cmake/config-ix.cmake |
38 |
+++ projects/openmp/runtime/cmake/config-ix.cmake |
39 |
@@ -100,9 +100,8 @@ if(WIN32) |
40 |
libomp_check_linker_flag(/SAFESEH LIBOMP_HAVE_SAFESEH_FLAG) |
41 |
elseif(NOT APPLE) |
42 |
libomp_check_linker_flag(-Wl,-x LIBOMP_HAVE_X_FLAG) |
43 |
- libomp_check_linker_flag(-Wl,--warn-shared-textrel LIBOMP_HAVE_WARN_SHARED_TEXTREL_FLAG) |
44 |
libomp_check_linker_flag(-Wl,--as-needed LIBOMP_HAVE_AS_NEEDED_FLAG) |
45 |
- libomp_check_linker_flag("-Wl,--version-script=${LIBOMP_SRC_DIR}/exports_so.txt" LIBOMP_HAVE_VERSION_SCRIPT_FLAG) |
46 |
+ libomp_check_linker_flag("-Wl,--version-script=${LIBOMP_SRC_DIR}/exports_test_so.txt" LIBOMP_HAVE_VERSION_SCRIPT_FLAG) |
47 |
libomp_check_linker_flag(-static-libgcc LIBOMP_HAVE_STATIC_LIBGCC_FLAG) |
48 |
libomp_check_linker_flag(-Wl,-z,noexecstack LIBOMP_HAVE_Z_NOEXECSTACK_FLAG) |
49 |
endif() |
50 |
diff --git projects/openmp/runtime/src/exports_so.txt projects/openmp/runtime/src/exports_so.txt |
51 |
index f7de5fd6474f..07a5424595bb 100644 |
52 |
--- projects/openmp/runtime/src/exports_so.txt |
53 |
+++ projects/openmp/runtime/src/exports_so.txt |
54 |
@@ -74,10 +74,8 @@ VERSION { |
55 |
__kmp_fork_call; |
56 |
__kmp_invoke_microtask; |
57 |
#if KMP_USE_MONITOR |
58 |
- __kmp_launch_monitor; |
59 |
__kmp_reap_monitor; |
60 |
#endif |
61 |
- __kmp_launch_worker; |
62 |
__kmp_reap_worker; |
63 |
__kmp_release_64; |
64 |
__kmp_wait_64; |
65 |
diff --git projects/openmp/runtime/src/exports_test_so.txt projects/openmp/runtime/src/exports_test_so.txt |
66 |
new file mode 100644 |
67 |
index 000000000000..912d160e7c06 |
68 |
--- /dev/null |
69 |
+++ projects/openmp/runtime/src/exports_test_so.txt |
70 |
@@ -0,0 +1,60 @@ |
71 |
+# exports_test_so.txt # |
72 |
+ |
73 |
+# |
74 |
+#//===----------------------------------------------------------------------===// |
75 |
+#// |
76 |
+#// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
77 |
+#// See https://llvm.org/LICENSE.txt for license information. |
78 |
+#// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
79 |
+#// |
80 |
+#//===----------------------------------------------------------------------===// |
81 |
+# |
82 |
+ |
83 |
+# This is used only to test if the linker supports version scripts. If the full |
84 |
+# version script it used we may error on undefined symbols and erroneously fail. |
85 |
+ |
86 |
+VERSION { |
87 |
+ |
88 |
+ global: # Exported symbols. |
89 |
+ |
90 |
+ *; # All symbols as exported for testing. |
91 |
+ |
92 |
+ local: # Non-exported symbols. |
93 |
+ |
94 |
+ *; # All other symbols are not exported. |
95 |
+ |
96 |
+}; # VERSION |
97 |
+ |
98 |
+# sets up GCC OMP_ version dependency chain |
99 |
+OMP_1.0 { |
100 |
+}; |
101 |
+OMP_2.0 { |
102 |
+} OMP_1.0; |
103 |
+OMP_3.0 { |
104 |
+} OMP_2.0; |
105 |
+OMP_3.1 { |
106 |
+} OMP_3.0; |
107 |
+OMP_4.0 { |
108 |
+} OMP_3.1; |
109 |
+OMP_4.5 { |
110 |
+} OMP_4.0; |
111 |
+OMP_5.0 { |
112 |
+} OMP_4.5; |
113 |
+ |
114 |
+# sets up GCC GOMP_ version dependency chain |
115 |
+GOMP_1.0 { |
116 |
+}; |
117 |
+GOMP_2.0 { |
118 |
+} GOMP_1.0; |
119 |
+GOMP_3.0 { |
120 |
+} GOMP_2.0; |
121 |
+GOMP_4.0 { |
122 |
+} GOMP_3.0; |
123 |
+GOMP_4.5 { |
124 |
+} GOMP_4.0; |
125 |
+GOMP_5.0 { |
126 |
+} GOMP_4.5; |
127 |
+GOMP_5.0.1 { |
128 |
+} GOMP_5.0; |
129 |
+ |
130 |
+# end of file # |
131 |
diff --git projects/openmp/runtime/src/kmp_runtime.cpp projects/openmp/runtime/src/kmp_runtime.cpp |
132 |
index acd157db8e52..acc431ea0d7e 100644 |
133 |
--- projects/openmp/runtime/src/kmp_runtime.cpp |
134 |
+++ projects/openmp/runtime/src/kmp_runtime.cpp |
135 |
@@ -8297,3 +8297,20 @@ int __kmp_pause_resource(kmp_pause_status_t level) { |
136 |
return 1; |
137 |
} |
138 |
} |
139 |
+ |
140 |
+// Empty symbols to export (see exports_so.txt) when feature is disabled |
141 |
+extern "C" { |
142 |
+#if !KMP_STATS_ENABLED |
143 |
+void __kmp_reset_stats() {} |
144 |
+#endif |
145 |
+#if !USE_DEBUGGER |
146 |
+int __kmp_omp_debug_struct_info = FALSE; |
147 |
+int __kmp_debugging = FALSE; |
148 |
+#endif |
149 |
+#if !USE_ITT_BUILD || !USE_ITT_NOTIFY |
150 |
+void __kmp_itt_fini_ittlib() {} |
151 |
+void __kmp_itt_init_ittlib() {} |
152 |
+#endif |
153 |
+} |
154 |
+ |
155 |
+// end of file |
156 |
diff --git projects/openmp/runtime/src/kmp_utility.cpp projects/openmp/runtime/src/kmp_utility.cpp |
157 |
index 44a99d0455b3..e04c9cbf4537 100644 |
158 |
--- projects/openmp/runtime/src/kmp_utility.cpp |
159 |
+++ projects/openmp/runtime/src/kmp_utility.cpp |
160 |
@@ -407,3 +407,16 @@ void __kmp_expand_file_name(char *result, size_t rlen, char *pattern) { |
161 |
|
162 |
*pos = '\0'; |
163 |
} |
164 |
+ |
165 |
+#if !OMPT_SUPPORT |
166 |
+extern "C" { |
167 |
+typedef struct ompt_start_tool_result_t ompt_start_tool_result_t; |
168 |
+// Define symbols expected by VERSION script |
169 |
+ompt_start_tool_result_t *ompt_start_tool(unsigned int omp_version, |
170 |
+ const char *runtime_version) { |
171 |
+ return nullptr; |
172 |
+} |
173 |
+ |
174 |
+void ompt_libomp_connect(ompt_start_tool_result_t *result) { result = nullptr; } |
175 |
+} |
176 |
+#endif |
177 |
diff --git projects/openmp/runtime/src/z_Linux_util.cpp projects/openmp/runtime/src/z_Linux_util.cpp |
178 |
index 1daa3d31047e..174ef2145205 100644 |
179 |
--- projects/openmp/runtime/src/z_Linux_util.cpp |
180 |
+++ projects/openmp/runtime/src/z_Linux_util.cpp |
181 |
@@ -1049,7 +1049,7 @@ void __kmp_exit_thread(int exit_status) { |
182 |
#if KMP_USE_MONITOR |
183 |
void __kmp_resume_monitor(); |
184 |
|
185 |
-void __kmp_reap_monitor(kmp_info_t *th) { |
186 |
+extern "C" void __kmp_reap_monitor(kmp_info_t *th) { |
187 |
int status; |
188 |
void *exit_val; |
189 |
|
190 |
@@ -1091,6 +1091,12 @@ void __kmp_reap_monitor(kmp_info_t *th) { |
191 |
|
192 |
KMP_MB(); /* Flush all pending memory write invalidates. */ |
193 |
} |
194 |
+#else |
195 |
+// Empty symbol to export (see exports_so.txt) when |
196 |
+// monitor thread feature is disabled |
197 |
+extern "C" void __kmp_reap_monitor(kmp_info_t *th) { |
198 |
+ (void)th; |
199 |
+} |
200 |
#endif // KMP_USE_MONITOR |
201 |
|
202 |
void __kmp_reap_worker(kmp_info_t *th) { |