2016-09-15 21:12:03 +00:00
|
|
|
acklibrary {
|
Fix parameters of signal handlers for linuxppc.
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".
2017-01-22 05:52:32 +00:00
|
|
|
name = "lib",
|
|
|
|
srcs = {
|
|
|
|
"./_syscall.s",
|
|
|
|
"./sigaction.s",
|
|
|
|
"./signal.c",
|
|
|
|
"plat/linux/libsys/_exit.c",
|
|
|
|
"plat/linux/libsys/_hol0.s",
|
|
|
|
"plat/linux/libsys/close.c",
|
|
|
|
"plat/linux/libsys/creat.c",
|
|
|
|
"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",
|
|
|
|
},
|
2016-09-15 21:12:03 +00:00
|
|
|
deps = {
|
2018-01-09 03:26:24 +00:00
|
|
|
"plat/linux/libsys/*.h",
|
2016-09-15 21:12:03 +00:00
|
|
|
"lang/cem/libcc.ansi/headers+headers",
|
|
|
|
"plat/linuxppc/include+headers",
|
|
|
|
},
|
Fix parameters of signal handlers for linuxppc.
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".
2017-01-22 05:52:32 +00:00
|
|
|
vars = {
|
|
|
|
plat = "linuxppc"
|
|
|
|
}
|
2016-09-15 21:12:03 +00:00
|
|
|
}
|
|
|
|
|