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 <jonathan.schwender@huawei.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
This commit is contained in:
Jonathan Schwender
2024-02-24 18:00:13 +01:00
committed by Dmitry V. Levin
parent b7333c432d
commit 5d8be4275f
3 changed files with 5 additions and 4 deletions

6
config.sub vendored
View File

@ -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*- )
;;