ppc@

here's a quick n dirty update about macppc and clang

after checking out the specs i agree with George's assertions about
the validity of the different code generated by clang
[Subject: Re: clang build kernel traps]
so i gave everything a try again with his patches. 


a) applied a base-clang patch from George Koehler
[Subject: [ports] [macppc] devel/llvm: add clang -msvr4-struct-return]

ls -la `which clang`
-r-xr-xr-x  3 root  bin  52656676 Feb  4 18:47 /usr/bin/clang*


b) modify bsd.own.mk && install

cvs diff: Diffing .
Index: bsd.own.mk
===================================================================
RCS file: /home/cvs/src/share/mk/bsd.own.mk,v
retrieving revision 1.200
diff -u -p -r1.200 bsd.own.mk
--- bsd.own.mk  6 Sep 2019 15:07:19 -0000       1.200
+++ bsd.own.mk  4 Feb 2020 10:33:06 -0000
@@ -16,7 +16,7 @@ SKEY?=                yes
 YP?=           yes

 CLANG_ARCH=aarch64 amd64 arm i386 mips64 mips64el powerpc sparc64
-GCC4_ARCH=alpha hppa mips64el powerpc sh sparc64
+GCC4_ARCH=alpha hppa mips64el sh sparc64
 GCC3_ARCH=m88k
 LLD_ARCH=aarch64 amd64 arm i386


c) build ofwboot
OpenBSD/macppc BOOT 1.7"x" for experimental
CC=clang CXX=clang++ CPP=clang-cpp make


d) build kernel
CC=clang CXX=clang++ CPP=clang-cpp make


e) create simple cd iso
get ofwboot, get kernel
modify the tbxi a bit to get bsd.gdb booting
only contains RAMDISK kernel no filesystem


f) fire up qemu

time qemu-system-ppc -M mac99,via=pmu-adb -cpu g4 \
-nodefaults -nographic -serial mon:stdio -net none \
-boot d -cdrom install66.iso $@ 2> stderr 1> stdout


s>> et_property: NULL phandle

>> =============================================================
>> OpenBIOS 1.1 [Jul 1 2019 17:09]
>> Configuration device id QEMU version 1 machine id 1
>> CPUs: 1
>> Memory: 128M
>> UUID: 00000000-0000-0000-0000-000000000000
>> CPU type PowerPC,G4
milliseconds isn't unique.
Welcome to OpenBIOS v1.1 built on Jul 1 2019 17:09
Trying cd:,\\:tbxi...
>> switching to new context:
>> OpenBSD/macppc BOOT 1.7x

|/-\|/-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-\|/-\|/-\|/-\|/-\|/-\|/-\|/-+185748\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-]=0x100114

string [/cdrom@0:/6.6/macppc/bsd.gdb] not found

Warning: boot device unrecognized: 
/pci@f2000000/mac-io@c/ata-3@21000/cdrom@0:/6.6/macppc/bsd.gdb

Copyright (c) 1982, 1986, 1989, 1991, 1993

        The Regents of the University of California.  All rights reserved.

Copyright (c) 1995-2020 OpenBSD. All rights reserved.  https://www.OpenBSD.org


OpenBSD 6.6-current (RAMDISK) #0: Tue Feb  4 21:27:20 JST 2020

    
r...@apbg4.my.domain:/home/rgc/work/clang-kern/src/sys/arch/macppc/compile/RAMDISK

real mem = 134217728 (128MB)

avail mem = 104710144 (99MB)

mainbus0 at root: model PowerMac3,1

cpu0 at mainbus0: 7400 (Revision 0x209): 900 MHz: L2 cache not enabled

mem at mainbus0 not configured

mpcpcibr0 at mainbus0 pci: uni-north

pci0 at mpcpcibr0 bus 0

macobio0 at pci0 dev 12 function 0 "Apple Keylargo" rev 0x00

macgpio0 at macobio0 offset 0x50

macgpio1 at macgpio0 offset 0x9: irq 47

"programmer-switch" at macgpio0 not configured

adb0 at macobio0 offset 0x16000: irq 25, via-pmu, 2 targets

akbd0 at adb0 addr 2: extended keyboard

wskbd0 at akbd0 mux 1

relative positioning device (3) at adb0 addr 3 not configured

zs0 at macobio0 offset 0x13000: irq 37,36

zstty0 at zs0 channel 0: console

zstty1 at zs0 channel 1

"escc-legacy" at macobio0 offset 0x12000 not configured

wdc0 at macobio0 offset 0x20000 irq 13: DMA

wdc1 at macobio0 offset 0x21000 irq 14: DMA

atapiscsi0 at wdc1 channel 0 drive 0

scsibus0 at atapiscsi0: 2 targets

cd0 at scsibus0 targ 0 lun 0: <QEMU, QEMU DVD-ROM, 2.5+> removable

cd0(wdc1:0:0): using BIOS timings, DMA mode 2

openpic0 at macobio0 offset 0x40000: version 0x0 feature 3f0002 LE

panic: trap type 300 srr1 9032 at 2b7890 (0+0x2b7890) lr 2dbb9c

halted


EXIT
0 > QEMU 4.1.0 monitor - type 'help' for more information
(qemu) 
(qemu) qququiquit
    9m47.11s real     2m31.11s user     0m06.94s system


running GENERIC on qemu is not really a good idea.
when a full backup finishes. i'll run a GENERIC kernel on my G4.


btw, noob here so if i missed anything kindly point it out to me.

yorosiku ~

Reply via email to