[PATCH] recongnize tachyum in config.sub

2024-05-21 Thread Patches for the config.guess and config.sub scripts
Hi,

the following patch adds support for tachyum arch in config.sub.

More info about tachyum CPU can be found here https://www.tachyum.com

Thanks,

Boris

---
 config.sub| 1 +
 testsuite/config-sub.data | 1 +
 2 files changed, 2 insertions(+)

diff --git a/config.sub b/config.sub
index 2c6a07a..484fac7 100755
--- a/config.sub
+++ b/config.sub
@@ -1247,6 +1247,7 @@ case $cpu-$vendor in
| sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
| spu \
+   | tachyum \
| tahoe \
| thumbv7* \
| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ 
diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data index 
a46bdfe..1938974 100644
--- a/testsuite/config-sub.data
+++ b/testsuite/config-sub.data
@@ -803,6 +803,7 @@ sv1 sv1-cray-unicos
 symmetry   i386-sequent-bsd
 t3ealphaev5-cray-unicos
 t90t90-cray-unicos
+tachyumtachyum-unknown-none
 tahoe  tahoe-unknown-none
 thumb  arm-unknown-none
 thumb-none-elf arm-none-elf
--
2.34.1




[PATCH] config.sub: Recognize OpenHarmony OS

2024-02-19 Thread Patches for the config.guess and config.sub scripts
From: Jonathan Schwender 

Adds support for [OpenHarmony] targets.
The `ohos` targets are available [in `LLVM`]

[OpenHarmony]: https://gitee.com/openharmony/docs/
[in `LLVM`]: 
https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/OHOS.cpp

Signed-off-by: Jonathan Schwender 
---
 config.sub| 4 ++--
 testsuite/config-sub.data | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/config.sub b/config.sub
index 2c6a07a..91422c1 100755
--- a/config.sub
+++ b/config.sub
@@ -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/testsuite/config-sub.data b/testsuite/config-sub.data
index a46bdfe..46201e8 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-mlibcaarch64-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
-- 
2.43.2




Re: [PATCH] config.sub: add Managarm support

2021-12-07 Thread Patches for the config.guess and config.sub scripts
Dear,

Around 3 weeks ago I submitted a patch regarding the addition of
Managarm to the config.sub file. Was this patch fine, or does it need
any changes?

-- 
Kind regards,

Dennis Bonke
Managarm package maintainer
https://managarm.org



[PATCH] config.sub: add Managarm support

2021-11-18 Thread Patches for the config.guess and config.sub scripts
---
Dear maintainers,

I would like to submit a few new targets to config.sub, namely Managarm.
Managarm is a FOSS microkernel with fully asynchronous I/O and runs
on or has ports in progress for x86_64, aarch64 and risc-v. It can be
found on https://github.com/managarm/managarm. This is my first time
submitting any kind of patch to a GNU project so if there is anything I
forgot in the patchset please let me know so I can fix it.

Kind regards,

Dennis Bonke
Managarm package maintainer
https://managarm.org

 config.sub| 11 +--
 testsuite/config-sub.data |  9 +
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/config.sub b/config.sub
index d74fb6d..66a2a40 100755
--- a/config.sub
+++ b/config.sub
@@ -145,7 +145,7 @@ case $1 in
nto-qnx* | linux-* | uclinux-uclibc* \
| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | 
netbsd*-gnu* \
| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
-   | storm-chaos* | os2-emx* | rtmk-nova*)
+   | storm-chaos* | os2-emx* | rtmk-nova* | managarm-*)
basic_machine=$field1
basic_os=$maybe_os
;;
@@ -1336,6 +1336,10 @@ EOF
kernel=linux
os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
;;
+   managarm*)
+   kernel=managarm
+   os=$(echo $basic_os | sed -e 's|managarm|mlibc|')
+   ;;
*)
kernel=
os=$basic_os
@@ -1748,7 +1752,8 @@ case $os in
 | skyos* | haiku* | rdos* | toppers* | drops* | es* \
 | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
 | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
-| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr*)
+| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr*\
+| kernel* | mlibc*)
;;
# This one is extra strict with allowed versions
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
@@ -1770,6 +1775,8 @@ case $kernel-$os in
;;
uclinux-uclibc* )
;;
+   managarm-kernel* | managarm-mlibc* )
+   ;;
-dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* )
# These are just libc implementations, not actual OSes, and thus
# require a kernel.
diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data
index d58521b..5c4b208 100644
--- a/testsuite/config-sub.data
+++ b/testsuite/config-sub.data
@@ -16,6 +16,9 @@ aarch64-bme   
aarch64-unknown-bme
 aarch64-elfaarch64-unknown-elf
 aarch64-genode aarch64-unknown-genode
 aarch64-linux  aarch64-unknown-linux-gnu
+aarch64-managarm   aarch64-unknown-managarm-mlibc
+aarch64-managarm-kernelaarch64-unknown-managarm-kernel
+aarch64-managarm-mlibc aarch64-unknown-managarm-mlibc
 aarch64-unknown-elfaarch64-unknown-elf
 aarch64-unknown-linux  aarch64-unknown-linux-gnu
 aarch64-wrs-vxworksaarch64-wrs-vxworks
@@ -615,6 +618,9 @@ riscv-company-elf   
riscv-company-elf
 riscv-company-hcos riscv-company-hcos
 riscv-elf  riscv-unknown-elf
 riscv-linuxriscv-unknown-linux-gnu
+riscv-managarm riscv-unknown-managarm-mlibc
+riscv-managarm-kernel  riscv-unknown-managarm-kernel
+riscv-managarm-mlibc   riscv-unknown-managarm-mlibc
 riscv-twizzler riscv-unknown-twizzler
 riscv-zephyr   riscv-unknown-zephyr
 riscv32riscv32-unknown-none
@@ -842,6 +848,9 @@ x86_64-fuchsia  
x86_64-pc-fuchsia
 x86_64-genode  x86_64-pc-genode
 x86_64-glidix  x86_64-pc-glidix
 x86_64-linux-relibcx86_64-pc-linux-relibc
+x86_64-managarmx86_64-pc-managarm-mlibc
+x86_64-managarm-kernel x86_64-pc-managarm-kernel
+x86_64-managarm-mlibc  x86_64-pc-managarm-mlibc
 x86_64-nto x86_64-pc-nto-qnx
 x86_64-os108   x86_64-pc-os108
 x86_64-pc-ptx  x86_64-pc-ptx
-- 
2.33.1




bug: shell variable quoting in config.guess

2021-01-19 Thread Patches for the config.guess and config.sub scripts
After commit 827c77253b396c07306927b2a4b794a3251c48eb in the GNU config
repository, word splitting is no longer performed on the $sysctl shell
variable in config.guess:

sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \
"/sbin/$sysctl" 2>/dev/null || \
"/usr/sbin/$sysctl" 2>/dev/null || \
echo unknown))

This would attempt to run an executable named "sysctl -n hw.machine_arch"
(instead of an executable named "sysctl").

It could be fixed by removing the quotes again, or by spelling out the full
command twice instead of using a shell variable at all. Two alternative
patches are attached.
diff --git a/config.guess b/config.guess
index f772702..aca04e8 100755
--- a/config.guess
+++ b/config.guess
@@ -190,8 +190,8 @@ case 
"$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
# portion of the name.  We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \
-   "/sbin/$sysctl" 2>/dev/null || \
-   "/usr/sbin/$sysctl" 2>/dev/null || \
+   /sbin/$sysctl 2>/dev/null || \
+   /usr/sbin/$sysctl 2>/dev/null || \
echo unknown))
case "$UNAME_MACHINE_ARCH" in
aarch64eb) machine=aarch64_be-unknown ;;
diff --git a/config.guess b/config.guess
index f772702..552d639 100755
--- a/config.guess
+++ b/config.guess
@@ -188,10 +188,9 @@ case 
"$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name.  We always set it to "unknown".
-   sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \
-   "/sbin/$sysctl" 2>/dev/null || \
-   "/usr/sbin/$sysctl" 2>/dev/null || \
+   /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
+   /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
echo unknown))
case "$UNAME_MACHINE_ARCH" in
aarch64eb) machine=aarch64_be-unknown ;;