tms34010: Morton's 1994 GCC 2.5.8 cc1, and the hosts TI shipped the tools for #15

Merged
arti merged 3 commits from opencode.energia.arti.ee/vt1200:docs/tms34010-hosts-and-morton-gcc into master 2026-11-17 05:04:51 +02:00
17 changed files with 68771 additions and 0 deletions

No files matched your search

+1
View File
@@ -42,6 +42,7 @@ harness/mame/gui.log
/cfg/
/nvram/
/roms/
/snap/
# Large media: the source recording stays out of git (a YouTube download,
# trivially re-obtainable). The derived frames and contact sheets ARE committed,
File diff suppressed because it is too large. Load diff
+127
View File
@@ -0,0 +1,127 @@
# TMS34010 toolchain on non-DOS hosts
Investigated 2026-10-30. Short answer:
* TI **did** ship the TMS34010/TMS34020 C compiler and code-generation
tools for **VAX/VMS, VAX/Ultrix, VAX System V, Apollo Domain/IX and
AEGIS, Sun-3, Sun-4/SunOS and Macintosh/MPW** — not just MS-DOS/OS/2.
* **No public dump of those host versions is known.** Public archives
(bitsavers, archive.org, the `tms34010guy` SDK mirror, Macintosh
Garden/Repository) contain the **DOS** and **OS/2** binaries and the
manuals that describe the other hosts, but not the Sun/VMS/Apollo/Mac
tapes or diskettes.
* The only non-DOS binaries actually in hand are the **1990 OS/2 r5.01**
tools already in `tools/tms34010-sdk/` (NE executables; see
`reference/tms34010-sdk.md`).
So: the ports existed and are documented; the media appear to be lost
from public view, though private tapes are known to exist (see Leads).
## 1. Hosts TI supported
Evidence is from the installation chapters and the tools overview of the
two C compiler manuals, plus the 1990 Third-Party Guide's description of
Code Generation Tools r4.00.
| host | evidence | distribution medium |
|---|---|---|
| IBM-PC / TI-PC, PC/MS-DOS | 1986 guide §2.1; 1988 guide §2.1 | 5.25" diskettes |
| VAX/VMS | 1986 guide §2.2; 1988 guide §2.2 | 1600 bpi VMS BACKUP tape, volume `gspc`, save set `gspc.bck`, plus `setup.com` |
| VAX/Ultrix, VAX/UNIX System V | 1986 guide §2.3; 1988 guide §2.3 | 1600 bpi `tar` tape (`tar vx`), tools `gspcpp`, `gspcc`, `gspcg` |
| Apollo Domain/IX, Apollo AEGIS | 1988 guide §1/§2.3 | same `tar` tape (must install under Domain/IX, run under AEGIS) |
| Sun-3 (SunOS) | 1988 guide §1/§2.3 | same `tar` tape |
| Sun-4/SunOS | 1990 Third-Party Guide, TI Code Generation Tools r4.00 | not stated |
| Macintosh/MPW | 1988 guide §2.4 | 800K 3.5" diskette with `Tools/`, `Includes/`, `Libraries/` |
| OS/2 1.x | 1990 r5.01 NE binaries (in hand) | 5.25"/3.5" diskettes |
The 1988 guide's own list (p. 1-3) is: PC-DOS, TI-PC MS-DOS, VAX/VMS,
VAX/Ultrix, Apollo Domain/IX, Apollo AEGIS, Sun-3 Unix, Macintosh/MPW.
The 1990 Third-Party Guide (p. 29) says r4.00 is available for
"PC/MS-DOS, VAX/VMS, VAX/ULTRIX, SUN-3 and SUN-4/O.S, Macintosh/MPW and
Apollo/UNEX System V."
## 2. How to recognise a surviving copy
These strings/names are distinctive enough to search an old tape or disk
image for:
* `testc34.c`, `testc34.cmp`, `testc34.asm` — the compiler self-test
shipped on every C compiler tape/diskette.
* `gspc.bck` and `setup.com` — VMS BACKUP save set and symbol setup
command file. The VMS tape was made on VMS 4.5, 1600 bpi.
* `gspcpp`, `gspcc`, `gspcg`, `gspa`, `gsplnk`, `gspar`, `gsprom` —
UNIX spellings have no extension; VMS versions are `*.exe`.
* `Tools/`, `Includes/`, `Libraries/` folders on an 800K Mac diskette.
## 3. What is actually preserved
| item | where | notes |
|---|---|---|
| 1985 DOS assembly package v1.04 | `tools/tms34010-sdk/1987-05 TMS34010 SDK/` | DOS disk images |
| 1987 DOS Simulator/C/ASM tools v2.00 | same | DOS disk image; the set used for the byte-exact round trip |
| 1990 OS/2 Code Generation Tools r5.01 | `tools/tms34010-sdk/1990-11 TMS340 Family SDK/` | NE/OS2 binaries; **the only preserved non-DOS build** |
| 1990 OS/2 debugger r5.00, graphics library, TIGA SDK | same | DOS-hosted except the code-gen tools |
| 1990 DOS floppy images (`TMS340_Compiler.zip`) | bitsavers / archive.org | DOS, duplicate of the above lineage |
| 1986 C Compiler User's Guide | this directory | covers DOS, VAX/VMS, VAX/Ultrix, VAX System V |
| 1988 C Compiler Reference Guide | this directory | covers the full host list incl. Apollo, Sun-3, Mac/MPW |
| 1990 Third-Party Guide (4th ed.) | this directory | confirms r4.00 host list; third-party compilers |
| SPVS002C production-data datasheet | this directory | scanned; part-number/tools catalogue pages |
| GCC/G++ 2.5.8 TMS34010 port (1994) | `tools/tms34010-gcc-akpm/` | compiler source; `build-cc1.sh` rebuilds a working `cc1` on 32-bit Linux; Morton's `as34`/`ld34` are ported separately in `tools/as34/` |
| ported `as34`/`ld34`/`dis34` | `tools/as34/` | 64-bit Linux port of Morton's binutils, with byte-exact test against the GSPA payload |
`farnell.txt` is empty because that PDF is image-only (no text layer);
`ref1986.txt` and `ref1988.txt` are OCR text from archive.org;
`thirdparty1990.txt` is extracted from the PDF.
## 4. Third-party compilers that ran on those hosts
The 1990 Third-Party Guide is useful if a TI-hosted build never turns up:
* **Unidot, Inc.** — TMS34010 C compiler and assembler/linker/archiver.
Available **in source form for MS-DOS, DEC VAX under VMS, and most Unix
systems**; binary form only for MS-DOS. (p. 209)
* **GLH Ltd.** — GCC-based 340 compilers for Unix workstations. (p. 82)
* **Signature Software MC34010** — macro assembler, linker and job
controller for the **Apple Macintosh** (not a C compiler). (p. 208)
* **Andrew Morton's GCC/G++ 2.5.8 port (1994)** — not a commercial
product, but a real Unix-hosted GCC target for the TMS34010. The
compiler source is saved in `tools/tms34010-gcc-akpm/`, where
`build-cc1.sh` now rebuilds a working `cc1` on modern 32-bit Linux;
Morton's `as34` assembler, `ld34` linker and `dis34` disassembler are
ported and tested in `tools/as34/`.
## 5. Leads and dead ends
* **Best lead:** a `test-drb`/cctalk post titled "Wanted: TI TMS340x0
development system" reports someone holding a **QIC60/QIC150 tape of
the TI 34010 development software for SunOS** (not Solaris), remembered
to include the C compiler. The list archive is private, so this is a
person-to-person lead, not a download.
* `tms34020.uav.nl` and the archived uav.nl asset tree host the manuals
only; `TMS340_Compiler.zip`/`TMS340_Compiler_unpacked.zip` on bitsavers
are 1990 **DOS** floppy images.
* archive.org full-text/software search returns **0** TMS340 software
items; the TMS340 items are all manuals.
* The `tms34010guy/tms34010-sdk` GitHub tree contains only DOS images and
the 1990 OS/2 zips (verified against the full git tree).
* Macintosh Garden / Macintosh Repository searches for TMS340/TIGA find
nothing relevant.
* bitsavers' `/bits/TI/` tree has no TMS340 software, only 990/Explorer.
Absence of a public dump is not proof that none survives: these were
low-volume OEM tapes, and the manuals above are the best identification
guide for anyone who finds one.
## 6. Sources
* 1986 TMS34010 C Compiler User's Guide (SPVU005):
<https://archive.org/details/bitsavers_tiTMS340xxilerUsersGuide_4615125>
* 1988 TMS34010 C Compiler Reference Guide (SPVU005A):
<https://archive.org/details/bitsavers_tiTMS340xxferenceGuide1988_4803971>
(also <https://uav.nl/assets/tms34020/TMS34010_C_Compiler_Reference_Guide_1988.pdf>)
* 1990 TMS340 Third-Party Guide, 4th ed.:
<https://kguttag.com/wp-content/uploads/2023/07/1990-340-Family-THIRD-PARTY-GUIDE-4th-edition.pdf>
* SPVS002C production data (Farnell mirror):
<https://www.farnell.com/datasheets/84292.pdf>
* bitsavers TMS340xx tree:
<https://www.mirrorservice.org/sites/www.bitsavers.org/components/ti/TMS340xx/>
+7
View File
@@ -0,0 +1,7 @@
6e68ca635dc4a890aebfa8c2a8c10f4388b879a1df3455cb6797a1423de34d69 1986_TI_TMS34010_C_Compiler_Users_Guide.pdf
78357c3c9a861a0d19425c3936886dbd62759894a8d7ee1485e03bbe5b2f9e5e 1990_TMS340_Third_Party_Guide_4th.pdf
d760ab2e9192b5b9886a6c9ec2f2163d508796be1fd3153a40c9fee2c015ec41 SPVS002C_TMS34010_production_data.pdf
bf9a9b912044e11184cecaacddedd24e6f2e48365a8be56fb3989d0842bae8a9 TMS34010_C_Compiler_Reference_Guide_1988.pdf
85cd0bd51ebd0eef9d7407b763b9df911fbfe71ae90a465f6c84f110d7c6c160 ref1986.txt
6f9182f27033ada8752885d1a2f5ea833268e9aeb239355e9366f6988fa1841d ref1988.txt
1b3712f6c8af65c64fd8b1bb41fbf5b393d78dce5c36006abb4e37eed5d952a5 thirdparty1990.txt
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+1
View File
@@ -0,0 +1 @@
build/
+150
View File
@@ -0,0 +1,150 @@
# Andrew Morton's GCC 2.5.8 TMS34010 compiler (1994)
The **compiler half** of Andrew Morton's Unix-hosted TMS34010 toolchain,
recovered from `http://www.zip.com.au/~akpm/gsptools.html` via the Wayback
Machine (snapshot `20080210052433`).
This is **not** TI's compiler. It is a real GCC/G++ 2.5.8 port to the
TMS34010, and the only saved non-DOS TMS34010 C compiler found so far.
## Files
| file | contents |
|---|---|
| `gspcc-2.5.8-tms34010.tar.gz` | GNU C/C++ 2.5.8 source with the TMS34010 port: `34010.h`, `tm.h`, `md`, `dm.c`, `akpm.c`, `akpmflags.c` |
| `cc1-port.patch` | the source fixes needed to build `cc1` with a modern 32-bit host GCC |
| `build-cc1.sh` | extract + patch + build `gcc34` (`cc1`) |
| `test-cc1.sh` | compile a C sample, assemble/link with `tools/as34`, disassemble |
The original was an uncompressed tar with a `.tar.gz` name; it is gzipped
here. The SHA-256 is in `SHA256SUMS`.
## The other half is already in this repo
Morton's **`as34` assembler, `ld34` linker and `dis34` disassembler** are
already ported to 64-bit Linux, patched for modern C/flex, and tested in
`tools/as34/`. That directory's `build.sh` fetches the companion
`gsp.tar.gz` (SHA-256 `efff8e59…f9ef46`) and applies `as34-port.patch`.
That same `gsp.tar.gz` also contains the compiler's runtime and a working
example, extracted by `build.sh` to `tools/as34/build/src/gsp/`:
* `lib/crt0.g` — C startup (sets `SP`, `CONTROL`, calls `_crtInit`/`_main`)
* `lib/libc`, `lib/libg`, `lib/libk` — C/C++ runtime and graphics/kernel libs
* `rom/rommain.cc` → `rom/rommain.g` → `rom/rrom.H00`/`rrom.L00` — the proof
build (see below)
* `app/`, `tests/`, `rom/`
So this directory only vendors the missing compiler source.
## Building cc1 on a modern host (verified)
`build-cc1.sh` rebuilds the compiler proper (`gcc34` = `cc1`) from the
tarball with the 32-bit host compiler:
```sh
tools/tms34010-gcc-akpm/build-cc1.sh
# -> build/src/gspcc/gcc34
```
Verified on Debian 12 / GCC 14.2.0: the result is a 32-bit x86 ELF
(`gcc34: ELF 32-bit LSB pie executable ... for GNU/Linux 3.2.0`) and
reports `GNU C version 2.5.8 (TMS34010)`.
`test-cc1.sh` compiles a three-function C sample, assembles it with the
ported `tools/as34`, links with `ld34`, extracts the text and disassembles
it:
```
PASS: cc1 -> as34 -> ld34 -> 78 bytes
8defc28ed0f90c2797f5d1d2fed0ebe2 sample.bin
```
The resulting code is real TMS34010 (register-argument ABI, `a14`/`fp`
frame, `rets`, recursive `callr` + `mpys`).
### What had to be fixed
| issue | root cause | fix |
|---|---|---|
| `No rule to make target 'cc1'` | GNU make prefers Morton's lower-case `makefile`, which has different targets | use `make -f makefile gcc34` |
| `TARGET_REGPARM undeclared` | `34010.h` has a broken `#ifndef AKPM_REGPARM` branch | build with Morton's own defines, especially `-DAKPM_REGPARM -DAKPM_RETS` (his `makefile` already has them) |
| `MAX_RECOG_OPERANDS undeclared` | first failed build left an empty `insn-config.h`; make then thought it was up to date | always start from a fresh extract (or `make clean`) |
| `genconfig: not found` | 1990s shell found programs in `.`; modern shells do not | `PATH="$PWD:$PATH"` |
| `gvarargs.h`: expected specifiers before `...` | the old `va_dcl`/`__builtin_va_alist` GCC extension is gone | modern shim in `gvarargs.h`: `va_alist` → `...`, `va_start` → `__builtin_va_start(ap, 0)` |
| `conflicting types for 'build'/'gen_rtx'/...` | old-style `f ()` declaration vs new `f (...)` definition | declare the varargs functions as `(...)` in `tree.h`, `expr.h`, `rtl.h`, `output.h`, `combine.c`, `genattrtab.c` |
| host byte order | archived `config.h` is for big-endian Sun-3 | comment out `HOST_WORDS_BIG_ENDIAN` and build 32-bit (`-m32`) |
| modern compiler defaults | old GCC source is K&R C with tentative definitions | `-std=gnu89 -fcommon` |
The patch is `cc1-port.patch`; it is applied to a fresh tarball by
`build-cc1.sh`. It does not depend on the configure-generated `Makefile`.
### Current limits
* `gcc34` is **cc1 only**. It has no driver and no preprocessor: it accepts
preprocessed input, or simple C with no directives. For real sources run
the host `cpp -P` first, or build GCC 2.5.8's `cccp`/driver separately.
* `cc1plus` (`g++34`) is not built here. The first blocker is the old
`obstack.h` `obstack_ptr_grow` macro (`lvalue required as increment
operand` in `cp-decl.c` on GCC 14), plus the same varargs/prototype
treatment; the C++ front end was not pursued.
* Output is Morton `.g` assembly → fixed `as34`/`ld34`, not TI COFF.
* Morton's register-argument ABI is enabled (`-DAKPM_REGPARM`); this
matches the archived `rommain.g` and the prebuilt runtime.
* The host build is 32-bit; `gcc -m32` and 32-bit libc are required.
## Does it produce real binaries?
Yes — the example artifacts in `tools/as34/build/src/gsp/rom/` show the full
pipeline:
* `rommain.cc` is a substantial C++ program (SCC serial setup, timers,
latches, C++ classes; mangled names such as `_flash__Fi`).
* `rommain.g` is the GCC-generated TMS34010 assembly, with `.stabs`,
prologues/epilogues, `calla`, `mmtm`, `rets`.
* `rrom.H00` + `rrom.L00` are the final 32 KB high/low EPROM pair (64 KB of
code+data). Interleaving them and running
`tools/smart34010/dis34 -E rrom.L00 rrom.H00` gives valid code: reset
vector, `setf 16,1,0` / `setf 32,0,1`, `CONTROL` setup, `calla` calls —
matching `lib/crt0.g`.
* The ROM contains compiled `rommain.cc` logic: `movk 3,a0` /
`movi 0xc1,a1` / `call a4` is `WR(3, BM_BITS(11000001))` from
`initSCC()`, and strings such as `%x is circular`, `hello, world` and
`jumping to 0x%x` appear in the image.
Caveats:
* It does **not** emit TI COFF. `as34`/`ld34` use Morton's own link format
(`LINKMAGIC 0x3abf782e`, bit-address flag); `romsplit` turns that into
EPROM high/low files. `ld34/coff.c` is dead code.
* The runtime is for Morton's GSP board: `crt0.g` sets `SP=0xfffffb00`,
programs `CONTROL`, calls `_crtInit` then `_main`. A VT1200 port needs its
own startup and memory layout.
* The archived `config.h` is for a **big-endian Sun-3/m68k host**
(`HOST_WORDS_BIG_ENDIAN`), and the tarball contains no prebuilt `cc1` or
`gcc34`. `build-cc1.sh` now rebuilds `cc1` on 32-bit Linux using
`cc1-port.patch`; see “Building cc1 on a modern host” above.
* TMS34010 only, not TMS34020.
## What Morton changed in GCC
From his own notes:
* GCC assumes a byte is the smallest addressable unit. On the GSP a pointer
is a **bit** address, so every pointer addend must be multiplied by eight.
He patched the places where GCC assumes
`(int)(ptr + i) == (int)ptr + i`; grep the tree for `AKPM`, `34010` and
`GSP` to find them.
* The compiler assumes **FS0 = 5** (32-bit accesses) and **FS1 = 4**
(16-bit accesses); `crt0.g` sets the corresponding `setf` values.
* He added an `interrupt` function qualifier that saves all machine state
so a vector can point directly at the C function.
* The port shares the m68k configuration skeleton; `34010.h` started from
the Sun 68000/68020 header, and `tm.h` still carries m68k-era `ASM_SPEC`
text that a modern driver would need to replace.
## Licence
The GNU parts are GPLv2 (see `gspcc/COPYING`). Morton's own additions carry
no explicit licence header; treat the archive as historical reference
material.
+1
View File
@@ -0,0 +1 @@
f7c847064cc9c686f77e1f4c8f5a8c0f646b5172862f7c8308b7c8e3fa8a9fe8 gspcc-2.5.8-tms34010.tar.gz
+46
View File
@@ -0,0 +1,46 @@
#!/bin/sh
# Build Morton's GCC 2.5.8 TMS34010 cc1 (gcc34) on a modern x86-64 host.
#
# tools/tms34010-gcc-akpm/build-cc1.sh
# CC1_BUILD_DIR=/tmp/cc1 JOBS=4 tools/tms34010-gcc-akpm/build-cc1.sh
#
# Requires a 32-bit host compiler (gcc -m32) and its libc. The result is
# src/gspcc/gcc34 — the compiler proper (cc1), not a driver or preprocessor.
set -eu
here=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
builddir=${CC1_BUILD_DIR:-"$here/build"}
tarball="$here/gspcc-2.5.8-tms34010.tar.gz"
sha=f7c847064cc9c686f77e1f4c8f5a8c0f646b5172862f7c8308b7c8e3fa8a9fe8
hostcc=${HOST_CC:-gcc}
echo "$sha $tarball" | sha256sum -c -
mkdir -p "$builddir"
if ! printf 'int main(void){return 0;}\n' | "$hostcc" -m32 -x c - -o "$builddir/probe" 2>/dev/null; then
echo "error: $hostcc cannot build 32-bit binaries (-m32)" >&2
echo "install the 32-bit libc/headers (e.g. gcc-multilib on Debian)" >&2
exit 1
fi
rm -rf "$builddir/src"
mkdir -p "$builddir/src"
tar xzf "$tarball" -C "$builddir/src"
cd "$builddir/src/gspcc"
patch -p1 < "$here/cc1-port.patch"
# Keep Morton's 1993 pre-generated parsers; modern bison would regenerate them.
for f in c-parse.c c-parse.h cp-parse.c; do
[ -e "$f" ] && touch "$f"
done
export PATH="$PWD:$PATH"
make -f makefile -j"${JOBS:-1}" gcc34 \
CC="$hostcc -m32 -std=gnu89 -fcommon -O0 -g" \
XCFLAGS="-w -fno-strict-aliasing"
echo
echo "built: $PWD/gcc34"
file "$PWD/gcc34" || true
"$PWD/gcc34" -version 2>&1 | head -1 || true
+112
View File
@@ -0,0 +1,112 @@
--- a/config.h
+++ b/config.h
@@ -33,7 +33,7 @@
#define HOST_BITS_PER_LONG 32
#define HOST_BITS_PER_LONGLONG 64
-#define HOST_WORDS_BIG_ENDIAN
+/* #undef HOST_WORDS_BIG_ENDIAN (x86 host) */
/* target machine dependencies.
tm.h is a symbolic link to the actual target specific file. */
--- a/gvarargs.h
+++ b/gvarargs.h
@@ -1,3 +1,18 @@
+/* Modern-GCC shim: the 1990s va_dcl / __builtin_va_alist extension is gone.
+ All uses in this tree are "f (va_alist) va_dcl" with no named parameter,
+ so map them to a C99 variadic function and use the builtins. */
+#if defined(__GNUC__) && __GNUC__ >= 3
+#ifndef _VARARGS_H
+#define _VARARGS_H
+#define va_alist ...
+#define va_dcl
+#define va_list __builtin_va_list
+#define __gnuc_va_list __builtin_va_list
+#define va_start(AP) __builtin_va_start(AP, 0)
+#define va_end(AP) __builtin_va_end(AP)
+#define va_arg(AP, TYPE) __builtin_va_arg(AP, TYPE)
+#endif
+#else
#ifndef __GNUC__
/* Use the system's macros with the system's compiler. */
#include <varargs.h>
@@ -174,3 +189,5 @@
#endif
#endif /* __GNUC__ */
+
+#endif /* modern GCC shim */
--- a/genattrtab.c
+++ b/genattrtab.c
@@ -359,7 +359,7 @@
static rtx attr_rtx PROTO((enum rtx_code, ...));
static char *attr_printf PROTO((int, char *, ...));
#else
-static rtx attr_rtx ();
+static rtx attr_rtx (...);
static char *attr_printf ();
#endif
--- a/tree.h
+++ b/tree.h
@@ -1066,9 +1066,9 @@
extern tree build_nt PROTO((enum tree_code, ...));
extern tree build_parse_node PROTO((enum tree_code, ...));
#else
-extern tree build ();
-extern tree build_nt ();
-extern tree build_parse_node ();
+extern tree build (...);
+extern tree build_nt (...);
+extern tree build_parse_node (...);
#endif
extern tree build_int_2_wide PROTO((HOST_WIDE_INT, HOST_WIDE_INT));
--- a/expr.h
+++ b/expr.h
@@ -625,8 +625,8 @@
/* Emit library call. These cannot have accurate prototypes since they have
a variable number of args. */
-extern void emit_library_call ();
-extern rtx emit_library_call_value ();
+extern void emit_library_call (...);
+extern rtx emit_library_call_value (...);
/* Expand an assignment that stores the value of FROM into TO. */
extern rtx expand_assignment PROTO((tree, tree, int, int));
--- a/rtl.h
+++ b/rtl.h
@@ -653,8 +653,8 @@
#else
extern rtx bc_gen_rtx ();
-extern rtx gen_rtx ();
-extern rtvec gen_rtvec ();
+extern rtx gen_rtx (...);
+extern rtvec gen_rtvec (...);
#endif
#ifdef BUFSIZ /* stdio.h has been included */
--- a/output.h
+++ b/output.h
@@ -32,7 +32,7 @@
/* Output a string of assembler code, substituting numbers, strings
and fixed syntactic prefixes. */
-extern void asm_fprintf ();
+extern void asm_fprintf (...);
/* Print an integer constant expression in assembler syntax.
Addition and subtraction are the only arithmetic
--- a/combine.c
+++ b/combine.c
@@ -391,7 +391,7 @@
rtx, int));
static int recog_for_combine PROTO((rtx *, rtx, rtx *));
static rtx gen_lowpart_for_combine PROTO((enum machine_mode, rtx));
-static rtx gen_rtx_combine (); /* This is varargs. */
+static rtx gen_rtx_combine (...); /* This is varargs. */
static rtx gen_binary PROTO((enum rtx_code, enum machine_mode,
rtx, rtx));
static rtx gen_unary PROTO((enum rtx_code, enum machine_mode, rtx));
Binary file not shown.
+57
View File
@@ -0,0 +1,57 @@
#!/bin/sh
# Smoke-test the rebuilt cc1: C -> TMS34010 assembly -> as34 -> ld34 -> raw
# binary -> dis34.
#
# tools/tms34010-gcc-akpm/test-cc1.sh
#
# Requires tools/as34 to have been built (tools/as34/build.sh).
set -eu
here=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
builddir=${CC1_BUILD_DIR:-"$here/build"}
cc1="$builddir/src/gspcc/gcc34"
as34=${AS34:-"$here/../as34/build/src/gsp/binutils/as34/as34"}
ld34=${LD34:-"$here/../as34/build/src/gsp/binutils/ld34/ld34"}
extract="$here/../as34/extract.py"
dis34="$here/../smart34010/dis34"
for f in "$cc1" "$as34" "$ld34" "$extract" "$dis34"; do
[ -e "$f" ] || { echo "missing $f" >&2; exit 1; }
done
work="$builddir/work-cc1"
rm -rf "$work"
mkdir -p "$work"
cd "$work"
cat > sample.c <<'EOF'
int add(int a, int b) { return a + b; }
int sum(int *p, int n)
{
int s = 0;
while (n--)
s += *p++;
return s;
}
int fact(int n) { return n < 2 ? 1 : n * fact(n - 1); }
EOF
"$cc1" -quiet -O -o sample.g sample.c
"$as34" sample.g
"$ld34" -c -T 1800000 -e_add sample.go -o sample.out -m sample.map
python3 "$extract" sample.out sample.bin
"$dis34" -l sample.bin > sample.dis
if ! grep -Eq 'add[[:space:]]+a1, a0' sample.dis; then
echo "FAIL: expected 'add a1,a0' in add()" >&2
cat sample.dis >&2
exit 1
fi
if ! grep -Eq 'mpys' sample.dis; then
echo "FAIL: expected 'mpys' in fact()" >&2
exit 1
fi
echo "PASS: cc1 -> as34 -> ld34 -> $(wc -c < sample.bin) bytes"
md5sum sample.bin
echo "disassembly: $work/sample.dis"