Skip to content

Commit 27d2693

Browse files
vtjnashKristofferC
authored andcommitted
ccall: avoid some bad symbol mangling
Other bad cases are probably less common, but still exist. The code to fix those is included in #25984. Fixes #34680 (cherry picked from commit 66ecd90)
1 parent 6b89ea6 commit 27d2693

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ccall.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// This file is a part of Julia. License is MIT: https://julialang.org/license
22

33
// --- the ccall, cglobal, and llvm intrinsics ---
4+
#include "llvm/Support/Path.h" // for llvm::sys::path
45

56
// Map from symbol name (in a certain library) to its GV in sysimg and the
67
// DL handle address in the current session.
@@ -68,7 +69,8 @@ static bool runtime_sym_gvs(const char *f_lib, const char *f_name, MT &&M,
6869
}
6970
else {
7071
std::string name = "ccalllib_";
71-
name += f_lib;
72+
name += llvm::sys::path::filename(f_lib);
73+
name += std::to_string(globalUnique++);
7274
runtime_lib = true;
7375
auto &libgv = libMapGV[f_lib];
7476
if (libgv.first == NULL) {

0 commit comments

Comments
 (0)