Skip to content

Commit

Permalink
Add MSYS2 target
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Finxx authored and michaelforney committed Mar 24, 2024
1 parent 2e5ef23 commit 3bd0a5f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 3bd0a5f

Please sign in to comment.