From 5d8be4275fe9066e3322386213120e1d93af6020 Mon Sep 17 00:00:00 2001 From: Jonathan Schwender Date: Sat, 24 Feb 2024 18:00:13 +0100 Subject: [PATCH] config.sub: Recognize OpenHarmony OS Add support for [OpenHarmony] targets. The `ohos` targets are available [in `LLVM`] and documented in the [Rust target documentation]. Known targets in Rust: - aarch64-unknown-linux-ohos - armv7-unknown-linux-ohos - x86_64-unknown-linux-ohos Known targets in Clang: - arm-linux-ohos - aarch64-linux-ohos - x86_64-linux-ohos There are also some additional targets available in clang, e.g. `liteos-ohos`, but I don't know much about those targets, so I'm leaving `liteos-ohos` out of scope for this patch. [OpenHarmony]: https://gitee.com/openharmony/docs/ [in `LLVM`]: https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/OHOS.cpp [Rust target documentation]: https://doc.rust-lang.org/rustc/platform-support/openharmony.html * config.sub ($os == ohos*): Recognize. * doc/config.sub.1: Regenerate. * testsuite/config-sub.data (aarch64-linux-ohos): New entry. Signed-off-by: Jonathan Schwender Signed-off-by: Dmitry V. Levin --- config.sub | 6 +++--- doc/config.sub.1 | 2 +- testsuite/config-sub.data | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/config.sub b/config.sub index d0add17..02e7a59 100755 --- a/config.sub +++ b/config.sub @@ -4,7 +4,7 @@ # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2024-01-26' +timestamp='2024-02-24' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -1768,7 +1768,7 @@ case $os in | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ - | fiwix* | mlibc* | cos* | mbr* | ironclad* ) + | fiwix* | mlibc* | cos* | mbr* | ironclad* | ohos* ) ;; # This one is extra strict with allowed versions sco3.2v2 | sco3.2v[4-9]* | sco5v6*) @@ -1829,7 +1829,7 @@ esac case $kernel-$os-$obj in linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \ | linux-mlibc*- | linux-musl*- | linux-newlib*- \ - | linux-relibc*- | linux-uclibc*- ) + | linux-relibc*- | linux-uclibc*- | linux-ohos*- ) ;; uclinux-uclibc*- ) ;; diff --git a/doc/config.sub.1 b/doc/config.sub.1 index 37722ee..b2750b1 100644 --- a/doc/config.sub.1 +++ b/doc/config.sub.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5. -.TH CONFIG.SUB "1" "January 2024" "GNU config.sub (2024-01-26)" "User Commands" +.TH CONFIG.SUB "1" "February 2024" "GNU config.sub (2024-02-24)" "User Commands" .SH NAME config.sub \- validate and canonicalize a configuration triplet .SH SYNOPSIS diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data index cae2347..af8ed08 100644 --- a/testsuite/config-sub.data +++ b/testsuite/config-sub.data @@ -17,6 +17,7 @@ aarch64-elf aarch64-unknown-elf aarch64-genode aarch64-unknown-genode aarch64-linux aarch64-unknown-linux-gnu aarch64-linux-mlibc aarch64-unknown-linux-mlibc +aarch64-linux-ohos aarch64-unknown-linux-ohos aarch64-managarm aarch64-unknown-managarm-mlibc aarch64-managarm-kernel aarch64-unknown-managarm-kernel aarch64-managarm-mlibc aarch64-unknown-managarm-mlibc