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

OS X Intel dmg for 3.11.1 installs ocaml which doesn't work on OS X 10.6 #4861

Closed
vicuna opened this issue Sep 8, 2009 · 4 comments
Closed
Assignees
Labels

Comments

@vicuna
Copy link

vicuna commented Sep 8, 2009

Original bug ID: 4861
Reporter: @johnwhitington
Assigned to: @damiendoligez
Status: closed (set by @damiendoligez on 2010-05-12T13:54:59Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.11.1
Fixed in version: 3.11.2
Category: ~DO NOT USE (was: OCaml general)

Bug description

Installing the standard intel dmg for 3.11.1 from caml.inria.fr, and compiling a simple file:

feast:~ john$ ocamlopt -c a.ml
/var/folders/Wn/Wntolm9pFXGlJQS2eW4HfE+++TI/-Tmp-/camlasm42597e.s:25:32-bit absolute addressing is not supported for x86-64
/var/folders/Wn/Wntolm9pFXGlJQS2eW4HfE+++TI/-Tmp-/camlasm42597e.s:25:cannot do signed 4 byte relocation
/var/folders/Wn/Wntolm9pFXGlJQS2eW4HfE+++TI/-Tmp-/camlasm42597e.s:52:unknown section type: non_lazy_symbol_pointers
/var/folders/Wn/Wntolm9pFXGlJQS2eW4HfE+++TI/-Tmp-/camlasm42597e.s:52:Rest of line ignored. 1st junk character valued 32 ( ).
File "a.ml", line 1, characters 0-1:
Error: Assembler error, input left in file /var/folders/Wn/Wntolm9pFXGlJQS2eW4HfE+++TI/-Tmp-/camlasm42597e.s

I'm not sure if this was expected or not, but am reporting for completeness.

@vicuna
Copy link
Author

vicuna commented Sep 13, 2009

Comment author: @xavierleroy

Could it be that under 10.6 gcc defaults to 64-bit mode, while under 10.5 it defaults to 32-bit mode? We'll have to figure this out. In the meantime, recompilation from sources is advised. Configure either with -cc "gcc -m32" or "gcc -m64" to make sure that you get the mode (32 or 64 bits) that you want.

@vicuna
Copy link
Author

vicuna commented Sep 14, 2009

Comment author: @johnwhitington

Unfortunately, ./configure -cc "gcc -m32" won't compile:

gcc -c -DSYS_macosx -o i386.o i386.S ||
{ echo "If your assembler produced syntax errors, it is probably unhappy with the"; echo "preprocessor. Check your assembler, or try producing i386.o by hand."; exit 2; }
i386.S:95:32-bit absolute addressing is not supported for x86-64
i386.S:95:cannot do signed 4 byte relocation
i386.S:97:32-bit absolute addressing is not supported for x86-64
i386.S:97:cannot do signed 4 byte relocation
i386.S:100:suffix or operands invalid for `push'

-cc "gcc -m64" works fine.

(the ./configure for gcc -m32):

Configuration for the bytecode compiler:
C compiler used........... gcc -m32
options for compiling..... -fno-defer-pop -no-cpp-precomp -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT
options for linking....... -lcurses -lpthread
shared libraries are supported
options for compiling..... -fno-defer-pop -no-cpp-precomp -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT
command for building...... gcc -m32 -bundle -flat_namespace -undefined suppress -read_only_relocs suppress -o lib.so /a/path objs
Configuration for the native-code compiler:
hardware architecture..... i386
OS variant................ macosx
C compiler used........... gcc -m32
options for compiling..... -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT
options for linking.......
assembler ................ as
preprocessed assembler ... gcc -c
profiling with gprof ..... supported
Source-level replay debugger: supported
Additional libraries supported:
unix str num dynlink bigarray systhreads threads graph dbm labltk
Configuration for the "num" library:
target architecture ...... ia32 (asm level 2)
Configuration for the "graph" library:
options for compiling .... -I/usr/X11R6/include
options for linking ...... -L/usr/X11R6/lib -lX11
Configuration for the "labltk" library:
use tcl/tk version ....... 8.5
options for compiling ....
options for linking ...... -ltk8.5 -ltcl8.5
(This is with 3.11.0, since 3.11.1 doesn't work, as discussed elsewhere).

@vicuna
Copy link
Author

vicuna commented Sep 24, 2009

Comment author: @xclerc

It seems that -cc "gg -m32" is not enough to build in 32-bit mode,
you need to also pass -as "as -arch i386" -aspp "gcc -m32 -c" to
the ./configure script.

Tested successfully with 3.11.1 on MacOS X 10.6.1 running on top of an Intel Core 2 Duo.

On this configuration, a bare ./configure with no argument is enough to build a 64-bit version.

@vicuna
Copy link
Author

vicuna commented Sep 25, 2009

Comment author: @johnwhitington

Yes, this works for me too. Thanks.

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