LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   cross compile gdbserver to mips give me an error (https://www.linuxquestions.org/questions/linux-software-2/cross-compile-gdbserver-to-mips-give-me-an-error-4175601126/)

Vido 03-05-2017 01:13 PM

cross compile gdbserver to mips give me an error
 
Hi, I'm trying to cross compile gdb for mips platform but Im getting an error, so after

Code:

:~/Downloads/gdb-7.12/gdb/gdbserver$ ./configure --host=mips-linux
I'm getting

Code:

SERVER -c -o linux-mips-low.o -MT linux-mips-low.o -MMD -MP -MF .deps/linux-mips-low.Tpo linux-mips-low.c
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:102: error: 'FPC_CSR' was not declared in this scope
linux-mips-low.c:102: error: 'FPC_EIR' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPR_BASE' was not declared in this scope
linux-mips-low.c:107: error: 'FPC_CSR' was not declared in this scope
linux-mips-low.c:107: error: 'FPC_EIR' was not declared in this scope
Makefile:263: recipe for target 'linux-mips-low.o' failed
make: *** [linux-mips-low.o] Error 1

How can I resolve this error ?

eager 03-14-2017 04:22 PM

Go up one directory and use grep -r to search for the missing define:

$ cd ..
$ grep -r FPR_BASE *
...
mips-linux-tdep.h:#define FPR_BASE 32

This header is not included in linux-mips-low.c. Search for this header file in your build directory. There may be an error including it in another header which is included.

Vido 03-14-2017 04:55 PM

Quote:

Originally Posted by eager (Post 5683466)
Go up one directory and use grep -r to search for the missing define:

$ cd ..
$ grep -r FPR_BASE *
...
mips-linux-tdep.h:#define FPR_BASE 32

This header is not included in linux-mips-low.c. Search for this header file in your build directory. There may be an error including it in another header which is included.

So I searched for it and sure enought there it is so what now ? should I add (but what?) in linux-mips-low.c ? Here is mine search
Code:

$ grep -r FPR_BASE *
alpha-linux-nat.c:    return FPR_BASE + regno - gdbarch_fp0_regnum (gdbarch);
ChangeLog-2002:        (MIPS64_ELF_NGREG, MIPS64_ELF_NFPREG, MIPS64_FPR_BASE, MIPS64_PC)
ChangeLog-2006:        (elf_fpregset_t, FPR_BASE, PC, CAUSE, BADVADDR, MMHI, MMLO)
ChangeLog-2006:        (MIPS64_FPR_BASE, MIPS64_PC, MIPS64_CAUSE, MIPS64_BADVADDR)
gdbserver/linux-mips-low.c:  FPR_BASE,      FPR_BASE + 1,  FPR_BASE + 2,  FPR_BASE + 3,                \
gdbserver/linux-mips-low.c:  FPR_BASE + 4,  FPR_BASE + 5,  FPR_BASE + 6,  FPR_BASE + 7,                \
gdbserver/linux-mips-low.c:  FPR_BASE + 8,  FPR_BASE + 9,  FPR_BASE + 10, FPR_BASE + 11,                \
gdbserver/linux-mips-low.c:  FPR_BASE + 12, FPR_BASE + 13, FPR_BASE + 14, FPR_BASE + 15,                \
gdbserver/linux-mips-low.c:  FPR_BASE + 16, FPR_BASE + 17, FPR_BASE + 18, FPR_BASE + 19,                \
gdbserver/linux-mips-low.c:  FPR_BASE + 20, FPR_BASE + 21, FPR_BASE + 22, FPR_BASE + 23,                \
gdbserver/linux-mips-low.c:  FPR_BASE + 24, FPR_BASE + 25, FPR_BASE + 26, FPR_BASE + 27,                \
gdbserver/linux-mips-low.c:  FPR_BASE + 28, FPR_BASE + 29, FPR_BASE + 30, FPR_BASE + 31,                \
mips-linux-nat.c:    regaddr = FPR_BASE + (regno - mips_regnum (gdbarch)->fp0);
mips-linux-nat.c:    regaddr = MIPS64_FPR_BASE + (regno - gdbarch_fp0_regnum (gdbarch));
mips-linux-tdep.h:#define FPR_BASE        32
mips-linux-tdep.h:#define MIPS64_FPR_BASE



All times are GMT -5. The time now is 03:34 AM.