Skip to content

Commit 5bc15b0

Browse files
committed
Disable PLT on ARM, PPC and PPC64 for vararg functions.
Workaround LLVM bug. Fix #17312
1 parent 36d36b0 commit 5bc15b0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/ccall.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1694,7 +1694,14 @@ static jl_cgval_t emit_ccall(jl_value_t **args, size_t nargs, jl_codectx_t *ctx)
16941694

16951695
PointerType *funcptype = PointerType::get(functype,0);
16961696
if (imaging_mode) {
1697-
llvmf = emit_plt(functype, attrs, cc, f_lib, f_name);
1697+
#if defined(_CPU_ARM_) || defined(_CPU_PPC_) || defined(_CPU_PPC64_)
1698+
// ARM, PPC, PPC64 (as of LLVM 3.9) doesn't support `musttail`
1699+
// for vararg functions.
1700+
if (functype)
1701+
llvmf = runtime_sym_lookup(funcptype, f_lib, f_name, ctx->f);
1702+
else
1703+
#endif
1704+
llvmf = emit_plt(functype, attrs, cc, f_lib, f_name);
16981705
}
16991706
else {
17001707
void *symaddr = jl_dlsym_e(jl_get_library(f_lib), f_name);

0 commit comments

Comments
 (0)