Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <86f46f83-feb0-f6b8-c5bf-9740d908632d@loongson.cn>
Date: Mon, 26 Feb 2024 16:04:26 +0800
From: Hongliang Wang <wanghongliang@...ngson.cn>
To: musl@...ts.openwall.com
Subject: LoongArch:add user_regs_struct and user_fp_struct.

Hi,

elfutils 0.190 references user_regs_struct and user_fp_struct, which
are defined in glibc, but not in musl. So there is a compile error when
compile ruby 3.3.0 in musl. I add these struct in musl loongarch, I also
adjust the ELF_NFPREG according the size of user_fp_struct, and 
elf_fpreg_t and elf_fpregset_t definition, which is consistent with glibc.

---
  arch/loongarch64/bits/user.h | 23 +++++++++++++++++++++--
  1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/arch/loongarch64/bits/user.h b/arch/loongarch64/bits/user.h
index 5a71d132..fd9b7b22 100644
--- a/arch/loongarch64/bits/user.h
+++ b/arch/loongarch64/bits/user.h
@@ -1,5 +1,24 @@
  #define ELF_NGREG    45
-#define ELF_NFPREG   33
+#define ELF_NFPREG   34
+
+struct user_regs_struct {
+	unsigned long regs[32];
+	unsigned long orig_a0;
+	unsigned long csr_era;
+	unsigned long csr_badv;
+	unsigned long reserved[10];
+};
+
+struct user_fp_struct {
+	unsigned long fpr[32];
+	unsigned long fcc;
+	unsigned int fcsr;
+};

  typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
-typedef double elf_fpreg_t, elf_fpregset_t[ELF_NFPREG];
+
+typedef union {
+	double d;
+	float f;
+} elf_fpreg_t;
+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
-- 
2.37.1


Regards,
Hongliang Wang

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.