diff options
| author | 2026-03-19 19:25:41 +0100 | |
|---|---|---|
| committer | 2026-03-19 19:25:41 +0100 | |
| commit | 49ba7f066faa6e73e8f09e2e7ed6a077f6ba0258 (patch) | |
| tree | e3937913113ef201e05a4d95336f03c5ce9b7844 /src/a_targ.c | |
| parent | 46fc55e27390ea85eb34ec0367f40426197c9b9f (diff) | |
preeliminary support for openBSD
Diffstat (limited to 'src/a_targ.c')
| -rw-r--r-- | src/a_targ.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/a_targ.c b/src/a_targ.c index f094f60..fab23e9 100644 --- a/src/a_targ.c +++ b/src/a_targ.c @@ -46,18 +46,23 @@ parsetriple(TargTriple *trg, const char *str) if (matchstr(&str, "unknown-") || matchstr(&str, "pc-")) {} - if (matchstr(&str, "linux-")) { - trg->os = OSlinux; - } else if (matchstr(&str, "linux$")) { + if (matchstr(&str, "linux$")) { trg->os = OSlinux; trg->abi = ABIgnu; + return 1; + } else if (matchstr(&str, "linux")) { + trg->os = OSlinux; + } else if (matchstr(&str, "openbsd")) { + trg->os = OSopenbsd; } else return 0; - if (matchstr(&str, "gnu")) { + if (trg->os == OSlinux && matchstr(&str, "-gnu")) { trg->abi = ABIgnu; - } else if (matchstr(&str, "musl")) { + } else if (trg->os == OSlinux && matchstr(&str, "-musl")) { trg->abi = ABImusl; - } else return 0; + } else if (matchstr(&str, "-")) { + return 0; + } return 1; } |