Commit graph

87 commits

Author SHA1 Message Date
David Given 5dd6e8c856 Make compatible with lua 5.1. 2022-08-01 22:44:31 +02:00
David Given 551f666028 Silence an irritating warning. 2022-08-01 22:08:13 +02:00
David Given f5acf70911 Typo fix. 2022-07-20 00:24:52 +02:00
David Given 7298be8964 Move the em_table_lib.lua helper file elsewhere because we're going to need it. 2022-07-16 13:25:13 +02:00
David Given 25b6712e63 Rework all the ackbuilder scripts not to use wildcards, because we can't expand
them without luaposix, which isn't available (easily) on OSX or Windows.
2022-07-14 23:57:54 +02:00
David Given 76060c4dde Eliminate the TMP_DIR compile-time constant in favour of using $TMPDIR and
mkstemp where possible.
2022-05-29 00:44:28 +02:00
George Koehler 36f16b0cb8 Cut down some clang warnings
Edit C code to reduce warnings from clang.  Most warnings are for
implicit declarations of functions, but some warnings want me to add
parentheses or curly braces, or to cast arguments for printf().

Make a few other changes, like declaring float_cst() in h/con_float to
be static, and using C99 bool in ego/ra/makeitems.c and
ego/share/makecldef.c.  Such changes don't silence warnings; I make
such changes while I silence warnings in the same file.  In
float_cst(), rename parameter `str` to `float_str`, so it doesn't
share a name with the global variable `str`.

Remove `const` from `newmodule(const char *)` in mach/proto/as to
silence a warning.  I wrongly added the `const` in d347207.

For warnings about implicit declarations of functions, the fix is to
declare the function before calling it.  For example, my OpenBSD
system needs <sys/wait.h> to declare wait().

In util/int, add "whatever.h" to declare more functions.  Remove old
declarations from "mem.h", to prefer the newer declarations of the
same functions in "data.h" and "stack.h".
2019-10-30 18:36:38 -04:00
carl 98d8505c6e arch.h flag fixing 2019-03-25 00:07:43 +08:00
David Given 53f7de794a Ansify. 2018-09-10 22:55:05 +02:00
David Given 9733454d8e Clang-format before editing. 2018-09-10 22:42:30 +02:00
David Given 5dfef6f180 Rework relocations again: add RELO2HI and RELO2HISAD for the high two bytes of
a word.
2018-09-09 14:11:11 +02:00
David Given b3b7c684c6 Simplify MIPS relocations. Add RELS2 (for generic high-word relocations). Add
support for MIPS branch-and-jump relocations.
2018-09-09 12:23:59 +02:00
David Given fe5ca5a85f Added li and la instructions. 2018-09-03 22:47:41 +02:00
David Given 4741ed8e14 Add a completely non-tested table-based MIPS assembler. 2018-09-01 19:35:31 +02:00
David Given f8ba7ef962 Move the Modula-2 library includes into a directory in lang/m2 where they belong. 2018-06-24 20:32:59 +02:00
David Given 1702d873ea Warning-fix and protoise the basic library. 2018-06-24 00:35:51 +02:00
David Given fe3951d4ae Warning fix. 2018-06-23 11:14:49 +02:00
David Given d1671fc2e3 Move the private Pascal headers into libpc where they belong. 2018-06-17 15:44:33 +02:00
David Given 670c7ce96f After finding the em_table documentation, move it somewhere where other people
can find it.
2018-06-13 20:58:44 +09:00
David Given 911ce7ceb5 Crudely tweak some of the prototypes to please clang, which is pickier about
K&R C than gcc is.
2018-06-02 21:31:18 +02:00
George Koehler 5301cceee3 Declare machine-dependent functions in mach/proto/ncg
This breaks all machines because the declared return type void
disagrees with the implicit return type int (when I compile mach.c
with clang).  Unbreak i386, i80, i86, m68020, powerpc, vc4 by adding
the return types to mach.c.  We don't build any other machines; they
are broken since commit a46ee91 (May 19, 2013) declared void prolog()
and commit fd91851 (Nov 10, 2016) declared void mes(), with both
declarations in mach/proto/ncg/fillem.c.

Also fix mach/vc4/ncg/mach.c where type full is long, so fprintf()
must use "%ld" not "%d" to print full nlocals.
2017-11-13 14:23:44 -05:00
George Koehler 909b0d5bf3 Add prototypes to functions in subr.c
Put the declarations in "data.h", because that header declares the
types cost_t and token_p.  Also #include <cgg_cg.h> from "data.h" to
get types c3_p and set_p, and guard <cgg_cg.h> against multiple
inclusion.
2017-11-12 16:11:05 -05:00
George Koehler 73ad5a227d Rename RELOLIS to RELOPPC_LIS.
This relocation is specific to PowerPC.  @davidgiven suggested the
name RELOPPC_LIS in
https://github.com/davidgiven/ack/pull/52#issuecomment-279856501

Reindent the list in h/out.h and util/led/ack.out.5 because
RELOLIS_PPC is a long name.  I use spaces and no tabs because the tabs
looked bad in the manual page.
2017-10-18 15:39:31 -04:00
George Koehler 1bf58cf51c Add RELOLIS for PowerPC lis with ha16 or hi16.
The new relocation type RELOLIS handles these instructions:

    lis RT, ha16[expr] == addis RT, r0, ha16[expr]
    lis RT, hi16[expr] == addis RT, r0, hi16[expr]

RELOLIS stores a 32-bit value in the program text.  In this value, the
high bit is a ha16 flag, the next 5 bits are the target register RT,
and the low bits are a signed 26-bit offset.  The linker replaces this
value with the lis instruction.

The old RELOPPC relocated a ha16/lo16 or hi16/lo16 pair.  The new
RELOLIS relocates only a ha16 or hi16, so it is no longer necessary to
have a matching lo16 in the next instruction.  The disadvantage is
that RELOLIS has only a signed 26-bit offset, not a 32-bit offset.

Switch the assembler to use RELOLIS for ha16 or hi16 and RELO2 for
lo16.  The li32 instruction still uses the old RELOPPC relocation.

This is not the same as my RELOPPC change from my recent mail to
tack-devel (https://sourceforge.net/p/tack/mailman/message/35651528/).
This commit is on a different branch.  Here I am throwing away my
RELOPPC change and instead trying RELOLIS.
2017-02-08 11:46:31 -05:00
George Koehler 65c2a8a0ae Remove stackadjust and stackoffset() from ncg.
This feature has never been used since its introduction, more than 3
years ago, in David Given's commit c93cb69 of May 8, 2013.  The commit
was for "PowerPC and M68K work".  I am not undoing the entire commit.
I am only removing the stackadjust and stackoffset() feature.

This commit removes the feature from my branch kernigh-linuxppc.  This
removal includes the mach/proto/ncg parts.  The default branch already
removed most of the feature, but kept the mach/proto/ncg parts.  That
removal happened in commit 81778b6 of May 13, 2013 (which was a merge;
git diff af0dede 81778b6).  The branch dtrg-experimental-powerpc
merged the default branch but without the removal.  That merge was
commit 4703db0f of Sep 15, 2016 (git diff 8c94b13 4703db0).  My branch
kernigh-linuxppc is off branch dtrg-experimental-powerpc, so I can no
longer get the removal by merging default.

David Given described the stackadjust feature in
  https://sourceforge.net/p/tack/mailman/message/30814691/

The instruction stackadjust would add a value to the offset, and the
function stackoffset() would return this offset.  One would use this
to track sp - fp, then omit the frame pointer by not keeping fp in a
register.
2016-10-07 20:52:13 -04:00
David Given 80cb6ba927 Eliminate the RELOH2 relocation, as it never worked --- the address would be
calculated incorrectly because of overflow errors.

Replace it with an extended RELOPPC relocation which understands addis/ori
pairs; add an la pseudoop to the assembler which generates these and the
appropriate relocation. Make good.

--HG--
branch : dtrg-experimental-powerpc-branch
2016-09-17 12:43:15 +02:00
David Given 4703db0fff Merge from default.
--HG--
branch : dtrg-experimental-powerpc-branch
2016-09-15 22:59:01 +02:00
David Given f67c98e239 Distributions are a pain --- let's not bother any more. Instead, we just tag
the repository and download a complete snapshot, old and ancient stuff and all.
2016-09-02 23:00:38 +02:00
David Given 363d13cc2f C preprocessor; tabgen; now the pc86 boot.s builds using the ack
toolchain.
2016-07-29 00:22:49 +02:00
David Given a8a9d1bbfa yacc, ncgg; platform ncg builds now. 2016-07-26 23:35:30 +02:00
David Given 1fdc69fb97 cemcom.ansi now builds. 2016-07-19 23:43:14 +02:00
David Given d805052205 All the amisc binaries now build. 2016-06-19 09:32:45 +02:00
David Given 2af8568cc3 First draft at installables; not very satisfactory. make bugs with multiple
output targets and parallelism?
2016-06-16 05:26:44 +02:00
David Given 09554cb324 installable works, although it's a bit kludgy. Change the : separator to +
because : is special in make and non of the others I could think of would work.
2016-06-14 07:34:14 +02:00
David Given 605651776e We can build a real program now! 2016-06-12 20:59:43 +02:00
David Given ef8e6e25e0 Fix a whole pile of issues related to the failed attempt to increase
the number of types of relocation possible in the object file. (Now,
hopefully, working.)

Also change the object serialiser/deserialiser to never try to read or
write raw structures; it's way safer this way and we don't need the
performance boost any more.

--HG--
branch : default-branch
2016-03-18 21:46:55 +01:00
David Given 7e964dd25e Raise the limit on ack.out relocation types by making the size of a
relocation structure bigger. Bump ack.out magic number.

--HG--
branch : default-branch
2016-03-14 21:08:55 +01:00
David Given d3e3e72860 Update from trunk.
--HG--
branch : dtrg-videocore
2013-05-29 15:03:48 +01:00
David Given 6fff2d45fe Attempt to fix 64-bitness error in ashow. Deprecate the structure format macros in h/out.h because they make no sense on 64-bit platforms. 2013-05-29 14:48:51 +01:00
David Given 5378e3fe53 Add special relocation type for VC4 jump instructions.
--HG--
branch : dtrg-videocore
2013-05-17 22:40:50 +01:00
David Given d91a1dc1a6 Merge changes from branch: linux68k platform, linuxppc platform (partially
working), and miscellaneous changes to support these.
2013-05-09 18:14:16 +01:00
David Given c93cb69959 Check in incomplete Linux PowerPC and M68K work.
--HG--
branch : dtrg-experimental-powerpc
2013-05-08 00:48:48 +01:00
David Given dccecc5d45 Back out erroneous change. 2012-12-14 11:56:21 +00:00
David Given 2beb3646a7 Change to use stdint's implementation independent types rather than short and
long (which vary depending on whether you're on a 64-bit system or not).
2012-09-27 10:54:41 +01:00
George Koehler 0131ca4d46 Delete 689 undead files.
These files "magically reappeared" after the conversion from CVS to
Mercurial.  The old CVS repository deleted these files but did not
record *when* it deleted these files.  The conversion resurrected these
files because they have no history of deletion.  These files were
probably deleted before year 1995.  The CVS repository begins to record
deletions around 1995.

These files may still appear in older revisions of this Mercurial
repository, when they should already be deleted.  There is no way to fix
this, because the CVS repository provides no dates of deletion.

See http://sourceforge.net/mailarchive/message.php?msg_id=29823032
2012-09-20 22:26:32 -04:00
dtrg 1c83baa702 Adapted for ANSI C and our pseudo-Posix syscall interface. 2007-04-21 23:18:14 +00:00
dtrg b611731ec3 Updated .distr files for the new release. 2007-02-25 12:51:55 +00:00
dtrg 877dc01422 Moved from /etc. 2007-02-25 12:42:04 +00:00
ceriel 5c83e7dbb5 Header --> Id 1994-06-24 11:31:16 +00:00
ceriel b53facde73 removed macro defining ushort; gave clash with /usr/include/sys/types.h 1991-12-12 14:15:14 +00:00