From 0e0f8722ab468e41392aa188fa0fa5bebb81d409 Mon Sep 17 00:00:00 2001 From: Gabriel Baraldi Date: Wed, 29 Nov 2023 11:13:13 -0300 Subject: [PATCH] Fixup macos issues --- src/StaticCompiler.jl | 4 ++-- src/target.jl | 2 +- test/scripts/interop.jl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/StaticCompiler.jl b/src/StaticCompiler.jl index 6bca325..2d67382 100644 --- a/src/StaticCompiler.jl +++ b/src/StaticCompiler.jl @@ -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 @@ -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 diff --git a/src/target.jl b/src/target.jl index 2f14e2b..26d5c69 100644 --- a/src/target.jl +++ b/src/target.jl @@ -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)) diff --git a/test/scripts/interop.jl b/test/scripts/interop.jl index 24546ec..422f682 100644 --- a/test/scripts/interop.jl +++ b/test/scripts/interop.jl @@ -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`)