Commit Graph

496 Commits

Author SHA1 Message Date
tg e0c4ad7fa9 port to FreeMiNT: add OS uname and flags; 2>&- is evil™; $UNIXMODE must be preserved; unlink(2) is weird 2011-02-27 19:29:20 +00:00
tg 81b80af47a quell a warning when running with __CRAZY=Yes MKC_DEBG=cpp 2011-02-11 00:49:03 +00:00
tg 8b73363c20 query for select(2) in preparation of sleep and read-with-timeout builtins; ualarm(3) and friends are too awkward to use so we ifdef these builtins on select support ☹ 2011-02-09 19:32:26 +00:00
tg 45d99b9ec9 Scan for existence of <sys/file.h> which is not ubiquitous; allows
klibc-mksh (despite no hope to get a signal of a job) persistent history
2011-01-30 02:18:20 +00:00
tg bdfcdc56c8 introduce MKSH_NOPROSPECTOFWORK which is like pdksh’s JOB_SIGS in reverse, like MKSH_UNEMPLOYED is pdksh’s JOBS in reverse; allows mksh to work (hah! no pun intended…) with klibc (and possibly, Syllable Desktop and Plan 9) for now, until they fix their bugs 2011-01-30 01:35:35 +00:00
tg 07889fb0eb -DIN_MKSH is not used by anything 2011-01-29 19:07:16 +00:00
tg 1d6e0470e0 use header only if found 2011-01-21 20:51:56 +00:00
tg 7326331f30 RT|Chatzilla said in #!/bin/mksh that MSYS probably does mksh 2011-01-15 21:56:36 +00:00
tg ce160a8155 MKSH_SMALL need not imply !HAVE_REVOKE as default 2010-12-12 14:06:35 +00:00
tg 29de79c7bf mknod’s now demoted and only used as special-case builtin, in MirBSD only
built for the installer, to save time, as the original OpenBSD hack wanted
2010-10-08 17:56:57 +00:00
tg 3365cb8d0f • Build.sh: fix a compiler warning which, had it not been irrelevant in
a mirtoconf check, would’ve been a real problem on an LP64 platform
• sh.h: work around a bad interaction between -Wformat on gcc and manual
  string pooling for T_synerr, which is used in place of a format string
  in some places
2010-10-01 19:04:38 +00:00
tg 667d792d6a • Address concerns of Chris Palmer from the Android security team
– possible integer overflows in memory allocation, mostly
    ‣ multiplication: all are checked now
    ‣ addition: reviewed them, most were “proven” or guessed to be
      “almost” impossible to run over (e.g. when we have a string
      whose length is taken it is assumed that the length will be
      more than only a few bytes below SIZE_MAX, since code and
      stack have to fit); some are checked now (e.g. when one of
      the summands is an off_t); most of the unchecked ones are
      annotated now
    ⇒ cost (MirBSD/i386 static): +76 .text
    ⇒ cost (Debian sid/i386): +779 .text  -4 .data
  – on Linux targets, setuid() setresuid() setresgid() can fail
    with EAGAIN; check for that and, if so, warn once and retry
    infinitely (other targets to be added later once we know that
    they are “insane”)
    ⇒ cost (Debian sid/i386): +192 .text (includes .rodata)
• setmode.c: Do overflow checking for realloc() too; switch back
  from calloc() to a checked malloc() for simplification while there
• define -DIN_MKSH and let setmode.c look a tad nicer while here
2010-09-14 21:26:19 +00:00
tg 08862021ee add size optimisation hacks by me from Android except ifdef’d
(note, I’d prefer everyone to keep IDSTRINGs around though)
2010-09-14 21:15:11 +00:00
tg 79623f9ceb avoid more compiler warnings in mirtoconf phase 2010-08-24 15:46:06 +00:00
tg a0d43a99fd it’s ugly to write a ./stdint.h file if we can instead define the
types from sh.h; sync clog
2010-08-24 15:19:54 +00:00
tg 8b946de857 u_int32_t was only ever needed for OpenBSD’s pre-ISO-C arc4random API
since we don’t have that any longer, nuke it
2010-08-15 00:43:55 +00:00
tg 52f565f527 Tonnerre says his Linux 1.2 doesn’t have uint8_t, so check for it
and provide if necessary
2010-08-15 00:41:05 +00:00
tg f10186fedd new MKSH_A4PB cppflag: force use of arc4random_pushb(3) during seeding
just the way sysctl KERN_ARND currently is used on OpenBSD/MirBSD (for
manual packager overrides only, no mirtoconf check; e.g. for Cygwin)
2010-07-18 17:29:50 +00:00
tg 30046ffcf2 implement “live” SIGWINCH handling in the Emacs editing mode
for winstonw from IRC #!/bin/mksh
2010-07-04 17:45:17 +00:00
tg 4cbb5a9d46 to speed up mksh, get rid of arc4random(3) uses and use the LCG always;
depend on ASLR for seeding
2010-07-04 17:33:58 +00:00
tg faaa517636 • deprecate¹ -longoptions in favour of short options
‣ -combine → -c combine
  ‣ -llvm → -c llvm -O
  ‣ -llvm=x → -c llvm -o x
  ‣ -valgrind → -g²
• new option -v (version)
• new options -c (compile mode³), -o (opt flags), -O (reset opt flags)
• opt flags default to -std-compile-opts (llvm) now
• support⁴ the LLVM dragonegg plugin for GCC
• sync list of removed files (*.bc, *.ll, add missing Rebuild.sh)

① old options still valid but emit a warning
② except this one
③ compile modes are:
  • normal
  • makefile (-M)
  • combine (old -combine, new -c combine)
  • dragonegg (new -c dragonegg)
  • llvm (old -llvm, old -llvm=*, new -c llvm)
  the first two are not settable via -c though…
④ sample use:
  tg@seduxbox:~/x$ export PATH=$PATH:/opt/llvm/bin
  tg@seduxbox:~/x$ CC='/opt/gcc-4.5.1/bin/gcc-4.5.1 -fplugin=/opt/llvm/lib/dragonegg.so' sh ../mksh/Build.sh -c dragonegg -r

Thanks to «dileX:#grml» for giving ssh access.
2010-05-13 18:41:13 +00:00
tg 5abce90817 add MKSH_DEFAULT_TMPDIR 2010-04-20 17:28:20 +00:00
tg d23b94aaa0 newer SUNWcc has different error messages ☹ 2010-03-30 13:29:03 +00:00
tg f41d5ba82f allow MKSHRC_PATH to change from 「"~/.mkshrc"」, for Android &c. 2010-03-27 20:36:26 +00:00
tg ab1af5bdaf disable BGNICE by default for MKSH_SMALL 2010-03-27 15:32:58 +00:00
tg 52e9469a82 make MKSH_DEFAULT_EXECSHELL (/bin/sh) configurable, for Android 2010-03-27 15:29:00 +00:00
tg 50f081c369 even better on Haiku:
* let ulimits work
* add a Haiku-specific ulimit
* always use UTF-8, they have no locales but a UTF-8 terminal
2010-03-14 11:58:33 +00:00
tg e0f952eeda work when there is no dirname(1), e.g. 4.3 BSD Quasijarus VAX 2010-03-14 11:56:07 +00:00
tg 6f0892b3cc now, skip LDFLAGS and LIBS when using $CPP _for real_ this time 2010-03-01 08:57:45 +00:00
tg 2b2b76d1f5 here no LDFLAGS, LIBS (for cpp) 2010-02-23 22:02:35 +00:00
tg 396ebbb675 (semi-tested) clean up removing; prevent accidental rm of mksh.1 2010-02-23 22:02:19 +00:00
tg 532159415c no longer pull in libcrypt on AIX, only Interix (where it has arc4random)
tested by cnuke@ – 10x
2010-02-18 17:21:19 +00:00
tg 64044f0716 revert 1.371 and just tell people to whitelist conftest.c
now that we use the same name as quiet-by-design autoconf
to please ccache anyway (and no we will not become quiet,
I can't usually get my hand on a buildd's conftest.log)
2010-02-16 23:53:28 +00:00
tg 9ed7b897a9 place -xipo check at right position 2010-01-28 19:46:53 +00:00
tg e63c70dbf9 provide -valgrind Build.sh option which defines -g3 -DDEBUG -fno-builtin;
the latter is required to work around gcc’s strlen() reading past end of
buffer (multi-byte reads)
2010-01-28 17:03:22 +00:00
tg 6eed6635e9 check for -xipo on SUNWcc (needs -xO4 though, which I refuse to enable
automatically)
2010-01-28 15:12:34 +00:00
tg c9ac50df02 use conftest.c ipv scn.c since that’s recognised by at least ccache as magic 2010-01-25 12:16:04 +00:00
tg a82dc41e99 add an explicit message when mirtoconf+siglist generation are done 2010-01-19 14:26:24 +00:00
tg 18754d1cf8 __attribute__((used)) is not for pcc (but unused works) 2010-01-01 18:27:42 +00:00
tg 769e222586 re-vamp __attribute__ handling; let this pass on HP-UX bundled compiler
as well as HP aCC
2009-12-12 22:27:10 +00:00
tg 0c3acb2374 HP-UX IA64: +DD64 is no longer necessary with aCC (no gcc available…) 2009-12-12 21:17:25 +00:00
tg 37b1260d13 unbreak test.sh in some cases 2009-12-05 16:19:59 +00:00
tg dc98ec23a6 do not use PATH_MAX on GNU/Hurd (even if it *was* defined), but use
some glibc-only functions that don’t require its use instead

tested on gnubber, where (admittedly) sysconf(_PC_PATH_MAX) == 1024…
2009-10-27 17:00:02 +00:00
tg 9f4376d2ad GNU make needs VPATH with the for-all-make(1)s thing (at least if
the sources are in different directories, despite being listed in
${SRCS_FP} with full paths) - XXX can this work with nmake or so?
2009-10-16 18:51:30 +00:00
tg 990c9eaf0c tentatively add new -M option to generate a "Makefrag.inc" instead
of doing the actual compile (along with the usual Rebuild.sh, test.sh
and, if necessary, things such as signames.inc) for Android integration
2009-10-16 18:45:31 +00:00
tg 18c470fb3b since mksh uses /* comments with apo'strophes */ both in the copyright
and code, we MUST check if they work, since C99 apparently forbids it…
2009-10-15 16:50:21 +00:00
tg 8f3f520725 AIX {,/usr}/bin/bsh is an SVR3 Bourne Shell, according to Sven Mascheck,
so I must not use foo="…`…"…"…`…" at all
2009-10-15 12:58:34 +00:00
tg 1dfb13b603 change undef/def MKSH_NOVI into 0/1 MKSH_S_NOVI flag (with more to come:
MKSH_S_EDIT for small (Emacs) editing mode, MKSH_S_FEAT for all the dis-
abled language features), which can be set to 0 despite MKSH_SMALL being
defined to re-enable the Vi command line editing mode (which I wouldn't,
but fits into the general mastermind scheme)
2009-09-24 17:15:33 +00:00
tg f00db85c98 SUNWcc related fixes for normal and MKSH_SMALL 2009-09-23 18:22:38 +00:00
tg 31e02e59f7 add a do_realpath() implementation replacing the use of the external
libc function realpath(3) which may not be available on the target
system; compile the realpath builtin unconditionally

looks fine to me, but review is appreciated; this is (very) lightly
based upon MirBSD libc’s realpath(3) and pdksh’s get_phys_path()
2009-08-30 13:22:39 +00:00