From 265931cb81a49d44088f140d9a2b2b18925dbca2 Mon Sep 17 00:00:00 2001 From: Julian Samaroo Date: Wed, 28 Jul 2021 08:20:34 -0500 Subject: [PATCH] Updates for Julia 1.6 (#9) * Updates for Julia 1.6 * Bump to 0.1.1 and add compat entries * Fix quert typo --- Manifest.toml | 43 +++++++------------------------------------ Project.toml | 6 +++++- src/UProbes.jl | 14 ++++++++------ 3 files changed, 20 insertions(+), 43 deletions(-) diff --git a/Manifest.toml b/Manifest.toml index 728fef7..d9a5843 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -1,51 +1,22 @@ # This file is machine-generated - editing it directly is not advised -[[Base64]] -uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" - -[[Distributed]] -deps = ["Random", "Serialization", "Sockets"] -uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" - -[[InteractiveUtils]] -deps = ["Markdown"] -uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" +[[CEnum]] +git-tree-sha1 = "215a9aa4a1f23fbd05b92769fdd62559488d70e9" +uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82" +version = "0.4.1" [[LLVM]] -deps = ["Printf", "Unicode"] -git-tree-sha1 = "f988262deeeb3350f2dbf0b3aff6758c13a2fbd8" -repo-rev = "vc/types" -repo-url = "LLVM" +deps = ["CEnum", "Libdl", "Printf", "Unicode"] +git-tree-sha1 = "b499c68a45249b0385585c62f4a9b62b5db8e691" uuid = "929cbde3-209d-540e-8aea-75f648917ca0" -version = "1.1.0+" +version = "3.7.1" [[Libdl]] uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" -[[Logging]] -uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" - -[[Markdown]] -deps = ["Base64"] -uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" - [[Printf]] deps = ["Unicode"] uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" -[[Random]] -deps = ["Serialization"] -uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" - -[[Serialization]] -uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" - -[[Sockets]] -uuid = "6462fe0b-24de-5631-8697-dd941f90decc" - -[[Test]] -deps = ["Distributed", "InteractiveUtils", "Logging", "Random"] -uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - [[Unicode]] uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" diff --git a/Project.toml b/Project.toml index c49a078..ff31494 100644 --- a/Project.toml +++ b/Project.toml @@ -1,12 +1,16 @@ name = "UProbes" uuid = "fdc92b62-57bd-11e9-1326-e584eb179d13" authors = ["Valentin Churavy "] -version = "0.1.0" +version = "0.1.1" [deps] LLVM = "929cbde3-209d-540e-8aea-75f648917ca0" Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" +[compat] +LLVM = "3.7" +julia = "1.6" + [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/src/UProbes.jl b/src/UProbes.jl index 299a55b..0f74b34 100644 --- a/src/UProbes.jl +++ b/src/UProbes.jl @@ -26,7 +26,7 @@ if Sys.iswindows() macro probe(args...) :() end -macro quert(args...) +macro query(args...) :(false) end @@ -122,7 +122,7 @@ _.stapsdt.base: .space 1 .endif """ - ctx = LLVM.Interop.JuliaContext() + LLVM.Interop.JuliaContext() do ctx mod = LLVM.Module("uprobe_$(provider)_$(name)", ctx) # Create semaphore variable @@ -139,15 +139,15 @@ _.stapsdt.base: .space 1 initializer!(gdb_unhappy, ConstantInt(int16_t, 0)) # create function that will do a call to nop assembly - rettyp = convert(LLVMType, Nothing) - argtyp = LLVMType[convert.(LLVMType, args)...] + rettyp = convert(LLVMType, Nothing, ctx) + argtyp = LLVMType[convert.(Ref(LLVMType), args, Ref(ctx))...] ft = LLVM.FunctionType(rettyp, argtyp) f = LLVM.Function(mod, string("__uprobe_", provider, "_", name), ft) linkage!(f, LLVM.API.LLVMExternalLinkage) inline_asm = InlineAsm(ft, asm, constr, true) - + # generate IR Builder(ctx) do builder entry = BasicBlock(f, "entry", ctx) @@ -158,13 +158,15 @@ _.stapsdt.base: .space 1 end triple = LLVM.triple() - target = LLVM.Target(triple) + target = LLVM.Target(; triple=triple) objfile = tempname() TargetMachine(target, triple, "", "", LLVM.API.LLVMCodeGenLevelDefault, LLVM.API.LLVMRelocPIC) do tm LLVM.emit(tm, mod, LLVM.API.LLVMObjectFile, objfile) end run(`ld -shared $objfile -o $file`) + end # JuliaContext + return Libdl.dlopen(file, Libdl.RTLD_LOCAL) end