mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Allow ksh to compile on Haiku; implement SIGKILLTHR support (#408)
This commit implements the build fixes required to get ksh running on
Haiku. Note that while ksh does compile, it has a ton of regression test
failures on Haiku.
src/cmd/ksh93/data/signals.c,
src/lib/libast/features/signal.c:
- Add support for the SIGKILLTHR signal, which is supported by BeOS and
Haiku.
- SIGINFO was missing an entry in the libast feature test, so add one
(re: 658bba74
).
src/cmd/ksh93/RELEASE:
- Add an entry noting that ksh now compiles on Haiku, albeit with many
regression test failures.
src/cmd/ksh93/{include/terminal.h,sh/path.c}:
- Silence compiler warnings on Haiku.
src/lib/libast/features/mmap:
- The mmap feature test freezes on Haiku, so modify the test to fail
immediately on that OS.
src/lib/libast/misc/signal.c:
- Avoid redefining the signal definition on Haiku to fix a compiler
error.
src/lib/libast/features/nl_types:
- For some reason the nl_item typedef on Haiku doesn't work correctly.
Work around that by creating the nl_item type in the libast nl_types
feature test.
This commit is contained in:
parent
b590a9f155
commit
d347ec0fc9
10 changed files with 29 additions and 2 deletions
7
NEWS
7
NEWS
|
@ -3,6 +3,13 @@ For full details, see the git log at: https://github.com/ksh93/ksh
|
||||||
|
|
||||||
Any uppercase BUG_* names are modernish shell bug IDs.
|
Any uppercase BUG_* names are modernish shell bug IDs.
|
||||||
|
|
||||||
|
2021-12-29:
|
||||||
|
|
||||||
|
- Fixed numerous build errors that prevented ksh from running on Haiku OS.
|
||||||
|
|
||||||
|
- Added support for the SIGKILLTHR signal on operating systems that
|
||||||
|
implement it.
|
||||||
|
|
||||||
2021-12-28:
|
2021-12-28:
|
||||||
|
|
||||||
- Fixed a bug that caused CDPATH to continue working after unsetting it.
|
- Fixed a bug that caused CDPATH to continue working after unsetting it.
|
||||||
|
|
|
@ -277,6 +277,7 @@ failures (crashes, and/or important functionality does not work).
|
||||||
*** Windows 7 using Cygwin on x86
|
*** Windows 7 using Cygwin on x86
|
||||||
*** Windows 10 using Cygwin on x86_64
|
*** Windows 10 using Cygwin on x86_64
|
||||||
*** Windows 11 using Cygwin on x86_64
|
*** Windows 11 using Cygwin on x86_64
|
||||||
|
*** Haiku R1/beta3 on x86_64
|
||||||
|
|
||||||
#### REPORTING BUGS ####
|
#### REPORTING BUGS ####
|
||||||
|
|
||||||
|
|
|
@ -128,6 +128,9 @@ const struct shtable2 shtab_signals[] =
|
||||||
#ifdef SIGKILL
|
#ifdef SIGKILL
|
||||||
"KILL", VAL(SIGKILL,0), S("Killed"),
|
"KILL", VAL(SIGKILL,0), S("Killed"),
|
||||||
#endif /* SIGKILL */
|
#endif /* SIGKILL */
|
||||||
|
#ifdef SIGKILLTHR
|
||||||
|
"KILLTHR", VAL(SIGKILLTHR,SH_SIGDONE), S("Kill Thread"),
|
||||||
|
#endif /* SIGKILLTHR */
|
||||||
#ifdef SIGLAB
|
#ifdef SIGLAB
|
||||||
"LAB", VAL(SIGLAB,0), S("Security label changed"),
|
"LAB", VAL(SIGLAB,0), S("Security label changed"),
|
||||||
#endif /* SIGLAB */
|
#endif /* SIGLAB */
|
||||||
|
|
|
@ -196,6 +196,7 @@ extern int tty_raw(int,int);
|
||||||
extern int tty_check(int);
|
extern int tty_check(int);
|
||||||
extern int tty_set(int, int, struct termios*);
|
extern int tty_set(int, int, struct termios*);
|
||||||
extern int sh_ioctl(int,int,void*,int);
|
extern int sh_ioctl(int,int,void*,int);
|
||||||
|
#undef ioctl
|
||||||
#define ioctl(a,b,c) sh_ioctl(a,b,c,sizeof(c))
|
#define ioctl(a,b,c) sh_ioctl(a,b,c,sizeof(c))
|
||||||
#ifdef _lib_tcgetattr
|
#ifdef _lib_tcgetattr
|
||||||
extern int sh_tcgetattr(int,struct termios*);
|
extern int sh_tcgetattr(int,struct termios*);
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#define SH_RELEASE_FORK "93u+m" /* only change if you develop a new ksh93 fork */
|
#define SH_RELEASE_FORK "93u+m" /* only change if you develop a new ksh93 fork */
|
||||||
#define SH_RELEASE_SVER "1.0.0-beta.2" /* semantic version number: https://semver.org */
|
#define SH_RELEASE_SVER "1.0.0-beta.2" /* semantic version number: https://semver.org */
|
||||||
#define SH_RELEASE_DATE "2021-12-28" /* must be in this format for $((.sh.version)) */
|
#define SH_RELEASE_DATE "2021-12-29" /* must be in this format for $((.sh.version)) */
|
||||||
#define SH_RELEASE_CPYR "(c) 2020-2021 Contributors to ksh " SH_RELEASE_FORK
|
#define SH_RELEASE_CPYR "(c) 2020-2021 Contributors to ksh " SH_RELEASE_FORK
|
||||||
|
|
||||||
/* Scripts sometimes field-split ${.sh.version}, so don't change amount of whitespace. */
|
/* Scripts sometimes field-split ${.sh.version}, so don't change amount of whitespace. */
|
||||||
|
|
|
@ -1417,6 +1417,7 @@ static noreturn void exscript(register char *path,register char *argv[],char **e
|
||||||
if(sh.sigflag[SIGCHLD]==SH_SIGOFF)
|
if(sh.sigflag[SIGCHLD]==SH_SIGOFF)
|
||||||
sh.sigflag[SIGCHLD] = SH_SIGFAULT;
|
sh.sigflag[SIGCHLD] = SH_SIGFAULT;
|
||||||
siglongjmp(*sh.jmplist,SH_JMPSCRIPT);
|
siglongjmp(*sh.jmplist,SH_JMPSCRIPT);
|
||||||
|
UNREACHABLE(); /* silence warning on Haiku */
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SHOPT_ACCT
|
#if SHOPT_ACCT
|
||||||
|
|
|
@ -19,6 +19,9 @@ tst lib_mmap note{ standard mmap interface that works }end execute{
|
||||||
int
|
int
|
||||||
main(int argc, char** argv)
|
main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
#ifdef __HAIKU__
|
||||||
|
return 1; /* don't even bother, on Haiku it freezes the system */
|
||||||
|
#endif
|
||||||
caddr_t mm;
|
caddr_t mm;
|
||||||
char *t, *u, *f;
|
char *t, *u, *f;
|
||||||
int i, fd, okfixed;
|
int i, fd, okfixed;
|
||||||
|
|
|
@ -19,6 +19,9 @@ tst output{
|
||||||
printf("#include <%s> /* the native nl_types.h */\n", _nxt_nl_types_str);
|
printf("#include <%s> /* the native nl_types.h */\n", _nxt_nl_types_str);
|
||||||
#endif
|
#endif
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
printf("#ifdef __HAIKU__\n");
|
||||||
|
printf("typedef int nl_item; /* workaround system header bug */\n");
|
||||||
|
printf("#endif\n");
|
||||||
#ifndef NL_SETMAX
|
#ifndef NL_SETMAX
|
||||||
printf("#undef NL_SETMAX\n");
|
printf("#undef NL_SETMAX\n");
|
||||||
printf("#define NL_SETMAX 1023\n");
|
printf("#define NL_SETMAX 1023\n");
|
||||||
|
|
|
@ -120,6 +120,10 @@ static struct _m_ map[] =
|
||||||
#define HAD_SIGILL 1
|
#define HAD_SIGILL 1
|
||||||
"Illegal instruction", "ILL", SIGILL,
|
"Illegal instruction", "ILL", SIGILL,
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef SIGINFO
|
||||||
|
#define HAD_SIGINFO 1
|
||||||
|
"Information request", "INFO", SIGINFO,
|
||||||
|
#endif
|
||||||
#ifdef SIGINT
|
#ifdef SIGINT
|
||||||
#define HAD_SIGINT 1
|
#define HAD_SIGINT 1
|
||||||
"Interrupt", "INT", SIGINT,
|
"Interrupt", "INT", SIGINT,
|
||||||
|
@ -136,6 +140,10 @@ static struct _m_ map[] =
|
||||||
#define HAD_SIGKILL 1
|
#define HAD_SIGKILL 1
|
||||||
"Killed", "KILL", SIGKILL,
|
"Killed", "KILL", SIGKILL,
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef SIGKILLTHR
|
||||||
|
#define HAD_SIGKILLTHR 1
|
||||||
|
"Kill Thread", "KILLTHR", SIGKILLTHR,
|
||||||
|
#endif
|
||||||
#ifdef SIGLAB
|
#ifdef SIGLAB
|
||||||
#define HAD_SIGLAB 1
|
#define HAD_SIGLAB 1
|
||||||
"Security label changed", "LAB", SIGLAB,
|
"Security label changed", "LAB", SIGLAB,
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
* fun==SIG_DFL also unblocks signal
|
* fun==SIG_DFL also unblocks signal
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !_UWIN
|
#if !_UWIN && !__HAIKU__
|
||||||
|
|
||||||
#undef signal
|
#undef signal
|
||||||
#define signal ______signal
|
#define signal ______signal
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue