a585ddf578
Linux passes the arguments in registers, but our compiler expects arguments on the stack. Signal handlers got garbage instead of the signal number. Some handlers, like the one in lang/m2/libm2/sigtrp.c, need the correct signal number. I write a "bridge" in PowerPC assembly that moves the arguments to the stack. I put the bridge in sigaction(), so I provide a signal() that calls sigaction(). I remove the *.c glob or wildcard from build.lua, so linuxppc only compiles its own signal.c, not the other signal.c for linux386 and linux68k. My bridge uses sigprocmask(), so I also add sigprocmask(). Because linux386 and linux68k use globs, they also get sigprocmask(). I sync the header files so all three Linux platforms declare execve(), sigprocmask(), and unlink(), but not remove(), because we have remove() in <stdio.h>. I am using sigaction.s to test some features that we recently added to our PowerPC assembler. These are the "hi16[...]" and "lo16[...]" syntax, and also the extended names like "beq", "cmpwi", "li", "subi".
37 lines
825 B
Lua
37 lines
825 B
Lua
acklibrary {
|
|
name = "lib",
|
|
srcs = {
|
|
"./_syscall.s",
|
|
"./sigaction.s",
|
|
"./signal.c",
|
|
"./trap.s",
|
|
"plat/linux/libsys/_exit.c",
|
|
"plat/linux/libsys/_hol0.s",
|
|
"plat/linux/libsys/close.c",
|
|
"plat/linux/libsys/creat.c",
|
|
"plat/linux/libsys/errno.s",
|
|
"plat/linux/libsys/execve.c",
|
|
"plat/linux/libsys/getpid.c",
|
|
"plat/linux/libsys/gettimeofday.c",
|
|
"plat/linux/libsys/ioctl.c",
|
|
"plat/linux/libsys/isatty.c",
|
|
"plat/linux/libsys/kill.c",
|
|
"plat/linux/libsys/lseek.c",
|
|
"plat/linux/libsys/open.c",
|
|
"plat/linux/libsys/read.c",
|
|
"plat/linux/libsys/sbrk.c",
|
|
-- omit signal.c
|
|
"plat/linux/libsys/sigprocmask.c",
|
|
"plat/linux/libsys/unlink.c",
|
|
"plat/linux/libsys/write.c",
|
|
},
|
|
deps = {
|
|
"lang/cem/libcc.ansi/headers+headers",
|
|
"plat/linuxppc/include+headers",
|
|
},
|
|
vars = {
|
|
plat = "linuxppc"
|
|
}
|
|
}
|
|
|