Skip to content

Manifest "stdlib": false: match without a matching arm fails to link (undefined __mc_dtoa_core) #506

Closed

Description

@blacktrs

A match without a matching arm (the UnhandledMatchError path) in an application built with "stdlib": false fails to assemble: the emitted IR calls @manticore___mc_dtoa_core, which is never defined because the stdlib object is not linked and no prelude body is injected.

Reproduction (tests/aot/repro cannot express it: it needs a manifest build):

manticore.json:

{"applications":[{"name":"m","src":"s","output":"m.bin","entry":"s/m.php","stdlib":false}]}

s/m.php:

<?php
$x = 4;
echo match ($x) { 3 => "three" }, "\n";

bin/manticore build:

build: application 'm' (s -> m.bin)
build: undefined-function traps (3): __mc_json_err, addcslashes, strcmp
/tmp/manticore_buildobj_NNN.ll:11832:20: error: use of undefined value '@manticore___mc_dtoa_core'
 11832 |   %r111 = call i64 @manticore___mc_dtoa_core(i64 %r110, i64 1, i64 1)
1 error generated.
assemble: clang -c staged IR failed (rc=256)
build: assemble failed for m.bin

With an arm that always matches (default => ...) the same program builds and runs. php prints UnhandledMatchError for the original; with a default arm the output is three/other as expected.

Expected: a self-contained (stdlib: false) app links or defines every helper the codegen emits for match, or the build reports a clear error. Related: the preflight also lists traps for __mc_json_err, addcslashes, strcmp in this tiny app.

Activity

  1. added
    bug
    crash
    on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcrash

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions