View | Details | Raw Unified | Return to bug 273959 | Differences between
and this patch

Collapse All | Expand All

(-)b/devel/llvm10/files/openmp/patch-backport-version-fixes (+202 lines)
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) {
(-)b/devel/llvm10/files/patch-backport-version-fixes (+138 lines)
Added Link Here
1
diff --git tools/lto/CMakeLists.txt tools/lto/CMakeLists.txt
2
index b86e4abd01a7..d814df767b65 100644
3
--- tools/lto/CMakeLists.txt
4
+++ tools/lto/CMakeLists.txt
5
@@ -18,7 +18,11 @@ set(SOURCES
6
   lto.cpp
7
   )
8
 
9
-set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports)
10
+if (LLVM_LINK_LLVM_DYLIB)
11
+  set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.dylib.exports)
12
+else()
13
+  set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports)
14
+endif()
15
 
16
 add_llvm_library(LTO SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES} DEPENDS intrinsics_gen)
17
 
18
diff --git tools/lto/lto.dylib.exports tools/lto/lto.dylib.exports
19
new file mode 100644
20
index 000000000000..4a1fff8f93ca
21
--- /dev/null
22
+++ tools/lto/lto.dylib.exports
23
@@ -0,0 +1,74 @@
24
+lto_get_error_message
25
+lto_get_version
26
+lto_initialize_disassembler
27
+lto_module_create
28
+lto_module_create_from_fd
29
+lto_module_create_from_fd_at_offset
30
+lto_module_create_from_memory
31
+lto_module_create_from_memory_with_path
32
+lto_module_create_in_local_context
33
+lto_module_create_in_codegen_context
34
+lto_module_get_linkeropts
35
+lto_module_get_num_symbols
36
+lto_module_get_symbol_attribute
37
+lto_module_get_symbol_name
38
+lto_module_get_target_triple
39
+lto_module_set_target_triple
40
+lto_module_is_object_file
41
+lto_module_is_object_file_for_target
42
+lto_module_is_object_file_in_memory
43
+lto_module_is_object_file_in_memory_for_target
44
+lto_module_has_objc_category
45
+lto_module_dispose
46
+lto_api_version
47
+lto_codegen_set_diagnostic_handler
48
+lto_codegen_add_module
49
+lto_codegen_set_module
50
+lto_codegen_add_must_preserve_symbol
51
+lto_codegen_compile
52
+lto_codegen_create
53
+lto_codegen_create_in_local_context
54
+lto_codegen_dispose
55
+lto_codegen_set_debug_model
56
+lto_codegen_set_pic_model
57
+lto_codegen_write_merged_modules
58
+lto_codegen_debug_options
59
+lto_codegen_debug_options_array
60
+lto_codegen_set_assembler_args
61
+lto_codegen_set_assembler_path
62
+lto_codegen_set_cpu
63
+lto_codegen_compile_to_file
64
+lto_codegen_optimize
65
+lto_codegen_compile_optimized
66
+lto_codegen_set_should_internalize
67
+lto_codegen_set_should_embed_uselists
68
+thinlto_create_codegen
69
+thinlto_codegen_dispose
70
+thinlto_codegen_add_module
71
+thinlto_codegen_process
72
+thinlto_module_get_num_objects
73
+thinlto_module_get_object
74
+thinlto_codegen_set_pic_model
75
+thinlto_codegen_set_cache_dir
76
+thinlto_codegen_set_cache_pruning_interval
77
+thinlto_codegen_set_cache_entry_expiration
78
+thinlto_codegen_set_final_cache_size_relative_to_available_space
79
+thinlto_codegen_set_cache_size_bytes
80
+thinlto_codegen_set_cache_size_megabytes
81
+thinlto_codegen_set_cache_size_files
82
+thinlto_codegen_set_savetemps_dir
83
+thinlto_codegen_set_cpu
84
+thinlto_debug_options
85
+lto_module_is_thinlto
86
+thinlto_codegen_add_must_preserve_symbol
87
+thinlto_codegen_add_cross_referenced_symbol
88
+thinlto_codegen_set_codegen_only
89
+thinlto_codegen_disable_codegen
90
+thinlto_module_get_num_object_files
91
+thinlto_module_get_object_file
92
+thinlto_set_generated_objects_dir
93
+lto_input_create
94
+lto_input_dispose
95
+lto_input_get_num_dependent_libraries
96
+lto_input_get_dependent_library
97
+lto_runtime_lib_symbols_list
98
diff --git tools/lto/lto.exports tools/lto/lto.exports
99
index fd2212cb5f33..4a1fff8f93ca 100644
100
--- tools/lto/lto.exports
101
+++ tools/lto/lto.exports
102
@@ -42,12 +42,6 @@ lto_codegen_optimize
103
 lto_codegen_compile_optimized
104
 lto_codegen_set_should_internalize
105
 lto_codegen_set_should_embed_uselists
106
-LLVMCreateDisasm
107
-LLVMCreateDisasmCPU
108
-LLVMDisasmDispose
109
-LLVMDisasmInstruction
110
-LLVMSetDisasmOptions
111
-LLVMCreateDisasmCPUFeatures
112
 thinlto_create_codegen
113
 thinlto_codegen_dispose
114
 thinlto_codegen_add_module
115
diff --git tools/remarks-shlib/CMakeLists.txt tools/remarks-shlib/CMakeLists.txt
116
index e948496c603a..4c66ad487070 100644
117
--- tools/remarks-shlib/CMakeLists.txt
118
+++ tools/remarks-shlib/CMakeLists.txt
119
@@ -6,7 +6,11 @@ set(SOURCES
120
   libremarks.cpp
121
   )
122
 
123
-set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports)
124
+if (LLVM_LINK_LLVM_DYLIB)
125
+  set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.dylib.exports)
126
+else()
127
+  set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports)
128
+endif()
129
 
130
 add_llvm_library(Remarks SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES})
131
 
132
diff --git tools/remarks-shlib/Remarks.dylib.exports tools/remarks-shlib/Remarks.dylib.exports
133
new file mode 100644
134
index 000000000000..0c2a3c38c78c
135
--- /dev/null
136
+++ tools/remarks-shlib/Remarks.dylib.exports
137
@@ -0,0 +1 @@
138
+LLVMRemarkVersion

Return to bug 273959