REXX Language implementation
rxlink)The rxlink tool combines one or more assembled .rxbin modules into a linked image that keeps module boundaries while deduplicating compatible constant-pool leaves into one shared pool.
Use rxlink when you want to:
rxcpack / wrapped artifacts by removing duplicated pool entriesThis is now the normal native-packaging route for the shipped drivers too:
crexx, crxc, rxpp, and related wrapped tools link a deployable image
first and then pass that linked image to rxcpack.
rxlink is not a replacement for the VM loader. The output still contains multiple module records, and rxvm still performs the final runtime link/load work.
The linker writes a 003-format record stream:
RXBIN_RECORD_POOL_SHARED record containing the shared constant poolRXBIN_RECORD_MODULE_SHARED record per selected moduleEach shared-backed module keeps its own instruction stream, header values, and module name/description, but borrows constants from the shared pool.
Inputs are read as a record stream, so one input file may contain multiple module records. Module selection then happens in this order:
OMITINCLUDEROOTmainsrcfproc interface references, and interface relationships to pull in required providersSelectors match by:
.rxas removedinput_path::memberrxlink does not need all metadata equally:
proc_head is used to find procedures and detect mainexpose_head is used to discover imports and exportsmeta_head is scanned for META_INTERFACE and META_IMPLEMENTS so interface definitions and implementations pull each other insrcfproc selector strings so modules referenced only through runtime interface-factory lookup are still retainedThe linker preserves the metadata chain in output because the VM and tooling still consume it at runtime.
Leaf constants are deduplicated across selected modules when their serialized bytes match:
STRING_CONSTBINARY_CONSTDECIMAL_CONSTFLOAT_CONSTStructured constants are rewritten into the shared pool with all referenced offsets updated:
Current conservative strip support has two independent axes:
-sSTRIP SOURCE-iPRESERVE INLINE / STRIP INLINESTRIP SOURCE removes:
META_SRCMETA_FILEInline-body metadata is different from runtime contract metadata. It is useful
to libraries consumed by rxc, but it is not needed once a final linked image
has been built. rxlink therefore strips META_INLINE by default. Use -i or
PRESERVE INLINE only for diagnostic/tooling builds that need to inspect the
inline transport after linking.
It intentionally does not remove runtime contract metadata such as:
META_CLASSMETA_ATTRMETA_INTERFACEMETA_IMPLEMENTSMETA_MEMBERThat keeps interface/class dispatch and metadata-aware tooling behaviour stable while still removing the source text/file path payload that most affects linked image size.
Supported directives are:
INPUT pathROOT selectorINCLUDE selectorOMIT selectorOUTPUT pathMAP pathSTRIP SOURCESTRIP INLINEPRESERVE INLINEWhen changing rxlink, keep three layers of coverage in mind:
rxvm and rxbvmrxdas can still disassemble linked images, including stripped onesFor broader confidence, the runtime _opt path is now wired through linked
images in normal ctest coverage. For a focused rerun, use:
ctest -L linked_opt --output-on-failurecmake --build <build-dir> --target linked_opt_sweepBe conservative with stripping. If a proposed change removes more than META_SRC / META_FILE, verify both runtime contract lookup and metadata introspection in rxvm before assuming it is safe.