Skip to content

CC/370 v1.5.0

Choose a tag to compare

@github-actions github-actions released this 07 Oct 16:02
· 39 commits to main since this release
6512eef

CC/370 (cc370) 1.5.0 is a minor release of the host-native MVS 3.8j toolchain. It adds -mrent, which makes the compiler report every writable variable a reentrant module would keep in itself, fixes file-scope compound literals, and tightens three corners of ld370. It is a drop-in for 1.4.x: the LIBC/370 (libc370) requirement is unchanged (>= 2.3.0; install.sh picks the newest that fits, 2.6.2 today), and code compiled without the new option is byte-identical to 1.4.0 apart from the version in the eyecatcher and the compound-literal fix below (measured over 824 sources at -O1 and 602 at -Os). The manuals now come with the release as PDFs.

Read this first: what a caller can see

  • ld370 --pack refuses what it used to drop. An input file named before --pack (a member as well as an object or archive), -l or -L anywhere on the command, and a --pack naming no member now end with rc 2, naming the operand. Before, the operand was left out of the library without a word and the command ended rc 0. Put --pack first: ld370 --pack A.iebcopy B.iebcopy -o lib -xmit.
  • The member name from -o is the one that is checked. It is the base name up to the first period: -o app.v1.lm now gives member APP instead of being refused as APP.V1. A name that is not a valid member name is still refused (rc 2) when a transport file or a load map needs it, never cut.
  • -mrent is new and off by default. Pass it to every source of a module you link with --rent; each non-const definition then warns with -Wwritable-data (an error under -Werror, -Wno-writable-data turns it off).

New: -mrent and -Wwritable-data

A reentrant load module is one copy shared by every task that runs it, and CC/370 keeps a C static or global in the module itself. Under -mrent the compiler warns for each such definition that is not const:

prog.c:3: warning: 'count' is writable data in a reentrant module [-Wwritable-data]
prog.c:5: warning: a compound literal is writable data in a reentrant module [-Wwritable-data]

const char *p is writable (the pointer is), char *const p is not; extern declarations and string literals are not reported, and __stklen is exempt. The check covers the sources compiled with the option; code taken from a library by automatic library call is not checked.

Fixed: before and now

1.4.0 1.5.0
static int *p = (int[]){1, 2}; DC A(@V2) with no @V2; the assembler stops with rc 8 the literal is emitted
ld370 X.iebcopy --pack Y.iebcopy -o lib -xmit rc 0, library holds Y only rc 2, names X.iebcopy
ld370 -o MAIN main.o -xmit --pack links MAIN instead of packing rc 2
ld370 -o app.v1.lm … -xmit rc 2, "'APP.V1' is not a valid member name" member APP
ld370 --help on a bare member "packs at entry 0" --entry NAME, else @@CRT0, from its CESD

Install

curl -fsSL https://github.com/mvslovers/cc370/releases/latest/download/install.sh | sh

With Homebrew (macOS, Linux):

brew trust mvslovers/tap            # once
brew install mvslovers/tap/cc370    # cc370 and, as its dependency, libc370
brew upgrade mvslovers/tap/cc370    # an existing install

Or the pieces, all listed in SHA256SUMS:

file what
cc370-1.5.0-{darwin,linux}-{amd64,arm64}.tar.gz the toolchain for one host
cc370_1.5.0_{amd64,arm64}.deb Debian/Ubuntu; depends on libc370-dev (>= 2.3.0)
cc370-1.5.0.{x86_64,aarch64}.rpm Fedora/RHEL; requires libc370-devel the same way
install.sh the installer above
ml01-0001-0.pdf CC/370 User's Guide, Draft edition, for 1.5.0
ml01-0002-0.pdf CC/370 Command Reference, Draft edition, for 1.5.0

The manuals are built from the tagged sources. The Draft edition still lacks the figures whose output is captured on MVS, and some captured examples still show the version strings of 1.4.0.

Full changelog

Added

  • -mrent and -Wwritable-data: writable data in a reentrant module is
    reported by the compiler
    (#885). A reentrant load module is one copy
    shared by every task that LINKs it, and CC/370 keeps a C static or a
    non-const global in the module itself, so such a definition is shared,
    unsynchronised state. Under -mrent every definition that is not const
    warns -- globals, static at file scope and inside functions, and
    const volatile objects; extern declarations and string literals do
    not, and -fwritable-strings warns once. const char *p is writable (the
    pointer is), char *const p is not. __stklen is exempt: the startup
    reads it as the stack size. The warning is on by default under -mrent,
    an error under -Werror, and -Wno-writable-data switches it off.
    -mrent changes no generated code. A build tool that marks a module
    RENT passes -mrent to every translation unit of it; code that automatic
    library call pulls from a library was compiled without it and is not
    checked.
  • The manuals are attached to the release. ML01-0001 (User's Guide)
    and ML01-0002 (Command Reference), Draft edition, are built from the
    tagged sources and attached as ml01-0001-0.pdf and ml01-0002-0.pdf,
    listed in SHA256SUMS (#893).

Fixed

  • A compound literal at file scope is emitted (#890). static int *p = (int[]){1, 2}; compiled to DC A(@V2) with no @V2, and as370 stopped
    with rc 8, at every optimization level. The literal is a deferred static
    that is written only when a reference marks its name, and the back end
    renamed static variables to @Vn without moving the name the reference
    is checked against. It now does; the same mechanism had also dropped a
    static table referenced only from a global pointer under
    -funit-at-a-time. Under -mrent a writable compound literal warns as
    "a compound literal", and a const one, such as (const int[]){1, 2},
    does not. Nothing else in the generated code changes: 824 sources across
    the ecosystem compile to identical output.
  • ld370 --help no longer says a bare member packs at entry 0 (#896).
    Since 1.3.0 (#850) a bare member's entry is --entry NAME, else @@CRT0,
    looked up in its CESD; the manual page already said so.
  • ld370 checks the member name it writes (#895). The name from -o
    is the base name up to the first period (-o upcase.lm is UPCASE), but
    the validity check cut at the last one: -o app.v1.lm -xmit was refused
    as APP.V1 although APP would have been written. Both now use the same
    name. A name longer than eight characters is still refused, not cut.
  • ld370 --pack refuses a link input instead of dropping it (#894). An
    object deck or archive named before --pack went into the link list,
    which a pack ignores: ld370 A.iebcopy --pack B.iebcopy -o lib -xmit
    ended with rc 0 and a library holding B alone. --pack with no member
    linked the other operands instead, and -l/-L were searched for
    nothing. Every operand after --pack is a member; any input file named
    before --pack (a member to pack included), -l or -L on a --pack
    command, and a --pack naming no member, are now refused with rc 2,
    naming the operand, and nothing is written.
  • install.sh names a failed GitHub API call instead of reporting "no
    LIBC/370 release fits"
    (#879). When the API's rate limit (60 requests an
    hour per address) was used up, the release list came back empty and the
    script said that no LIBC/370 fitted, installed CC/370 alone and ended with
    rc 0. Since 1.4.0 a link needs LIBC/370, so the result was a compiler that
    could not link, with a message pointing at the wrong problem. Every API
    call is now checked: a rate limit is named with the minutes until it
    resets, any other HTTP status and a failed connection likewise, and the
    script ends with rc 1. "No release fits" is kept for a list that was read
    and had no match. GITHUB_TOKEN is sent to the API when set, and a
    release list on one line is read whole. Run by zsh (| zsh), the script
    skipped LIBC/370 with the same message, because zsh does not split words;
    it now turns that on. The 1.4.0 release's install.sh asset was replaced
    with this version on 2026-10-05 (and its SHA256SUMS line with it); the
    toolchain archives and packages were not changed.