Commit graph

16 commits

Author SHA1 Message Date
George Koehler d6413c1a11 Enable long long in ACK C for osx386. 2019-09-25 12:35:48 -04:00
George Koehler c6ceaac1af Make osx386 and osxppc use _hol0.s like the other platforms.
Because I'm lazy, I didn't make another copy of _hol0.s; I am building
plat/linux/libsys/_hol0.s for OS X.
2018-01-23 13:55:39 -05:00
George Koehler de2c7c3f25 Hide some i386 stuff from linux68k, linuxppc.
Rename plat/linux/libsys/errno.s to plat/linux386/libsys/trapno.s and
stop building it for linux68k and linuxppc.  It defines symbols for
mach/i386/libem.

In syscalls.h, the numbers after 165 are only for i386, so hide them
from 68k, ppc.  These numbers are unused, because the system calls now
in libsys use the lower numbers.

Also teach the build system that libsys depends on the internal
headers in plat/linux/libsys/*.h
2018-01-08 23:46:30 -05:00
David Given 0e10329876 Fix an issue throughout where B couldn't be built by ackprogram due to symbol
laziness.
2016-12-29 17:11:53 +00:00
David Given 3cdceaa700 Merge in B changes. 2016-12-28 17:30:14 +00:00
George Koehler 6cbea83f7f Don't share as, ncg, top between Linux and Mac OS X.
Telling osx386 and osxppc to build and run their own tools, not to
reuse the tools from linux386 and linuxppc.  This wastes time to build
identical tools, but it removes some bogus dependencies.  OS X tools
had wrongly depended on Linux descr files and aelflod; now they don't.

Discussion in https://github.com/davidgiven/ack/pull/23
2016-12-05 20:13:29 -05:00
David Given c569ca15d8 Clean up how the language libraries refer to plat headers; they should be using
the +pkg forms of the rules and getting the headers via the paths in descr,
rather than depending on the +headers version.
2016-12-05 21:05:24 +01:00
David Given c5aff6fc2e Change dependency from simplerule{} with a dependency but no outputs to an
installable; otherwise, the dependency would be built, but the result wouldn't
get added to the header path and so wouldn't be seen.
2016-12-05 20:33:26 +01:00
George Koehler 355cc06fff Write README files for osx386 and osxppc. 2016-12-03 17:17:44 -05:00
George Koehler 466bc555fe Add getdirentries() and stat() for Mac OS X.
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).
2016-11-28 14:32:49 -05:00
George Koehler b6b707d9df Make working gettimeofday() for Mac OS X.
The system call puts the time in a pair of registers, not in the
timeval structure.  Add code to move the time to the structure, so
programs see the correct time, not garbage.  This fixes our example
programs that use the time as a random seed.
2016-11-23 13:25:55 -05:00
George Koehler 98f2273d97 Teach cvmach to emit the symbol table.
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>.
2016-11-22 17:16:30 -05:00
George Koehler 6e31d46d6f Fix my typo to put symbol "begrom" in correct section. 2016-11-19 19:23:42 -05:00
George Koehler 0d0495e818 Install only 1 copy, not 2 copies, of osx headers.
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.
2016-11-08 17:13:51 -05:00
George Koehler 7f94e971fd Remove trailing whitespace in plat/osx*
Also fix a comment.
2016-11-08 15:22:09 -05:00
George Koehler 02fb480217 Commit a preview of osx386 and osxppc as new platforms.
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
2016-10-02 14:58:05 -04:00