Skip to content

Commit 93bcc15

Browse files
committed
Check mangling
1 parent 30b138d commit 93bcc15

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/StaticCompiler.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ function native_code_native(@nospecialize(f), @nospecialize(tt), name = GPUCompi
459459
GPUCompiler.code_native(stdout, job; kwargs...)
460460
end
461461

462-
#Return an LLVM module for multiple functions
462+
#Return an LLVM module for multiple functions
463463
function native_llvm_module(funcs::Array; mangle_names = false, kwargs...)
464464
f,tt = funcs[1]
465465
mod = native_llvm_module(f,tt, kwargs...)
@@ -473,7 +473,9 @@ function native_llvm_module(funcs::Array; mangle_names = false, kwargs...)
473473
if mangle_names
474474
for func in functions(mod)
475475
fname = name(func)
476-
name!(func,fname[7:end])
476+
if fname[1:6] == "julia_"
477+
name!(func,fname[7:end])
478+
end
477479
end
478480
end
479481
return mod
@@ -498,7 +500,7 @@ function generate_obj(funcs::Array, path::String = tempname(), filenamebase::Str
498500
end
499501

500502
function generate_shlib(funcs::Array, path::String = tempname(), filename::String="libfoo"; mangle_names=false, kwargs...)
501-
503+
502504
lib_path = joinpath(path, "$filename.$(Libdl.dlext)")
503505

504506
_,obj_path = generate_obj(funcs, path, filename; mangle_names=mangle_names, kwargs...)

0 commit comments

Comments
 (0)