Skip to content

Commit

Permalink
sanitizers: fix support loading of libjulia-codegen
Browse files Browse the repository at this point in the history
If libjulia-internal is exporting LLVM symbols, we need to ensure they
do not conflict with loading libjulia-codegen.
  • Loading branch information
vtjnash authored and vchuravy committed Jan 6, 2022
1 parent c6bbb50 commit d145e78
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cli/loader_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ __attribute__((constructor)) void jl_load_libjulia_internal(void) {

// Unpack our special library names. This is why ordering of library names matters.
libjulia_internal = load_library(special_library_names[0], lib_dir, 1);

void (*pZN4llvm2cl22ResetCommandLineParserEv)(void) = (void (*)(void))lookup_symbol(libjulia_internal, "_ZN4llvm2cl22ResetCommandLineParserEv");
if (pZN4llvm2cl22ResetCommandLineParserEv)
pZN4llvm2cl22ResetCommandLineParserEv();

void *libjulia_codegen = load_library(special_library_names[1], lib_dir, 0);
const char * const * codegen_func_names;
if (libjulia_codegen == NULL) {
Expand Down

0 comments on commit d145e78

Please sign in to comment.