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

Collapse All | Expand All

(-)b/devel/llvm11/Makefile (+1 lines)
Lines 146-151 LLDB_IMPLIES= CLANG Link Here
146
LLDB_PORTDOCS=		lldb
146
LLDB_PORTDOCS=		lldb
147
LLDB_VARS=		_USES_PYTHON=python
147
LLDB_VARS=		_USES_PYTHON=python
148
OPENMP_DESC=		Install libomp, the LLVM OpenMP runtime library
148
OPENMP_DESC=		Install libomp, the LLVM OpenMP runtime library
149
OPENMP_EXTRA_PATCHES=	${PATCHDIR}/openmp
149
OPENMP_DISTFILES=	openmp-${DISTVERSION}.src${EXTRACT_SUFX}
150
OPENMP_DISTFILES=	openmp-${DISTVERSION}.src${EXTRACT_SUFX}
150
PYCLANG_DESC=		Install python bindings to libclang
151
PYCLANG_DESC=		Install python bindings to libclang
151
PYCLANG_IMPLIES=	CLANG
152
PYCLANG_IMPLIES=	CLANG
(-)b/devel/llvm11/files/openmp/patch-backport-version-fixes (+210 lines)
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) {
(-)b/devel/llvm11/files/patch-backport-version-fixes (+139 lines)
Added Link Here
1
diff --git tools/lto/CMakeLists.txt tools/lto/CMakeLists.txt
2
index 2963f97cad88..ae1ae6f48886 100644
3
--- tools/lto/CMakeLists.txt
4
+++ tools/lto/CMakeLists.txt
5
@@ -19,7 +19,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
17
     intrinsics_gen)
18
diff --git tools/lto/lto.dylib.exports tools/lto/lto.dylib.exports
19
new file mode 100644
20
index 000000000000..2871abd34e40
21
--- /dev/null
22
+++ tools/lto/lto.dylib.exports
23
@@ -0,0 +1,75 @@
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_macho_cputype
36
+lto_module_get_num_symbols
37
+lto_module_get_symbol_attribute
38
+lto_module_get_symbol_name
39
+lto_module_get_target_triple
40
+lto_module_set_target_triple
41
+lto_module_is_object_file
42
+lto_module_is_object_file_for_target
43
+lto_module_is_object_file_in_memory
44
+lto_module_is_object_file_in_memory_for_target
45
+lto_module_has_objc_category
46
+lto_module_dispose
47
+lto_api_version
48
+lto_codegen_set_diagnostic_handler
49
+lto_codegen_add_module
50
+lto_codegen_set_module
51
+lto_codegen_add_must_preserve_symbol
52
+lto_codegen_compile
53
+lto_codegen_create
54
+lto_codegen_create_in_local_context
55
+lto_codegen_dispose
56
+lto_codegen_set_debug_model
57
+lto_codegen_set_pic_model
58
+lto_codegen_write_merged_modules
59
+lto_codegen_debug_options
60
+lto_codegen_debug_options_array
61
+lto_codegen_set_assembler_args
62
+lto_codegen_set_assembler_path
63
+lto_codegen_set_cpu
64
+lto_codegen_compile_to_file
65
+lto_codegen_optimize
66
+lto_codegen_compile_optimized
67
+lto_codegen_set_should_internalize
68
+lto_codegen_set_should_embed_uselists
69
+thinlto_create_codegen
70
+thinlto_codegen_dispose
71
+thinlto_codegen_add_module
72
+thinlto_codegen_process
73
+thinlto_module_get_num_objects
74
+thinlto_module_get_object
75
+thinlto_codegen_set_pic_model
76
+thinlto_codegen_set_cache_dir
77
+thinlto_codegen_set_cache_pruning_interval
78
+thinlto_codegen_set_cache_entry_expiration
79
+thinlto_codegen_set_final_cache_size_relative_to_available_space
80
+thinlto_codegen_set_cache_size_bytes
81
+thinlto_codegen_set_cache_size_megabytes
82
+thinlto_codegen_set_cache_size_files
83
+thinlto_codegen_set_savetemps_dir
84
+thinlto_codegen_set_cpu
85
+thinlto_debug_options
86
+lto_module_is_thinlto
87
+thinlto_codegen_add_must_preserve_symbol
88
+thinlto_codegen_add_cross_referenced_symbol
89
+thinlto_codegen_set_codegen_only
90
+thinlto_codegen_disable_codegen
91
+thinlto_module_get_num_object_files
92
+thinlto_module_get_object_file
93
+thinlto_set_generated_objects_dir
94
+lto_input_create
95
+lto_input_dispose
96
+lto_input_get_num_dependent_libraries
97
+lto_input_get_dependent_library
98
+lto_runtime_lib_symbols_list
99
diff --git tools/lto/lto.exports tools/lto/lto.exports
100
index 1f0a6b23d3fd..2871abd34e40 100644
101
--- tools/lto/lto.exports
102
+++ tools/lto/lto.exports
103
@@ -43,12 +43,6 @@ lto_codegen_optimize
104
 lto_codegen_compile_optimized
105
 lto_codegen_set_should_internalize
106
 lto_codegen_set_should_embed_uselists
107
-LLVMCreateDisasm
108
-LLVMCreateDisasmCPU
109
-LLVMDisasmDispose
110
-LLVMDisasmInstruction
111
-LLVMSetDisasmOptions
112
-LLVMCreateDisasmCPUFeatures
113
 thinlto_create_codegen
114
 thinlto_codegen_dispose
115
 thinlto_codegen_add_module
116
diff --git tools/remarks-shlib/CMakeLists.txt tools/remarks-shlib/CMakeLists.txt
117
index e948496c603a..4c66ad487070 100644
118
--- tools/remarks-shlib/CMakeLists.txt
119
+++ tools/remarks-shlib/CMakeLists.txt
120
@@ -6,7 +6,11 @@ set(SOURCES
121
   libremarks.cpp
122
   )
123
 
124
-set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports)
125
+if (LLVM_LINK_LLVM_DYLIB)
126
+  set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.dylib.exports)
127
+else()
128
+  set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports)
129
+endif()
130
 
131
 add_llvm_library(Remarks SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES})
132
 
133
diff --git tools/remarks-shlib/Remarks.dylib.exports tools/remarks-shlib/Remarks.dylib.exports
134
new file mode 100644
135
index 000000000000..0c2a3c38c78c
136
--- /dev/null
137
+++ tools/remarks-shlib/Remarks.dylib.exports
138
@@ -0,0 +1 @@
139
+LLVMRemarkVersion

Return to bug 273959