| ... | @@ -2943,29 +2943,25 @@ pub fn addCCArgs( | ... | @@ -2943,29 +2943,25 @@ pub fn addCCArgs( |
| 2943 | try argv.append("-fPIC"); | 2943 | try argv.append("-fPIC"); |
| 2944 | } | 2944 | } |
| 2945 | }, | 2945 | }, |
| 2946 | .shared_library, .ll, .bc, .unknown, .static_library, .object, .zig => {}, | 2946 | .shared_library, .assembly, .ll, .bc, .unknown, .static_library, .object, .zig => {}, |
| 2947 | .assembly => { | | |
| 2948 | // Argh, why doesn't the assembler accept the list of CPU features?! | | |
| 2949 | // I don't see a way to do this other than hard coding everything. | | |
| 2950 | switch (target.cpu.arch) { | | |
| 2951 | .riscv32, .riscv64 => { | | |
| 2952 | if (std.Target.riscv.featureSetHas(target.cpu.features, .relax)) { | | |
| 2953 | try argv.append("-mrelax"); | | |
| 2954 | } else { | | |
| 2955 | try argv.append("-mno-relax"); | | |
| 2956 | } | | |
| 2957 | }, | | |
| 2958 | else => { | | |
| 2959 | // TODO | | |
| 2960 | }, | | |
| 2961 | } | | |
| 2962 | if (target.cpu.model.llvm_name) |ln| | | |
| 2963 | try argv.append(try std.fmt.allocPrint(arena, "-mcpu={s}", .{ln})); | | |
| 2964 | }, | | |
| 2965 | } | 2947 | } |
| 2966 | if (out_dep_path) |p| { | 2948 | if (out_dep_path) |p| { |
| 2967 | try argv.appendSlice(&[_][]const u8{ "-MD", "-MV", "-MF", p }); | 2949 | try argv.appendSlice(&[_][]const u8{ "-MD", "-MV", "-MF", p }); |
| 2968 | } | 2950 | } |
| | 2951 | // Argh, why doesn't the assembler accept the list of CPU features?! |
| | 2952 | // I don't see a way to do this other than hard coding everything. |
| | 2953 | switch (target.cpu.arch) { |
| | 2954 | .riscv32, .riscv64 => { |
| | 2955 | if (std.Target.riscv.featureSetHas(target.cpu.features, .relax)) { |
| | 2956 | try argv.append("-mrelax"); |
| | 2957 | } else { |
| | 2958 | try argv.append("-mno-relax"); |
| | 2959 | } |
| | 2960 | }, |
| | 2961 | else => { |
| | 2962 | // TODO |
| | 2963 | }, |
| | 2964 | } |
| 2969 | | 2965 | |
| 2970 | if (target_util.clangMightShellOutForAssembly(target)) { | 2966 | if (target_util.clangMightShellOutForAssembly(target)) { |
| 2971 | try argv.append("-integrated-as"); | 2967 | try argv.append("-integrated-as"); |