On 2022/09/30 15:04, Ionut Hristodorescu wrote: > Hi, > > I am trying to compile the OpenBSD SPARC64 kernel with LLVM. Here’s what I > did :
And now you see why sparc64 hasn't moved across to clang yet :-) > > 1. first, compile with gcc, save the commands log, replace “cc” with “clang”, > change some parameters to match clang’s (for example, gcc has “-mno-fpu”, > clang has “-msoft-float”, etc) > 2. compile with clang > 3. link with the “ld” linker in the end - "ld -n -T ld.script --warn-common > -nopie -o bsd *.o” > 4. make install -> the resulting kernel is copied in /bsd > 5. reboot in qemu : > > qemu-system-sparc64 -m 4g -drive file=disk.qcow2,if=ide,bus=0,unit=0 > -nographic > OpenBIOS for Sparc64 > Configuration device id QEMU version 1 machine id 0 > kernel cmdline > CPUs: 1 x SUNW,UltraSPARC-IIi > UUID: 00000000-0000-0000-0000-000000000000 > Welcome to OpenBIOS v1.1 built on Jun 21 2022 21:07 > Type 'help' for detailed information > Trying disk:a... > Not a bootable ELF image > Not a bootable a.out image > > Loading FCode image... > Loaded 6888 bytes > entry point is 0x4000 > Evaluating FCode... > OpenBSD IEEE 1275 Bootblock 2.1 > ..>> OpenBSD BOOT 1.22 > Trying bsd... > Booting /pci@1fe,0/pci@1,1/ide@3/ide@0/disk@0:a/bsd > 11635744@0x1000000+5088@0x1b18c20+144268@0x1c00000+4050036@0x1c2338c > symbols @ 0xfee48580 239+637704+436800 start=0x1480000 > [ using 1076152 bytes of bsd ELF symbol table ] > Unimplemented service set-symbol-lookup ([2] -- [0]) > Unhandled Exception 0x0000000000000030 > PC = 0x0000000001493780 NPC = 0x0000000001493784 > Stopping execution > > Any ideas ?