| ... | ... | @@ -3242,19 +3242,22 @@ pub const Object = struct { |
| 3242 | 3242 | if (owner_mod.unwind_tables) { |
| 3243 | 3243 | try attributes.addFnAttr(.{ .uwtable = Builder.Attribute.UwTable.default }, &o.builder); |
| 3244 | 3244 | } |
| 3245 | | if (comp.skip_linker_dependencies or comp.no_builtin) { |
| 3245 | const target = owner_mod.resolved_target.result; |
| 3246 | if (comp.skip_linker_dependencies or comp.no_builtin or target.cpu.arch.isBpf()) { |
| 3246 | 3247 | // The intent here is for compiler-rt and libc functions to not generate |
| 3247 | 3248 | // infinite recursion. For example, if we are compiling the memcpy function, |
| 3248 | 3249 | // and llvm detects that the body is equivalent to memcpy, it may replace the |
| 3249 | 3250 | // body of memcpy with a call to memcpy, which would then cause a stack |
| 3250 | 3251 | // overflow instead of performing memcpy. |
| 3251 | | try attributes.addFnAttr(.nobuiltin, &o.builder); |
| 3252 | try attributes.addFnAttr(.{ .string = .{ |
| 3253 | .kind = try o.builder.string("no-builtins"), |
| 3254 | .value = .empty, |
| 3255 | } }, &o.builder); |
| 3252 | 3256 | } |
| 3253 | 3257 | if (owner_mod.optimize_mode == .ReleaseSmall) { |
| 3254 | 3258 | try attributes.addFnAttr(.minsize, &o.builder); |
| 3255 | 3259 | try attributes.addFnAttr(.optsize, &o.builder); |
| 3256 | 3260 | } |
| 3257 | | const target = owner_mod.resolved_target.result; |
| 3258 | 3261 | if (target.cpu.model.llvm_name) |s| { |
| 3259 | 3262 | try attributes.addFnAttr(.{ .string = .{ |
| 3260 | 3263 | .kind = try o.builder.string("target-cpu"), |
| ... | ... | @@ -3267,12 +3270,6 @@ pub const Object = struct { |
| 3267 | 3270 | .value = try o.builder.string(std.mem.span(s)), |
| 3268 | 3271 | } }, &o.builder); |
| 3269 | 3272 | } |
| 3270 | | if (target.cpu.arch.isBpf()) { |
| 3271 | | try attributes.addFnAttr(.{ .string = .{ |
| 3272 | | .kind = try o.builder.string("no-builtins"), |
| 3273 | | .value = .empty, |
| 3274 | | } }, &o.builder); |
| 3275 | | } |
| 3276 | 3273 | if (target.floatAbi() == .soft) { |
| 3277 | 3274 | // `use-soft-float` means "use software routines for floating point computations". In |
| 3278 | 3275 | // other words, it configures how LLVM lowers basic float instructions like `fcmp`, |