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 # 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 # 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 # 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* \ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ | 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 # This one is extra strict with allowed versions
sco3.2v2 | sco3.2v[4-9]* | sco5v6*) sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
@ -1829,7 +1829,7 @@ esac
case $kernel-$os-$obj in case $kernel-$os-$obj in
linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \ linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \
| linux-mlibc*- | linux-musl*- | linux-newlib*- \ | linux-mlibc*- | linux-musl*- | linux-newlib*- \
| linux-relibc*- | linux-uclibc*- ) | linux-relibc*- | linux-uclibc*- | linux-ohos*- )
;; ;;
uclinux-uclibc*- ) uclinux-uclibc*- )
;; ;;

View File

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.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 .SH NAME
config.sub \- validate and canonicalize a configuration triplet config.sub \- validate and canonicalize a configuration triplet
.SH SYNOPSIS .SH SYNOPSIS

View File

@ -17,6 +17,7 @@ aarch64-elf aarch64-unknown-elf
aarch64-genode aarch64-unknown-genode aarch64-genode aarch64-unknown-genode
aarch64-linux aarch64-unknown-linux-gnu aarch64-linux aarch64-unknown-linux-gnu
aarch64-linux-mlibc aarch64-unknown-linux-mlibc aarch64-linux-mlibc aarch64-unknown-linux-mlibc
aarch64-linux-ohos aarch64-unknown-linux-ohos
aarch64-managarm aarch64-unknown-managarm-mlibc aarch64-managarm aarch64-unknown-managarm-mlibc
aarch64-managarm-kernel aarch64-unknown-managarm-kernel aarch64-managarm-kernel aarch64-unknown-managarm-kernel
aarch64-managarm-mlibc aarch64-unknown-managarm-mlibc aarch64-managarm-mlibc aarch64-unknown-managarm-mlibc