mirror of
https://github.com/ziglang/zig.git
synced 2024-11-26 15:12:31 +00:00
llvm/bpf: disable llvm builtins for bpf target
As bpf program has no global section for constant values (especially strings), so use llvm's builtins (like memcpy, memset, etc) will lead to compilation failure (something like this: A call to built-in function 'memcpy' is not supported.) Signed-off-by: Tw <tw19881113@gmail.com>
This commit is contained in:
parent
9c3bea8482
commit
11903436a9
@ -2719,6 +2719,9 @@ pub const DeclGen = struct {
|
||||
if (comp.bin_file.options.llvm_cpu_features) |s| {
|
||||
llvm_fn.addFunctionAttr("target-features", s);
|
||||
}
|
||||
if (comp.getTarget().cpu.arch.isBpf()) {
|
||||
llvm_fn.addFunctionAttr("no-builtins", "");
|
||||
}
|
||||
}
|
||||
|
||||
fn resolveGlobalDecl(dg: *DeclGen, decl_index: Module.Decl.Index) Error!*llvm.Value {
|
||||
|
Loading…
Reference in New Issue
Block a user