Bug 2392 - koji loongarch build error 需增加龙芯架构适配代码
Summary: koji loongarch build error 需增加龙芯架构适配代码
Status: NEW
Alias: None
Product: Anolis OS 8
Classification: Anolis OS
Component: BaseOS Packages (show other bugs) BaseOS Packages
Version: 8.6
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: geliwei-ali
QA Contact: shuming
URL: https://gitee.com/src-anolis-os/open-...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-14 15:28 UTC by lc
Modified: 2022-10-25 18:57 UTC (History)
1 user (show)

See Also:


Attachments
pageshift resovle (832 bytes, patch)
2022-10-14 15:52 UTC, lc
Details
resolve build error (1010 bytes, patch)
2022-10-14 15:54 UTC, lc
Details
support-for-loongarch (721 bytes, patch)
2022-10-14 15:56 UTC, lc
Details
resolve build error (943 bytes, patch)
2022-10-14 15:57 UTC, lc
Details
spec file (34.05 KB, text/x-rpm-spec)
2022-10-14 15:59 UTC, lc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lc uniontech_group 2022-10-14 15:28:28 UTC
Description of problem:
/builddir/build/BUILD/open-vm-tools-11.3.5-18557794/lib/include/x86cpuid_asm.h:81:4: error: output number 0 not directly addressable
    __asm__ __volatile__(

Version-Release number of selected component (if applicable):
11.3.5-1

How reproducible:
koji build dist-an8_7 --nowait --scratch --arch=loongarch64 /root/1009/rpm/SRPMS/open-vm-tools-11.3.5-1.uelc20.1.0.1.src.rpm

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
编译前在src-anolis-os/open-vm-tools a8 分支的基础上增加补丁,内容如下:
diff --git a/open-vm-tools-11.3.5-18557794/configure.ac b/open-vm-tools-11.3.5-18557794/configure.ac
index ab315b8..f95d122 100644
--- a/open-vm-tools-11.3.5-18557794/configure.ac
+++ b/open-vm-tools-11.3.5-18557794/configure.ac
@@ -81,6 +81,9 @@ case "$host_cpu" in
    [aarch64])
       arch="arm64"
       ;;
+   [loongarch64])
+      arch="loongarch64"
+      ;;
    [*])
       AC_MSG_ERROR([Unknown architecture.])
       ;;
diff --git a/open-vm-tools-11.3.5-18557794/lib/include/vm_basic_defs.h b/open-vm-tools-11.3.5-18557794/lib/include/vm_basic_defs.h
index ce3502a..16b0bd8 100644
--- a/open-vm-tools-11.3.5-18557794/lib/include/vm_basic_defs.h
+++ b/open-vm-tools-11.3.5-18557794/lib/include/vm_basic_defs.h
@@ -264,6 +264,8 @@ Max(int a, int b)
    #define PAGE_SHIFT    PAGE_SHIFT_4KB
 #elif defined __arm__
    #define PAGE_SHIFT    PAGE_SHIFT_4KB
+#elif defined __loongarch64
+   #define PAGE_SHIFT    PAGE_SHIFT_4KB
 #else
    #error
 #endif

diff --git a/open-vm-tools-11.3.5-18557794/lib/include/backdoor_types.h b/open-vm-tools-11.3.5-18557794/lib/include/backdoor_types.h
index 066979f..8a9cbd9 100644
--- a/open-vm-tools-11.3.5-18557794/lib/include/backdoor_types.h
+++ b/open-vm-tools-11.3.5-18557794/lib/include/backdoor_types.h
@@ -40,7 +40,7 @@
 #define _BACKDOOR_TYPES_H_


-#if !(defined __i386__ || defined __x86_64__  || defined __aarch64__ || defined _M_IX86  || defined _M_X64)
+#if !(defined __i386__ || defined __x86_64__  || defined __aarch64__ || defined _M_IX86  || defined _M_X64 || defined __loongarch64)
 #error The backdoor protocol is only supported on x86 and aarch64 architectures.
 #endif

diff --git a/open-vm-tools-11.3.5-18557794/lib/include/backdoor_types.h b/open-vm-tools-11.3.5-18557794/lib/include/backdoor_types.h
index 8a9cbd9..6bc89cd 100644
--- a/open-vm-tools-11.3.5-18557794/lib/include/backdoor_types.h
+++ b/open-vm-tools-11.3.5-18557794/lib/include/backdoor_types.h
@@ -76,7 +76,7 @@ typedef enum {
    } words; \
    uint64 quad

-#if defined (VM_X86_64)  ||  defined (VM_ARM_64)
+#if defined (VM_X86_64)  ||  defined (VM_ARM_64) || defined (__loongarch64)
 #define DECLARE_REG_STRUCT DECLARE_REG64_STRUCT
 #else
 #define DECLARE_REG_STRUCT DECLARE_REG32_STRUCT
Comment 1 lc uniontech_group 2022-10-14 15:52:45 UTC
Created attachment 406 [details]
pageshift resovle
Comment 2 lc uniontech_group 2022-10-14 15:54:22 UTC
Created attachment 407 [details]
resolve build error
Comment 3 lc uniontech_group 2022-10-14 15:56:26 UTC
Created attachment 408 [details]
support-for-loongarch
Comment 4 lc uniontech_group 2022-10-14 15:57:55 UTC
Created attachment 409 [details]
resolve build error
Comment 5 lc uniontech_group 2022-10-14 15:59:06 UTC
Created attachment 410 [details]
spec file