commit 8f35c60b39dad1ecb1609f6105f1e41a52df87ae (tree)
parent 193a92630170582c8c7b28432c8a65a80e6ef0b3
Author: Andrew Kelley <andrew@ziglang.org>
Date: Fri, 14 May 2021 12:24:47 -0700
stage2: clarify logic of passing `-integrated-as` to clang
make it clear that the logic is only there to lower the amount of
noise on the clang command line.
Diffstat:
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/Compilation.zig b/src/Compilation.zig
@@ -2695,9 +2695,7 @@ pub fn addCCArgs(
try argv.appendSlice(&[_][]const u8{ "-MD", "-MV", "-MF", p });
}
- if (target.cpu.arch.isSPARC()) {
- // Clang defaults to using the system assembler over the internal one
- // when targeting a non-BSD OS.
+ if (target_util.clangMightShellOutForAssembly(target)) {
try argv.append("-integrated-as");
}
diff --git a/src/target.zig b/src/target.zig
@@ -395,3 +395,9 @@ pub fn libcFullLinkFlags(target: std.Target) []const []const u8 {
},
};
}
+
+pub fn clangMightShellOutForAssembly(target: std.Target) bool {
+ // Clang defaults to using the system assembler over the internal one
+ // when targeting a non-BSD OS.
+ return target.cpu.arch.isSPARC();
+}