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

ocamlopt -shared failed on Mac OS X 10.6 Snow Leopard (x86_64) #4867

Closed
vicuna opened this issue Sep 17, 2009 · 1 comment
Closed

ocamlopt -shared failed on Mac OS X 10.6 Snow Leopard (x86_64) #4867

vicuna opened this issue Sep 17, 2009 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Sep 17, 2009

Original bug ID: 4867
Reporter: kiyoshi
Status: closed (set by @xavierleroy on 2011-05-29T10:20:16Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 3.11.1
Fixed in version: 3.11.2+dev
Category: ~DO NOT USE (was: OCaml general)
Related to: #4760 #6900

Bug description

ocamlopt -shared failed as follows:

$ cat test.ml
type t = A | B | C | D

let f x = match x with A -> "A" | B -> "B" | C -> "C" | D -> "D"
$ ocamlopt -version
3.11.1
$ ocamlopt -shared test.ml -o dummy
ld: warning: -read_only_relocs cannot be used with x86_64
ld: pointer in read-only segment not allowed in slidable image, used in .L105 from test.o
collect2: ld returned 1 exit status
File "caml_startup", line 1, characters 0-1:
Error: Error during linking
$ ocamlopt -s -shared test.ml -o dummy
ld: warning: -read_only_relocs cannot be used with x86_64
ld: pointer in read-only segment not allowed in slidable image, used in .L105 from test.o
collect2: ld returned 1 exit status
File "caml_startup", line 1, characters 0-1:
Error: Error during linking
$ cat test.s
--- snip ---
_camlTest__f_67:
.L104:
sarq $1, %rax
leaq .L105(%rip), %r11
jmp *(%r11, %rax, 8)
.const
.align 3
.L105: .quad .L103
.quad .L102
.quad .L101
.quad .L100
--- snip ---
$

A dirty patch attached to this report will resolve this problem.

Additional information

$ uname -v
Darwin Kernel Version 10.0.0: Fri Jul 31 22:47:34 PDT 2009; root:xnu-1456.1.25~1/RELEASE_I386
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.6.1
BuildVersion: 10B504
$ port version
Version: 1.8.0
$ port list installed | grep ocaml
ocaml @3.11.1 private/ocaml
$

File attachments

@vicuna
Copy link
Author

vicuna commented Sep 18, 2009

Comment author: @xavierleroy

Thanks for the patch, which was a very useful starting point. Tentative fix in 3.11 release branch, will go in 3.11.2. The warning about "-read_only_relocs" doesn't show up on my Mac OS 10.5 test machine; we'll address it when testing under 10.6 soon.

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

1 participant