Re: [Tack-devel] Progress report: linuxppc, osxppc, osx386
Moved to https://github.com/davidgiven/ack
Brought to you by:
dtrg
|
From: George K. <ke...@gm...> - 2016-10-15 18:25:05
|
On Sun, Oct 9, 2016 at 6:24 PM, David Given <dg...@co...> wrote: > Do you have anything ready for a merge into trunk yet? We don't > necessarily have to have it building by default, but it'd be good to have. Not yet. I am in the middle of fixing some broken rules in powerpc ncg. > I remember that I got basic > integer operations more or less working, but trying to add floating > point support was simply not working. The rules for stl and sdl are missing the kills part, so they aren't killing the old value of the local, which usually survives in some register. Then code like sdl 0 ... ldl 0 loads the old value, not the newly stored value. This is one of the biggest remaining bugs. After I added a rule to rewrite sdl 0 ldl 0 as dup 8 sdl 0 (similar to an existing rule for stl 0 lol 0), then floating point worked more often. It's still broken if lol or ldl happen later, not immediately after stl or sdl. To write the kills part, I need to refactor the load rules to identify the tokens that need to die. The kills part is explained (but not well) in "5.9.3. The kills part" of http://tack.sourceforge.net/olddocs/ncg.pdf > It *ought* to be possible to build the ACK on OSX. I don't build anything on Intel OS X. I have Xcode 2.5 (including gcc) for PowerPC OS X. It would be difficult to run git and lua on such an old system (OS X 10.4.11), so I haven't tried to build the ACK there. > You didn't say whether you were using qemu-system or qemu-user --- I'm using qemu-system-ppc. No one has ported qemu-user to host OpenBSD. Also, with Debian 8.5 inside qemu, I can run Debian's gdb, so I don't need to compile a cross gdb. There are multiple problems with emulated devices. The hard disk doesn't work with guest NetBSD, but does work with Linux. The default keyboard is difficult to type with, and the default mouse panics Linux. So I always attach a USB keyboard and tablet with $ qemu-system-user -hda lip.img -usbdevice keyboard -usbdevice tablet When installing Debian, an error happens when installing the bootloader, but I tell the installer to ignore this error. > I can only assume that you're getting the EINTR as a quirk of OSX's > signal handling; and I *think* the right thing to do is to retry. I confirmed that BSD libc does not retry on EINTR. This is true both with OpenBSD libc, and with Apple libc in OS X. In both BSD libc and ACK libc, when EINTR happens, getchar() returns EOF and ferror(stdin) becomes true. There is a difference between BSD libc and ACK libc if the program calls getchar() again after ferror(stdin) is true. In BSD libc, getchar() continues reading. In ACK libc, getchar() returns EOF again. In both libraries, after feof(stdin) is true, getchar() returns EOF again. Observe: $ touch a b c $ rm -i a b c remove a? y remove b? ^Z $ fg Intel OS X immediately asks, "remove c?" The ^Z and fg causes EINTR, so getchar() returns EOF, and rm takes it as no to remove b. Then rm asks, "remove c?", and getchar() in BSD libc continues reading. OpenBSD and PowerPC OS X don't have EINTR here, so rm waits for an answer to "remove b?" before asking "remove c?" --George Koehler |