Until now, I was always doing chmod +x before running my files on the
Mac. Now files get created +x. There's no change when overwriting
an existing file. I needed to gmake clean my build to remove the
example programs without +x, so cvmach can create them with +x.
If I want to check for overflow, then I should check it before I do
base + incr, not after.
Now that I have no check, I am passing the overflowed base + incr to
brk1(), where it will probably fail the nbreak < segment check.
This manual is in the new mdoc(7) format. All existing ack manuals
use the old man(7) format. This might be a problem if someone can't
display mdoc(7) files.
The build system doesn't install the cvmach(6) manual; that might
happen later. The current build system installs manuals in two
different places, and doesn't install some manuals, so I don't know
what to do.
This prevents the warning, "implicit declaration of function raise",
in programs that call raise(). I forgot to declare it because the
function raise() is in libc but the declaration goes in libsys.
Also add fstat() and lstat(). I don't #define the constants for
st_mode or d_type, but I provide enough to get the block size of a
file and to list the names in a directory. Some fields of struct stat
get truncated, see XXX in plat/osx/include/sys/stat.h.
In struct dirent, the inode field might be d_ino or d_fileno. I
picked d_ino because Apple's sys/dirent.h uses d_ino (but Apple's
manual pages use d_fileno).
This preserves the name and value of every symbol. The type and other
info of a symbol might be lost. In gdb, one can now "disas main" or
"disas '.ret'" to disassemble functions by name.
Most symbols are in sections, so I also teach cvmach to emit the Mach
section headers. The entry point in plat/osx*/descr moves down to
make room for the section headers and LC_SYMTAB.
I fix some bugs in calculations of cvmach. They were wrong if ROM had
a greater alignment than TEXT, or if DATA did not start on a page
boundary. I introduce machseg[] to simplify the mess of variables in
main(). I declare most functions as static. Also, cvmach becomes the
first program to #include <object.h>.
Before this commit, the headers in plat/osx/include got installed
twice into PLATIND/osx386/include and PLATIND/osxppc/include. This
commit installs them once into PLATIND/osx/include and changes both
descr files to find them.
Several rules in lang/ depend on plat/osx386/include+headers or
plat/osxppc/include+headers. They each become a simplerule that
depends on plat/osx/include+headers.
These produce Mach-o executables for Mac OS X on Intel or PowerPC
processors. Our code generator for PowerPC (mach/powerpc) still has
bugs. Some examples seem to run, but startrek crashes. Our code
generator for Intel (mach/i386) is better.
There is a problem with job control. If you run paranoia or startrek,
then suspend the job (^Z) and resume it ('fg' in bash), then read(2)
might fail with EINTR.
The larger files in this commit are
- plat/osx/cvmach/cvmach.c
- plat/osx/libsys/brk.c
- plat/osx386/libsys/sigaction.s
- plat/osxppc/libsys/sigaction.s