[PATCH] gdb: LoongArch: Fix build errors under cross compile

Youling Tang tangyouling@loongson.cn
Tue Jun 7 13:02:59 GMT 2022


When compiling loongarch64 target on x86_64 machine it shows build error
like below:
$ ./confingure --target=loongarch64-linux-gnu
$ make
In file included from ../../gdb/loongarch-linux-tdep.c:23:
../../gdb/gregset.h:27:23: error: ‘gregset_t’ does not name a type; did you mean ‘prgregset_t’?
   27 | #define GDB_GREGSET_T gregset_t
      |                       ^~~~~~~~~
../../gdb/gregset.h:34:9: note: in expansion of macro ‘GDB_GREGSET_T’
   34 | typedef GDB_GREGSET_T gdb_gregset_t;
      |         ^~~~~~~~~~~~~
../../gdb/gregset.h:31:24: error: ‘fpregset_t’ does not name a type; did you mean ‘prfpregset_t’?
   31 | #define GDB_FPREGSET_T fpregset_t
      |                        ^~~~~~~~~~
...

So remove the include of gregset.h file in loongarch-linux-tdep.c.

Signed-off-by: Youling Tang <tangyouling@loongson.cn>
---
 gdb/loongarch-linux-tdep.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gdb/loongarch-linux-tdep.c b/gdb/loongarch-linux-tdep.c
index f6854298569..372643761b1 100644
--- a/gdb/loongarch-linux-tdep.c
+++ b/gdb/loongarch-linux-tdep.c
@@ -20,7 +20,6 @@
 
 #include "defs.h"
 #include "glibc-tdep.h"
-#include "gregset.h"
 #include "inferior.h"
 #include "linux-tdep.h"
 #include "loongarch-tdep.h"
-- 
2.35.2



More information about the Gdb-patches mailing list