From 32f1b90c979e91850ba534eadb08409368deb103 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 4 Feb 2026 17:49:09 +0800 Subject: [PATCH] :art: Compatible with HarmonyOS 6.1 https://github.com/siyuan-note/siyuan/issues/16974 Signed-off-by: Daniel <845765@qq.com> --- .github/CONTRIBUTING.md | 23 ++++++++++++++++++++++- .github/CONTRIBUTING_zh_CN.md | 23 ++++++++++++++++++++++- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index b39663433..c997b5185 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -62,8 +62,29 @@ Note: In the development environment, the kernel process will not be automatical ### Harmony -Only support compilation under Linux, need to install Harmony SDK, and need to modify Go source code, please refer to https://github.com/siyuan-note/siyuan/issues/13184 +Only support compilation under Linux, need to install Harmony SDK, and need to modify Go source code. * `cd kernel/harmony` * `./build.sh` (`./build-win.sh` for Windows Emulator) * https://github.com/siyuan-note/siyuan-harmony + +Modify Go source code: + +1. go/src/runtime/vim tls_arm64.s + + Change the ending `DATA runtime·tls_g+0(SB)/8, $16` to `DATA runtime·tls_g+0(SB)/8, $-144` + +2. go/src/runtime/cgo/gcc_android.c + + Clear the inittls function + + ```c + inittls(void **tlsg, void **tlsbase) + { + return; + } + ``` +3. go/src/net/cgo_resold.go + `C.size_t(len(b))` to `C.socklen_t(len(b))` + +For other details, please refer to https://github.com/siyuan-note/siyuan/issues/13184 diff --git a/.github/CONTRIBUTING_zh_CN.md b/.github/CONTRIBUTING_zh_CN.md index 33b905db5..0aa01951b 100644 --- a/.github/CONTRIBUTING_zh_CN.md +++ b/.github/CONTRIBUTING_zh_CN.md @@ -62,8 +62,29 @@ NPM 镜像: ### Harmony -仅支持在 Linux 下编译,需要安装鸿蒙 SDK,并且需要修改 Go 源码,详情请参考 https://github.com/siyuan-note/siyuan/issues/13184 +仅支持在 Linux 下编译,需要安装鸿蒙 SDK,并且需要修改 Go 源码。 * `cd kernel/harmony` * `./build.sh` (Windows 模拟器使用 `./build-win.sh`) * https://github.com/siyuan-note/siyuan-harmony + +修改 Go 源码: + +1. go/src/runtime/tls_arm64.s + + 结尾 `DATA runtime·tls_g+0(SB)/8, $16` 改为 `DATA runtime·tls_g+0(SB)/8, $-144` + +2. go/src/runtime/cgo/gcc_android.c + + 清空 inittls 函数 + + ```c + inittls(void **tlsg, void **tlsbase) + { + return; + } + ``` +3. go/src/net/cgo_resold.go + `C.size_t(len(b))` 改为 `C.socklen_t(len(b))` + +其他细节请参考 https://github.com/siyuan-note/siyuan/issues/13184