Skip to content

Commit

Permalink
Sanitize macro names in llvm to avoid implied symbol versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
ihnorton committed Jul 30, 2013
1 parent 8f13c16 commit 6c3dcda
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2565,6 +2565,10 @@ static Function *emit_function(jl_lambda_info_t *lam, bool cstyle)
}

std::string funcName = lam->name->name;
// sanitize macro names, otherwise julia_@name means versioned symbol
size_t atpos = funcName.find("@");
if (atpos != std::string::npos)
funcName.replace(atpos, 1, "#");
// try to avoid conflicts in the global symbol table
funcName = "julia_" + funcName;

Expand Down

0 comments on commit 6c3dcda

Please sign in to comment.