Skip to content

Commit

Permalink
oh really?
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Oct 11, 2016
1 parent 1a9af7f commit 278bedb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/jitlayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,12 @@ static uint64_t resolve_compiler_rt(const char *name)
jl_printf(JL_STDERR, "WARNING: %s doesn't match %s\n", name, prefix);
return 0;
}
#if defined(_OS_DARWIN_)
// For whatever reason we need to drop the first character on Darwin.

This comment has been minimized.

Copy link
@Keno

Keno Oct 11, 2016

Member

Darwin name mangling adds an extra underscore to symbol names.

This comment has been minimized.

Copy link
@vtjnash

vtjnash Oct 11, 2016

Member

not just Darwin, lots of platforms do that

This comment has been minimized.

Copy link
@vchuravy

vchuravy Oct 11, 2016

Author Member

The name we are looking searching for is ___extendhfsf2 and the symbol (with nm) in the dylib is ___extendhfsf2, but
dwarfdump libcompiler-rt.dylib | grep extendhfsf2 is AT_name( "__extendhfsf2" ).

Is this an OK work around or should we unmangle the name somehow?

I think 2b7481d caused the change in behaviour after I rebased on it.

This comment has been minimized.

uint64_t sym = (uintptr_t)jl_dlsym_e(compiler_rt_hdl, name+1);
#else
uint64_t sym = (uintptr_t)jl_dlsym_e(compiler_rt_hdl, name);
#endif
#if defined(_OS_DARWIN_) || defined(_OS_LINUX_)
if (!sym) {
jl_printf(JL_STDERR, "WARNING: Didn't find symbol in CRT. dlerror %s", dlerror());
Expand Down

0 comments on commit 278bedb

Please sign in to comment.