Skip to content

Commit de24382

Browse files
authored
Merge pull request #34754 from JuliaLang/jn/34680
ccall: avoid some problematic symbol mangling
2 parents 2eba23f + 66ecd90 commit de24382

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
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) {

src/gc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ STATIC_INLINE unsigned ffs_u32(uint32_t bitvec)
372372
_BitScanForward(&j, bitvec);
373373
return j;
374374
#else
375-
return ffs(bitvec) - 1;
375+
return __builtin_ffs(bitvec) - 1;
376376
#endif
377377
}
378378
#endif

0 commit comments

Comments
 (0)