commit 1f8f494a8504aa99052554476d86bcd0d6a7a1ba
parent d853268357f02d13ca7377e2391b8ebb6290daad
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 4 Jun 2025 16:31:49 +0200
driver/posix: Adjust qbe command line based in the target
Qbe supports multiple ABIs and they are selected using the
command line flag -t.
Diffstat:
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/src/cmd/scc-cc/posix/cc.c b/src/cmd/scc-cc/posix/cc.c
@@ -242,6 +242,18 @@ settool(int tool, char *infile, int nexttool)
break;
case QBE:
strcpy(t->cmd, "qbe");
+
+ if (!strcmp(arch, "amd64") && !strcmp(abi, "sysv"))
+ fmt = "amd64_sysv";
+ else if (!strcmp(arch, "arm64") && !strcmp(abi, "sysv"))
+ fmt = "arm64";
+ else if (!strcmp(arch, "riscv64") && !strcmp(abi, "sysv"))
+ fmt = "rv64";
+ else
+ die("not supported arch-abi (%s-%s) for qbe", arch, abi);
+
+ addarg(tool, "-t");
+ addarg(tool, fmt);
break;
case LD:
if (!outfile)