Skip to content

Default DCC to LWTOOLS#25

Open
DrPitre wants to merge 8 commits into
Deek:masterfrom
DrPitre:codex/dcc-lwtools-default
Open

Default DCC to LWTOOLS#25
DrPitre wants to merge 8 commits into
Deek:masterfrom
DrPitre:codex/dcc-lwtools-default

Conversation

@DrPitre
Copy link
Copy Markdown

@DrPitre DrPitre commented May 20, 2026

Summary

This updates DCC so the modern native build and default target workflow use LWTOOLS (lwasm/lwlink) instead of the legacy rma/rlink toolchain, while retaining a compatibility switch for the old flow.

The main behavioral change is that dcc file.c now emits LWTOOLS-compatible objects and links through lwlink by default. Existing -L usage remains accepted, and -R selects the legacy RMA/RLINK path.

What Changed

  • Make LWTOOLS the default DCC backend

    • Add lwasm/lwlink driver support in dcc.
    • Pass -L through to dcc68 when generating LWTOOLS-compatible assembly.
    • Treat .o inputs as already-built LWTOOLS objects instead of assuming .r intermediates.
    • Link internally through lwlink so package makefiles can call dcc end-to-end.
    • Preserve legacy RMA/RLINK via new -R option.
  • Improve native macOS buildability

    • Clean up host compiler assumptions and prototypes across the compiler tools.
    • Fix Unix system() status handling so failed child commands are reported correctly.
    • Update GNUmakefiles and warning flags where needed for current clang/GNU make builds.
  • Add a localized macOS install script

    • New install-dcc-macos.sh builds and installs into $HOME/dcc by default.
    • Installs compiler binaries, definitions, help, startup object, and target libraries.
    • Keeps installation out of /usr/local unless the caller overrides PREFIX.
  • Build target libraries for the LWTOOLS path

    • Add GNUmakefiles for KLibc sub-libraries built with lwasm/lwar.
    • Update the RMA-to-LWTOOLS conversion flow.
    • Fix chmod/chown assembly issues exposed by LWTOOLS.
    • Add qsort() to libc.a for packages that expect it.

Compatibility Notes

  • dcc file.c now defaults to LWTOOLS output and linking.
  • dcc -L file.c still works and is effectively explicit-default mode.
  • dcc -R file.c requests the old RMA/RLINK flow.
  • .r assumptions are intentionally removed from the default path; .o is the default object suffix for LWTOOLS builds.

Validation Performed

  • Built the compiler tools natively on macOS with clang.
  • Installed into $HOME/dcc using the new install script.
  • Rebuilt and installed the LWTOOLS target libraries.
  • Used the installed dcc to build NitrOS-9 third-party packages including ed, uemacs, and uucpbb through the new default LWTOOLS flow.

Review Focus

The biggest area to review is the default backend flip in Source/Compiler/DCC/dcc.c: argument handling, suffix handling, and the link command construction. The KLibc build changes are intended to support that flow without requiring package makefiles to know about lwasm/lwlink directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant