Skip to content

Commit

Permalink
ccall: avoid some bad symbol mangling
Browse files Browse the repository at this point in the history
Other bad cases are probably less common, but still exist. The code to fix those is included in #25984.

Fixes #34680
  • Loading branch information
vtjnash authored and KristofferC committed Apr 11, 2020
1 parent dc77e8a commit 3df21fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ccall.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is a part of Julia. License is MIT: https://julialang.org/license

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

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

0 comments on commit 3df21fb

Please sign in to comment.