| author | |
| committer | |
| log | 11903436a9818cba1ef474dfd705d10798d16ef6 |
| tree | 27163d005452c87d9e6b168bb4585e9c93709637 |
| parent | 9c3bea8482915277093a5cb68eba6e05f01d404a |
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>1 files changed, 3 insertions(+), 0 deletions(-)
src/codegen/llvm.zig+3| ... | ... | @@ -2719,6 +2719,9 @@ pub const DeclGen = struct { |
| 2719 | 2719 | if (comp.bin_file.options.llvm_cpu_features) |s| { |
| 2720 | 2720 | llvm_fn.addFunctionAttr("target-features", s); |
| 2721 | 2721 | } |
| 2722 | if (comp.getTarget().cpu.arch.isBpf()) { | |
| 2723 | llvm_fn.addFunctionAttr("no-builtins", ""); | |
| 2724 | } | |
| 2722 | 2725 | } |
| 2723 | 2726 | |
| 2724 | 2727 | fn resolveGlobalDecl(dg: *DeclGen, decl_index: Module.Decl.Index) Error!*llvm.Value { |