Skip to content

Commit

Permalink
Fixup macos issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gbaraldi committed Nov 29, 2023
1 parent 8c46be1 commit 0e0f872
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/StaticCompiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ using LLD_jll: lld
using StaticTools
using StaticTools: @symbolcall, @c_str, println
using Core: MethodTable
using Base:BinaryPlatforms.Platform, BinaryPlatforms.HostPlatform, BinaryPlatforms.arch, BinaryPlatforms.os, BinaryPlatforms.libc_str
using Base:BinaryPlatforms.Platform, BinaryPlatforms.HostPlatform, BinaryPlatforms.arch, BinaryPlatforms.os_str, BinaryPlatforms.libc_str

export load_function, compile_shlib, compile_executable
export static_code_llvm, static_code_typed, static_llvm_module, static_code_native
Expand Down Expand Up @@ -399,7 +399,7 @@ function static_code_native(@nospecialize(f), @nospecialize(tt), fname=fix_name(
end

# Return an LLVM module
function static_llvm_module(f, tt, name=fix_name(f); demangle, target::StaticTarget=StaticTarget(), kwargs...)
function static_llvm_module(f, tt, name=fix_name(f); demangle=true, target::StaticTarget=StaticTarget(), kwargs...)
if !demangle
name = "julia_"*name
end
Expand Down
2 changes: 1 addition & 1 deletion src/target.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct StaticTarget
tm::LLVM.TargetMachine
end

clean_triple(platform::Platform) = arch(platform) * "-" * os(platform) * libc_str(platform)
clean_triple(platform::Platform) = arch(platform) * os_str(platform) * libc_str(platform)
StaticTarget() = StaticTarget(HostPlatform(), unsafe_string(LLVM.API.LLVMGetHostCPUName()), unsafe_string(LLVM.API.LLVMGetHostCPUFeatures()))
StaticTarget(platform::Platform) = StaticTarget(platform, LLVM.TargetMachine(LLVM.Target(triple = clean_triple(platform)), clean_triple(platform)))
StaticTarget(platform::Platform, cpu::String) = StaticTarget(platform, LLVM.TargetMachine(LLVM.Target(triple = clean_triple(platform)), clean_triple(platform), cpu))
Expand Down
2 changes: 1 addition & 1 deletion test/scripts/interop.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ function interop(argc, argv)
end

# Attempt to compile
path = compile_executable(interop, (Int64, Ptr{Ptr{UInt8}}), "./", c_flags=`-ldl -lm`)
path = compile_executable(interop, (Int64, Ptr{Ptr{UInt8}}), "./",cflags=`-ldl -lm`)

0 comments on commit 0e0f872

Please sign in to comment.