Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-11-19 23:20:56 +0300
committerGitHub <noreply@github.com>2021-11-19 23:20:56 +0300
commite750cb3ee50e958afa85d6642ba118c25844b262 (patch)
tree0ef29996b3b21a31844e7cde4064c60290dc04a8
parentb32801a63cff0561d2a327c71986ce05254c4d8b (diff)
[aot] Prepend the assembly name to the names of gsharedvt wrappers to avoid duplicate symbol errors during static linking. (#21309)mono-6.12.0.161
Fixes https://github.com/mono/mono/issues/20417. Co-authored-by: Zoltan Varga <vargaz@gmail.com>
-rw-r--r--mono/mini/aot-compiler.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/mono/mini/aot-compiler.c b/mono/mini/aot-compiler.c
index b2dcabf154a..1ce73a79f9d 100644
--- a/mono/mini/aot-compiler.c
+++ b/mono/mini/aot-compiler.c
@@ -9073,8 +9073,18 @@ mono_aot_get_method_name (MonoCompile *cfg)
/* Use the mangled name if possible */
if (method->wrapper_type == MONO_WRAPPER_OTHER) {
WrapperInfo *info = mono_marshal_get_wrapper_info (method);
- if (info->subtype == WRAPPER_SUBTYPE_GSHAREDVT_IN_SIG || info->subtype == WRAPPER_SUBTYPE_GSHAREDVT_OUT_SIG)
- return mono_aot_get_mangled_method_name (method);
+ if (info->subtype == WRAPPER_SUBTYPE_GSHAREDVT_IN_SIG || info->subtype == WRAPPER_SUBTYPE_GSHAREDVT_OUT_SIG) {
+ char *name, *s;
+ name = mono_aot_get_mangled_method_name (method);
+ if (llvm_acfg->aot_opts.static_link) {
+ /* Include the assembly name too to avoid duplicate symbol errors */
+ s = g_strdup_printf ("%s_%s", llvm_acfg->assembly_name_sym, name);
+ g_free (name);
+ return s;
+ } else {
+ return name;
+ }
+ }
}
if (llvm_acfg->aot_opts.static_link)