| ... | @@ -2045,9 +2045,7 @@ fn linkWithLLD(self: *Elf, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: s | ... | @@ -2045,9 +2045,7 @@ fn linkWithLLD(self: *Elf, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: s |
| 2045 | // copy when generating relocatables. Normally, we would expect `lld -r` to work. | 2045 | // copy when generating relocatables. Normally, we would expect `lld -r` to work. |
| 2046 | // However, because LLD wants to resolve BPF relocations which it shouldn't, it fails | 2046 | // However, because LLD wants to resolve BPF relocations which it shouldn't, it fails |
| 2047 | // before even generating the relocatable. | 2047 | // before even generating the relocatable. |
| 2048 | if (output_mode == .Obj and | 2048 | if (output_mode == .Obj and (comp.config.lto or target.cpu.arch.isBpf())) { |
| 2049 | (comp.config.lto or target.isBpfFreestanding())) | | |
| 2050 | { | | |
| 2051 | // In this case we must do a simple file copy | 2049 | // In this case we must do a simple file copy |
| 2052 | // here. TODO: think carefully about how we can avoid this redundant operation when doing | 2050 | // here. TODO: think carefully about how we can avoid this redundant operation when doing |
| 2053 | // build-obj. See also the corresponding TODO in linkAsArchive. | 2051 | // build-obj. See also the corresponding TODO in linkAsArchive. |