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
– 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
‣ -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.
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)
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)
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()