Frama-C Bug Tracking System - Frama-C
View Issue Details
0002378Frama-Cptestspublic2018-06-18 16:482020-02-17 18:08
Assigned Tomaroneze 
PrioritynormalSeverityminorReproducibilityhave not tried
Platformbytecode-onlyOSOpenBSDOS Version6.3
Product Version 
Target VersionFixed in VersionFrama-C 20-Calcium 
Summary0002378: Bytecode only compilation fails when linking to stdlib
DescriptionCompiling bytecode only fails with this error:

ocamlfind ocamlc -I ptests -dtypes -vmthread -g -o bin/ptests.byte unix.cma threads.cma str.cma dynlink.cma ptests/ ptests/
File "ptests/", line 1:
Error: Required module `Uchar' is unavailable
Steps To ReproduceCompile OCaml >=4.03 without optimizing compilers.
Use this compiler to build frama-c
TagsNo tags attached.
Attached Files? patch-configure_in (1,400) 2019-02-24 23:55
? patch-Makefile (888) 2019-02-25 02:01
? patch-configure_in_2 (1,282) 2019-08-29 00:36
? patch-Makefile_2 (2,039) 2019-08-29 00:46
? patch-Makefile_3 (2,091) 2019-08-30 00:49

2019-02-24 23:58   
(Last edited: 2019-02-24 23:59)
I suspect the build error is caused by +vmthreads/stdlib.cma having a different ordering and set of modules than +stdlib.cma.
Since vmthreads are being deprecated anyway I would consider always building with system threads.
Alternatively, do at least prefer system threads even on bytecode builds as is done by the patch I just uploaded.

2019-08-27 22:06   
Please commit at least the configure patch.
There is a misunderstanding of what "native system threads" implies in the OCaml world.
Native system threads are available for native and for bytecode compilation and are the only available threading since vmthreads, which were only supported for bytecode, have been dropped.
2019-08-28 18:04   
I hadn't seen this issue before, so in March I applied a similar patch to the Makefile, which should have the same effect as yours, I think (and it should already be available in the latest Frama-C release, 19.0). But the configure patch has not been applied.

We don't currently have an OpenBSD VM to test it, but I tried applying the patch using my fork of Frama-C's Github repository ( If it looks good to you, we'll probably commit it soon.
2019-08-29 00:38   
Looks good to me. You might consider applying patch-configure_in_2 instead because it is simpler while yielding the same results. There is no difference in threading between byte- and nativecode anymore.
2019-08-29 00:47   
Now also updated to patch-Makefile_2 adding a fix to allow bytecode only installation.
2019-08-29 09:14   
Thanks a lot. I adapted a bit the patch Makefile_2 to make it work, and we will try to integrate it quickly. Concerning the threads detection, though, maybe it's better to completely remove the test from the configure, assuming native threads are always available.

Is there a deadline concerning OpenBSD package releases? In other words, would it be useful if the patches were integrated ASAP, or could it wait for the next Frama-C release (likely sometime in November/December)?
2019-08-29 09:54   
(Last edited: 2019-08-29 09:55)
I have no idea which platforms would run Frama-C without threads and therefore no idea whether they need thread-detection.

No need to hurry the release; we are patching Frama-C in our ports.
But it would be nice if we could stop maintaining the patches with the next Frama-C update.

2019-08-29 10:38   
The fact that vmthreads are deprecated in 4.08 (, with the suggestion to move to system threads regardless of the OS on which the application is run is in my opinion a good hint that assuming native thread support everywhere is not too far fetched.
2019-08-29 12:52   
According to threads are supported everywhere.
2019-08-30 00:50   
I'm afraid I forgot to test native code builds, which are broken by my Makefile patch. That's why I just uploaded a fixed 3rd version of the Makefile patch.
2019-09-12 17:44   
Changes have been merged internally and will be part of Frama-C 20.0 Calcium
2020-02-17 18:08   
Fixed in Frama-C 20.0 (Calcium).

Issue History
2018-06-18 16:48madroachNew Issue
2018-06-18 16:48madroachStatusnew => assigned
2018-06-18 16:48madroachAssigned To => virgile
2018-11-30 10:41signolesAssigned Tovirgile => bobot
2019-02-24 23:56madroachFile Added: patch-configure_in
2019-02-24 23:58madroachNote Added: 0006752
2019-02-24 23:59madroachNote Edited: 0006752bug_revision_view_page.php?bugnote_id=6752#r392
2019-02-25 02:01madroachFile Added: patch-Makefile
2019-08-27 22:06madroachNote Added: 0006856
2019-08-28 17:37maronezeAssigned Tobobot => maroneze
2019-08-28 18:04maronezeNote Added: 0006857
2019-08-29 00:36madroachFile Added: patch-configure_in_2
2019-08-29 00:38madroachNote Added: 0006858
2019-08-29 00:46madroachFile Added: patch-Makefile_2
2019-08-29 00:47madroachNote Added: 0006860
2019-08-29 09:14maronezeNote Added: 0006862
2019-08-29 09:54madroachNote Added: 0006863
2019-08-29 09:55madroachNote Edited: 0006863bug_revision_view_page.php?bugnote_id=6863#r416
2019-08-29 10:38virgileNote Added: 0006864
2019-08-29 12:52madroachNote Added: 0006865
2019-08-30 00:49madroachFile Added: patch-Makefile_3
2019-08-30 00:50madroachNote Added: 0006867
2019-09-12 17:44virgileNote Added: 0006869
2019-09-12 17:44virgileStatusassigned => resolved
2019-09-12 17:44virgileFixed in Version => Frama-C 20-Calcium
2019-09-12 17:44virgileResolutionopen => fixed
2020-02-17 18:08signolesStatusresolved => closed
2020-02-17 18:08signolesNote Added: 0006953