Skip to content

Commit

Permalink
Merge pull request #34754 from JuliaLang/jn/34680
Browse files Browse the repository at this point in the history
ccall: avoid some problematic symbol mangling
  • Loading branch information
KristofferC authored Feb 17, 2020
2 parents 2eba23f + 66ecd90 commit de24382
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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
2 changes: 1 addition & 1 deletion src/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ STATIC_INLINE unsigned ffs_u32(uint32_t bitvec)
_BitScanForward(&j, bitvec);
return j;
#else
return ffs(bitvec) - 1;
return __builtin_ffs(bitvec) - 1;
#endif
}
#endif
Expand Down

0 comments on commit de24382

Please sign in to comment.