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