@@ -23,18 +23,19 @@ source_code(::AbstractCompilerTarget) = "text"
2323
2424llvm_triple (:: AbstractCompilerTarget ) = error (" Not implemented" )
2525
26- function llvm_machine (target:: AbstractCompilerTarget )
26+ function llvm_machine (target:: AbstractCompilerTarget , static )
2727 triple = llvm_triple (target)
2828
2929 t = Target (triple= triple)
3030
31- tm = TargetMachine (t, triple)
31+ reloc = static ? LLVM. API. LLVMRelocPIC : LLVM. API. LLVMRelocDefault
32+ tm = TargetMachine (t, triple, " " , " " , LLVM. API. LLVMCodeGenLevelDefault, reloc)
3233 asm_verbosity! (tm, true )
3334
3435 return tm
3536end
3637
37- llvm_datalayout (target:: AbstractCompilerTarget ) = DataLayout (llvm_machine (target))
38+ llvm_datalayout (target:: AbstractCompilerTarget ) = DataLayout (llvm_machine (target, false ))
3839
3940
4041# # params
@@ -57,12 +58,13 @@ struct FunctionSpec{F,TT}
5758 tt:: DataType
5859 kernel:: Bool
5960 name:: Union{Nothing,String}
61+ static:: Bool
6062end
6163
6264# put the function and argument types in typevars
6365# so that we can access it from generated functions
64- FunctionSpec (f, tt= Tuple{}, kernel= true , name= nothing ) =
65- FunctionSpec {typeof(f),tt} (f, tt, kernel, name)
66+ FunctionSpec (f, tt= Tuple{}, kernel= true , name= nothing , static = false ) =
67+ FunctionSpec {typeof(f),tt} (f, tt, kernel, name, static )
6668
6769function signature (spec:: FunctionSpec )
6870 fn = something (spec. name, nameof (spec. f))
0 commit comments