~mcf/cproc

Add MSYS2 target v1 PROPOSED

Finxx: 1
 Add MSYS2 target

 2 files changed, 11 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~mcf/cproc/patches/50399/mbox | git am -3
Learn more about email & git

[PATCH] Add MSYS2 target Export this patch

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.
---
 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: