Skip to content

WITH_KEEP_UNIT_OBJECTS keeps unit objects only on a green link #1331

Closed

Description

@ehartford

src/compiler/Compilation.w compilation_execute_binary_link_plan: on a failed link it calls compilation_cleanup_build_products before the WITH_KEEP_UNIT_OBJECTS check, so the per-unit objects are deleted exactly when they are needed (an undefined or duplicate symbol across #681 codegen units).

Found while hunting the PR #1325 stage-2 link failure (_print__sema__..=16 undefined): the objects had to be captured by breaking in lldb at compilation_cleanup_build_products and copying them out.

Expected: with WITH_KEEP_UNIT_OBJECTS=1, a failed link leaves t.o and t.o.u<k>.o in place (and says where), so nm can name the definers and referencers directly.

Repro: WITH_KEEP_UNIT_OBJECTS=1 WITH_CODEGEN_UNITS=8 with build <program whose link fails> -o t leaves no objects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions