Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004863OCaml~DO NOT USE (was: OCaml general)public2009-09-10 01:472017-02-16 15:14
Assigned Todoligez 
PlatformOSOS Version
Product Version3.11.1 
Target VersionFixed in Version3.13.0+dev 
Summary0004863: Bad architecture detection on Mac OS X 64bit
DescriptionCalling ocamlmklib on Mac OS X 64bit leads to a linker warning:

  ld: warning: -read_only_relocs cannot be used with x86_64

This seems to be due to the configure file in the OCaml distribution taking this branch:


instead of this one:


This, again, is a consequence of config.guess using "uname -p": the latter returns i386 even though the machine is clearly running on x86_64. It seems that using "uname -m" would work here, though I am not sure whether it would do so elsewhere.

Without the "-read_only_relocs suppress" option, which is passed to the C-compiler, the warning will disappear.

Here is the full verbose output of such an ocamlmklib invocation:

ocamlmklib -verbose -L/sw/lib -o lacaml_stubs impl_c.o utils_c.o vec2_S_c.o vec2_D_c.o vec2_C_c.o vec2_Z_c.o mat4_S_c.o mat4_D_c.o mat4_C_c.o mat4_Z_c.o impl4_S_c.o impl4_D_c.o impl4_C_c.o impl4_Z_c.o impl2_S_c.o impl2_D_c.o impl2_C_c.o impl2_Z_c.o exp10.o -framework vecLib
+ gcc-4.2 -m64 -bundle -flat_namespace -undefined suppress -read_only_relocs suppress -o ./ exp10.o impl2_Z_c.o impl2_C_c.o impl2_D_c.o impl2_S_c.o impl4_Z_c.o impl4_C_c.o impl4_D_c.o impl4_S_c.o mat4_Z_c.o mat4_C_c.o mat4_D_c.o mat4_S_c.o vec2_Z_c.o vec2_C_c.o vec2_D_c.o vec2_S_c.o utils_c.o impl_c.o -L/Users/mmottl/local/godi/lib -L/sw/lib -framework vecLib
ld: warning: -read_only_relocs cannot be used with x86_64
+ ar rc ./liblacaml_stubs.a exp10.o impl2_Z_c.o impl2_C_c.o impl2_D_c.o impl2_S_c.o impl4_Z_c.o impl4_C_c.o impl4_D_c.o impl4_S_c.o mat4_Z_c.o mat4_C_c.o mat4_D_c.o mat4_S_c.o vec2_Z_c.o vec2_C_c.o vec2_D_c.o vec2_S_c.o utils_c.o impl_c.o; ranlib ./liblacaml_stubs.a
TagsNo tags attached.
Attached Filespatch file icon ocaml-3.12.1-macos-10.7.patch [^] (1,326 bytes) 2011-08-03 17:41 [Show Content]

- Relationships
has duplicate 0005379closed Native dynlink support check broken with OS X Lion 
related to 0006900assignedshindere Native code compiler for 32-bit OS X 

-  Notes
Ashish_Agarwal (reporter)
2010-12-15 21:26

This issue appears to have been fixed in OCaml 3.12. The problem persists in 3.11, but note the suggestion of using uname -m does not work for me; it also returns i386.

$ uname -a
Darwin Ashish.local 10.5.0 Darwin Kernel Version 10.5.0: Fri Nov 5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386 i386

$ uname -p

$ uname -m
doligez (administrator)
2011-05-17 16:59

This problem disappeared because Apple's latest linkers don't support -read-only-relocs, so we had to stop using it.
mottl (reporter)
2011-07-22 05:06

It seems this problem is present (again?) in OCaml 3.12.1:

  /Users/mmottl/local/godi312//bin/ocamlmklib -o lib/bin_prot lib/common_stubs.o lib/write_stubs.o lib/read_stubs.o
  ld: warning: -read_only_relocs cannot be used with x86_64
doligez (administrator)
2011-08-03 17:43

Markus, are you using Mac OS 10.7 (Lion) ? It is not detected correctly by the configure script of 3.12.1.
I'm attaching a (untested) patch to make it work with Lion.
mottl (reporter)
2011-08-03 20:11

Damien, yes, I'm using Lion. I unfortunately cannot easily test that the error above went away with the patch, but it at least seems that the architecture is recognized correctly now by configure. The patch will probably work.
xclerc (reporter)
2011-09-12 13:35

The proposed patch works for me on Lion with a Core 2 Duo.
protz (manager)
2011-12-12 15:04

As far as I can tell, svn revision 11163 « configure correctly under Mac OS 10.7 Lion (darwin11) » (by Damien) fixes the issue, closing.

- Issue History
Date Modified Username Field Change
2009-09-10 01:47 mottl New Issue
2010-12-15 21:26 Ashish_Agarwal Note Added: 0005742
2011-05-17 16:59 doligez Note Added: 0005905
2011-05-17 16:59 doligez Status new => closed
2011-05-17 16:59 doligez Resolution open => fixed
2011-05-17 16:59 doligez Fixed in Version => 3.12.0
2011-07-22 05:06 mottl Note Added: 0006054
2011-07-22 05:06 mottl Status closed => feedback
2011-07-22 05:06 mottl Resolution fixed => reopened
2011-08-03 17:41 doligez File Added: ocaml-3.12.1-macos-10.7.patch
2011-08-03 17:43 doligez Note Added: 0006077
2011-08-03 20:11 mottl Note Added: 0006081
2011-09-12 13:35 xclerc Note Added: 0006122
2011-10-20 12:45 xclerc Relationship added has duplicate 0005379
2011-12-12 15:04 protz Note Added: 0006240
2011-12-12 15:04 protz Status feedback => resolved
2011-12-12 15:04 protz Fixed in Version 3.12.0 => 3.13.0+dev
2011-12-12 15:04 protz Resolution reopened => fixed
2011-12-12 15:04 protz Assigned To => doligez
2015-06-11 17:54 doligez Relationship added related to 0006900
2017-02-16 15:14 xleroy Status resolved => closed
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker