Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007654OCamlcompiler driverpublic2017-10-07 16:482017-10-07 23:41
Reporterbcc32 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version4.04.2 
Target VersionFixed in Version4.05.0 
Summary0007654: Linker error when functor body contains constant false assertion
DescriptionConsider the following code:

    module Make (Int : sig val one : int end) = struct
      let () = assert false
      let two () = [Int.one + 1]
    end

    module M = Make (struct let one = 1 end)

    let _ = M.two ()

I get a linker error compiling this code using the native-code compiler.
Steps To ReproduceCompile with: `ocamlopt test.ml`
Additional InformationExpanded example here: https://gist.github.com/bcc32/e6f3aa69443ea253a6a0719c2748d2e1 [^]

Compiler error output follows:

Undefined symbols for architecture x86_64:
  "_camlTest__two_1202", referenced from:
      _camlTest__entry in test.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
File "caml_startup", line 1:
Error: Error during linking
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0018501)
bcc32 (reporter)
2017-10-07 16:49

I forgot to mention, this issue is resolved in 4.05.0, but appears in at least 4.04.2 and 4.03.0.
(0018504)
xleroy (administrator)
2017-10-07 17:18

Indeed this problem can't be reproduced in 4.05.0 nor in 4.06.0beta1. I think it is related to this series of bug fixes and improvements that went into 4.05: https://github.com/ocaml/ocaml/pull/983 [^]
(0018506)
xleroy (administrator)
2017-10-07 17:20

Maybe Alain Frisch (author of GPR#983) can confirm this problem is gone for good with GPR#983. In the meantime I mark it as resolved/fixed.
(0018510)
gasche (administrator)
2017-10-07 22:38
edited on: 2017-10-07 22:38

In fact the problem was fixed by Mark Shinwell in GPR#959, which describes precisely this issue:

  https://github.com/ocaml/ocaml/pull/959 [^]

(I didn't remember it but found it by bisection.)

(0018511)
bcc32 (reporter)
2017-10-07 23:41

Ah, seems to be exactly right! Thanks for the help.

- Issue History
Date Modified Username Field Change
2017-10-07 16:48 bcc32 New Issue
2017-10-07 16:49 bcc32 Note Added: 0018501
2017-10-07 17:18 xleroy Note Added: 0018504
2017-10-07 17:20 xleroy Note Added: 0018506
2017-10-07 17:20 xleroy Status new => resolved
2017-10-07 17:20 xleroy Resolution open => fixed
2017-10-07 17:20 xleroy Fixed in Version => 4.05.0
2017-10-07 22:38 gasche Note Added: 0018510
2017-10-07 22:38 gasche Note Edited: 0018510 View Revisions
2017-10-07 23:41 bcc32 Note Added: 0018511


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker