On Mon, 24 Jan 2022 08:04:07 +0000 Mark Cave-Ayland mark.cave-ayland@ilande.co.uk wrote:
On 20/01/2022 21:12, Glenn Washburn wrote:
Hi list,
I've gotten the qemu-ppc target to build correctly, however, I'm having issues with the qemu-ppc64 target. I'm using the 10.1.0 GCC ppc64 compiler distributed at kernel.org[1].
I'm doing the following: $ PATH=/home/user/cross/gcc-10.1.0-nolibc/powerpc64-linux/bin:$PATH $ ./config/scripts/switch-arch qemu-ppc64 $ make V=1
The make is fine until the forthstrap command, which has this output: ./forthstrap -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/lib/ -I/home/user/openbios.git/forth/device/ -I/home/user/openbios.git/forth/debugging/ -I/home/user/openbios.git/forth/admin/ -I/home/user/openbios.git/forth/util/ -I/home/user/openbios.git/forth/packages/ -I/home/user/openbios.git/forth/system/ -I/home/user/openbios.git/libopenbios/ -I/home/user/openbios.git/packages/ -I/home/user/openbios.git/drivers/ -I/home/user/openbios.git/arch/ppc/ -I/home/user/openbios.git -I./forth -D bootstrap.dict -M bootstrap.dict.d -c bootstrap.dict-console.log forth/bootstrap/start.fs panic: segmentation violation at 0xa6dbc62c dict=0x7fa7a6dbc010 here=0x7fa7a6dbc638(dict+0x628) pc=0x0(dict+0x59243ff0) dstackcnt=0 rstackcnt=0 instruction=deadbeef dstack: 0x0 rstack: 0x0 Writing dictionary core file
Is anyone else seeing this? Can someone with forth experience help here?
Glenn
[1] https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/10.1.0/...
I haven't tried building with a powerpc64 compiler for a while as the output binary for ppc is always 32-bit. IIRC there is some runtime patching around rfi/rfid and management of the MSR_SF flag to allow things to work under both qemu-system-ppc and qemu-system-ppc64.
Can you get a backtrace from the above? You'll need to clear out any existing obj-* directories and tweak HOSTCFLAGS and CFLAGS in Makefile.target to specify -O0 -g before re-running switch-arch.
Here's backtrace output ia GDB.
Starting program: /home/user/openbios.git/obj-ppc64/forthstrap -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/lib/ -I/home/user/openbios.git/forth/device/ -I/home/user/openbios.git/forth/debugging/ -I/home/user/openbios.git/forth/admin/ -I/home/user/openbios.git/forth/util/ -I/home/user/openbios.git/forth/packages/ -I/home/user/openbios.git/forth/system/ -I/home/user/openbios.git/libopenbios/ -I/home/user/openbios.git/packages/ -I/home/user/openbios.git/drivers/ -I/home/user/openbios.git/arch/ppc/ -I/home/user/openbios.git -I./forth -D bootstrap.dict -M bootstrap.dict.d -c bootstrap.dict-console.log forth/bootstrap/start.fs
Program received signal SIGSEGV, Segmentation fault. 0x00005555555575e9 in findword (s1=0x55555555f112 "(semis)") at /home/user/openbios.git/kernel/dict.c:118 118 tmplfa = read_ucell(cell2pointer(tmplfa)); (gdb) bt #0 0x00005555555575e9 in findword (s1=0x55555555f112 "(semis)") at /home/user/openbios.git/kernel/dict.c:118 #1 0x0000555555559781 in interpret_source ( fil=0x7fffffffe33a "forth/bootstrap/start.fs") at /home/user/openbios.git/kernel/bootstrap.c:591 #2 0x000055555555a9f0 in new_dictionary ( source=0x7fffffffe33a "forth/bootstrap/start.fs") at /home/user/openbios.git/kernel/bootstrap.c:1059 #3 0x000055555555ae66 in main (argc=23, argv=0x7fffffffddb8) at /home/user/openbios.git/kernel/bootstrap.c:1286
Glenn