Closed fmartinsons closed 10 months ago
Hello, I finally found what was the error and it was indeed a configuration error. By looking at configure part of gdb inside crash, I saw:
checking build system type... x86_64-pc-linux-gnu
checking host system type... aarch64-tapos-linux-gnu
checking target system type... aarch64-tapos-linux-gnu
The host system was wrong and should be the crosstool for my sdk.
It was a mistake and I was not using GDB_TARGET
GDB_HOST
and --target
correctly during make
call.
Sorry for the noise. Closing the issue.
Hi, Martinsons. I met the same inssur when I built gdb-server for my arm device. My compile commands are:
./configure --build=x86_64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu
make all-gdbserver
As the commands showing, I try to build arm program on my PC and aarch64-linux-gnu is cross-tool. What do you mean 'The host system was wrong' ? Should I change --host and target?
You don't have the same configuration as I had, my use case was to build an SDK, so my build toolchain (the toolchain install on my host) is different that the host one (which is the SDK build chain, in my case, another x86 flavor) and different to the target one (arm64 in my case) My initial issue was that the host was equal to the target which doesn't fit.
It seems you want a normal cross compilation (not cross canadian) so host=target, I don't know why you experienced this error, maybe your toolchain is misconfigured ?
Thank you so much for your reply. In your case, you do a cross Canadian compilation, so --host should be x86_64-pc-linux-gnu(which is another system) not arm64, is it right?
According to my understanding of this issue, if build system is equal to host system, everything is ok,. But if build system(x86) ≠ host system(arm64), build system does not have those .h files(which define _aarch64_ctx).
Yes, like you said, in my case, the correct configuration for building crash in a x86 sdk to analyze aarm64 bin is (tapos is my distribution code name):
checking build system type... x86_64-tapossdk-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... aarch64-tapos-linux-gnu
I'm sorry I cannot help you more like that, you may want to try to look at the compile/configure log and the different toolchain configuration.
For info, for a cross compile crash (not canadian), I have these in the log of compilation:
checking build system type... x86_64-pc-linux-gnu
checking host system type... aarch64-tapos-linux-gnu
checking target system type... aarch64-tapos-linux-gnu
Thank you again. I think I find the key of this issue. The structure _aarch64_ctx is defined at 'path/to/gcc/aarch64-none-linux-gnu/libc/usr/include/asm/sigcontext.h'.
Gdb build script do not include this path and my cross compiler default search path(use 'echo 'main(){}' | aarch64-none-linux-gnu-gcc -E -v -' to see the path) is: ` ...
path/to/gcc/bin/../lib/gcc/aarch64-none-linux-gnu/10.3.1/include path/to/gcc/bin/../lib/gcc/aarch64-none-linux-gnu/10.3.1/include-fixed path/to/gcc/bin/../lib/gcc/aarch64-none-linux-gnu/10.3.1/../../../../aarch64-none-linux-gnu/include path/to/gcc/bin/../aarch64-none-linux-gnu/libc/usr/include ... `
Before building the gdb-server, I run this command to add the path and this error does not occur again.
export CPLUS_INCLUDE_PATH=path/to/gcc/aarch64-none-linux-gnu/libc/usr/include/asm
Glad you manage to sort this out, but It seems a little strange for you to have to do that. path/to/gcc/aarch64-none-linux-gnu/libc/usr/include/asm
should be part of the arm toolchain config, you should not have to explicitely set it.
Again, I'm suggest you to look for you different toolchain configuration and env variables, maybe the compiler option --sysroot
is at the wrong place.
Anyway, in the end, if it does work for you, fine (I'm no expert in gdb/crash cross compilation, by the way, just giving my feelings here).
Have a nice day
Hello , I try to build the latest crash tag 8.0.4 in a cross compiled environnement in order to analyze vmcore for an arm64 target.
I used yocto (kirkstone) framework for building an os for my arm target and I use cross canadian flavor to embed crash on an sdk (x86 host). The gcc version used is 11.4
Finally I have strange compilation error that I didn't manage to understand:
I'm pretty sure that there is a misconfiguration on my side but I try to look where the "struct _aarch64_ctx" is defined and found that it is defined in linux header there but I don't see any include of this in the crash/gdb code so I'm puzzled.
Can somebody help me to know where to look for ? Thanks