Skip to content

New mode where ocamlc doesn't check list of primitives #6845

@vicuna

Description

@vicuna

Original bug ID: 6845
Reporter: @alainfrisch
Assigned to: @damiendoligez
Status: closed (set by @xavierleroy on 2017-02-16T14:16:17Z)
Resolution: fixed
Priority: low
Severity: minor
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.02.2+dev / +rc1
Category: ~DO NOT USE (was: OCaml general)
Related to: #6693 #6733 #6779
Monitored by: @gasche @hcarty

Bug description

By default, ocamlc checks that all primitives used by the linked bytecode program are defined in the target runtime (the default list of primitives by default, an explicit list provided by the undocumented -use-prims option, or the list of primitives obtained from the -use-runtime). In -custom mode, no check is required, since a specific runtime with exactly the required primitives will be created (and the C compiler will complain if some primitives are not available).

For js_of_ocaml. it would make sense to have another mode, similar to -custom in that no check is done at link time, but without actually creating a custom runtime. The rationale is that the js_of_ocaml compiler will itself report warnings for missing primitives (and the program could even work with a missing primitive, if it is not actually called, or if the call is properly protected).

The current possible workarounds are either to create dummy C stubs to make ocamlc happy, or to rely on -use-prims (which requires to create the full list of primitives, the builtin ones + our custom primitives). In both cases, this is not very practical.

Proposal: -no-check-prims

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions