This patch enables the use of QBE's experimental winabi target. This
target is found on the winabi branch of QBE, at c9x.me/git/qbe.git.
Very interesting. Would it be possible to set up a GitHub action
for this? I don't have any windows machines to test this.
---
configure | 4 ++++
driver.c | 9 +++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index fe5688a..e7e5860 100755
--- a/configure
+++ b/configure
@@ -122,6 +122,10 @@ case "$target" in
endfiles='"-l", "c", "-l", ":crtn.o"'
defines='"-D", "__builtin_stdarg_start(ap, last)=__builtin_va_start(ap, last)"'
;;
+*-*msys*)
+ startfiles='"-l", ":crt0.o"'
+ endfiles='"-l", "c", "-l", "msys-2.0", "-l", "kernel32"'
+ ;;
*)
fail "unknown target '$target', please create config.h manually"
esac
diff --git a/driver.c b/driver.c
index 2ead711..46dec9a 100644
--- a/driver.c
+++ b/driver.c
@@ -384,8 +384,13 @@ main(int argc, char *argv[])
arrayaddbuf(&stages[LINK].cmd, linkcmd, sizeof(linkcmd));
if (hasprefix(target, "x86_64-") || hasprefix(target, "amd64-")) {
- arch = "x86_64-sysv";
- qbearch = "amd64_sysv";
+ if (strstr(target, "msys")) {
+ arch = "x86_64-sysv";
+ qbearch = "amd64_win";
+ } else {
+ arch = "x86_64-sysv";
+ qbearch = "amd64_sysv";
+ }
} else if (hasprefix(target, "aarch64-")) {
arch = "aarch64";
qbearch = "arm64";
--
2.34.1
Finxx <me@finxx.xyz> wrote: