Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004841OCamlOCaml generalpublic2009-07-25 16:202009-09-13 18:50
Reportervouillon 
Assigned Toxleroy 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSMac OS XOS Version
Product Version3.11.1 
Target VersionFixed in Version3.11.2+dev 
Summary0004841: Cannot make callbacks from C code when using the -output-obj option under Mac OS X
DescriptionWe use the -output-obj option when compiling the Mac OS UI of Unison. With Ocaml 3.11.1, we get the following error when linking the final binary:
  Undefined symbols:
     "_caml_apply2", referenced from:
         _caml_callback2_exn in libasmrun.a(i386.o)
     "_caml_apply3", referenced from:
         _caml_callback3_exn in libasmrun.a(i386.o)

Indeed, the symbols caml_apply2 and caml_apply3 are local:
    > nm u-b.o | grep apply2
    000024b0 t _caml_apply2
(File u-b.o is the result of linking the Ocaml code using the "-output-obj" option.)

Apparently, this is a consequence of using "private_extern" rather than "glob" (bug 0004960):
        .text
        .align 4
        .private_extern _caml_apply2
_caml_apply2:
        subl $12, %esp
        [...]

We have tried to use the "-keep_private_externs" of ld as a workaround: it is supposed to prevent the private external symbols from becoming local. But this does not seem to make any difference.
TagsNo tags attached.
Attached Files

- Relationships
parent of 0004878closed Cannot make callbacks from C code when using the -output-obj option under Mac OS X (other solution of 0004841) 
has duplicate 0004860closedxleroy 3.11.1 fails to link mixed C/Ocaml program which 3.11.0 can link on OS X 

-  Notes
(0005078)
xleroy (administrator)
2009-09-13 18:50

Fixed in 3.11 bugfix CVS branch (by not emitting .private_extern declarations if -output-obj is active). Will go in 3.11.2.

- Issue History
Date Modified Username Field Change
2009-07-25 16:20 vouillon New Issue
2009-09-13 18:41 xleroy Status new => assigned
2009-09-13 18:41 xleroy Assigned To => xleroy
2009-09-13 18:42 xleroy Relationship added has duplicate 0004860
2009-09-13 18:50 xleroy Note Added: 0005078
2009-09-13 18:50 xleroy Status assigned => closed
2009-09-13 18:50 xleroy Resolution open => fixed
2009-09-13 18:50 xleroy Fixed in Version => 3.11.2+dev
2010-04-18 15:00 xleroy Relationship added parent of 0004878


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker