Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad architecture detection on Mac OS X 64bit #4863

Closed
vicuna opened this issue Sep 9, 2009 · 7 comments
Closed

Bad architecture detection on Mac OS X 64bit #4863

vicuna opened this issue Sep 9, 2009 · 7 comments
Assignees
Labels

Comments

@vicuna
Copy link

vicuna commented Sep 9, 2009

Original bug ID: 4863
Reporter: @mmottl
Assigned to: @damiendoligez
Status: closed (set by @xavierleroy on 2017-02-16T14:14:10Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.11.1
Fixed in version: 3.13.0+dev
Category: ~DO NOT USE (was: OCaml general)
Has duplicate: #5379
Related to: #6900
Monitored by: avaron Ashish_Agarwal jm pascal_cuoq

Bug description

Calling 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:

i[3456]86--darwin)

instead of this one:

-apple-darwin)

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 ./dlllacaml_stubs.so 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

File attachments

@vicuna
Copy link
Author

vicuna commented Dec 15, 2010

Comment author: Ashish_Agarwal

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
i386

$ uname -m
i386

@vicuna
Copy link
Author

vicuna commented May 17, 2011

Comment author: @damiendoligez

This problem disappeared because Apple's latest linkers don't support -read-only-relocs, so we had to stop using it.

@vicuna
Copy link
Author

vicuna commented Jul 22, 2011

Comment author: @mmottl

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

@vicuna
Copy link
Author

vicuna commented Aug 3, 2011

Comment author: @damiendoligez

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.

@vicuna
Copy link
Author

vicuna commented Aug 3, 2011

Comment author: @mmottl

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.

@vicuna
Copy link
Author

vicuna commented Sep 12, 2011

Comment author: @xclerc

The proposed patch works for me on Lion with a Core 2 Duo.

@vicuna
Copy link
Author

vicuna commented Dec 12, 2011

Comment author: @protz

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants