|
Hi,
|
|
|
|
config.guess cannot identify HarmonyOS / OpenHarmony. On such a device `uname -s` reports "HarmonyOS" rather than "Linux", so the script falls through to "unable to guess system type" and exits non-zero. This breaks autoconf-based configuration on that OS (e.g. LLVM's `GetHostTriple.cmake` invokes config.guess and aborts the build when it fails).
|
|
|
|
Observed on a HarmonyOS 7 device (aarch64):
|
|
|
|
$ uname -m
|
|
aarch64
|
|
$ uname -s
|
|
HarmonyOS
|
|
$ sh config.guess
|
|
config.guess[1620]: can't create /storage/Users/currentUser/cgrNSCfM/dummy.c: Permission denied
|
|
config.guess[1749]: can't create /storage/Users/currentUser/cgrNSCfM/dummy.c: Permission denied
|
|
config.guess: unable to guess system type
|
|
...
|
|
config.guess timestamp = 2026-05-17
|
|
|
|
uname -m = aarch64
|
|
uname -r = HongMeng Kernel 1.13.0
|
|
uname -s = HarmonyOS
|
|
uname -v = #1 SMP Sat Aug 15 11:19:26 UTC 2026
|
|
|
|
/usr/bin/uname -p = unknown
|
|
/bin/uname -X =
|
|
|
|
hostinfo =
|
|
/bin/universe =
|
|
/usr/bin/arch -k =
|
|
/bin/arch =
|
|
/usr/bin/oslevel =
|
|
/usr/convex/getsysinfo =
|
|
|
|
UNAME_MACHINE = "aarch64"
|
|
UNAME_RELEASE = "HongMeng Kernel 1.13.0"
|
|
UNAME_SYSTEM = "HarmonyOS"
|
|
UNAME_VERSION = "#1 SMP Sat Aug 15 11:19:26 UTC 2026"
|
|
|
|
(Note: the "cannot create dummy.c" part is a secondary issue described at the end of this message; even with a writable temp dir the OS name is still unrecognised.)
|
|
|
|
OpenHarmony is a Linux-kernel-based operating system. HarmonyOS is an OS that implements POSIX interfaces and achieves full Linux ABI&API compatibility (see details in OSDI'24 "Microkernel Goes General ..."). Both systems' userspace uses musl libc. A native compiler reports:
|
|
|
|
$ clang -dumpmachine
|
|
aarch64-unknown-linux-ohos
|
|
$ echo | clang -dM -E -x c - | grep -E '__linux__|__unix__|__OHOS__|__MUSL__'
|
|
#define linux 1
|
|
#define unix 1
|
|
#define OHOS 1
|
|
(musl is the C library)
|
|
|
|
So this is analogous to the Android support config.guess already has (it sets LIBC=android and emits `*-linux-android*` tuples). I'd like to propose the same treatment for HarmonyOS/OpenHarmony: emit `$UNAME_MACHINE-unknown-linux-ohos`.
|
|
|
|
Suggested patch (minimal; the arm/x86_64/riscv64 spellings could be handled the same way, but aarch64 is what I can test here):
|
|
|
|
--- a/config.guess
|
|
+++ b/config.guess
|
|
@@
|
|
# Note: order is significant - the case branches are not exclusive.
|
|
|
|
case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
|
|
+ :HarmonyOS::* | :OpenHarmony::*)
|
|
+ # HarmonyOS / OpenHarmony is a Linux-kernel-based OS using musl libc.
|
|
+ # The "ohos" environment suffix mirrors the existing Android tuples.
|
|
+ GUESS=$UNAME_MACHINE-unknown-linux-ohos
|
|
+ ;;
|
|
:NetBSD::*)
|
|
|
|
If `aarch64` (from `uname -m`) should be canonicalised differently for some arches, I'm happy to adjust; please let me know the preferred form.
|
|
|
|
One more, independent robustness issue: on HarmonyOS the sandbox makes `/tmp` read-only and also blocks writing to `$HOME`, so the `set_cc_for_build` probe fails with "cannot create a temporary directory ... Permission denied". That is not the root cause here (the OS name is the real problem), but it means config.guess cannot even reach its musl-detection probe on this system.
|
|
Not sure if that is worth a separate change, but I wanted to mention it.
|
|
|
|
Happy to test any follow-up patches on the aarch64 device.
|
|
|
|
Thanks,
|
|
Ke Gong
|
|
Institute of Software, Chinese Academy of Sciences
|