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
Compile a 32-bit version of OCaml on a 64-bit linux OS #5178
Comments
Comment author: @xavierleroy I ran into the same issue recently under Linux. Currently, some manual editing of the config/Makefile generated by configure is needed, which is not nice. At the very least, the wrong example should be removed from the INSTALL file. Even better would be to have a configure script that works in this case. |
Comment author: monate Here is the command I had to use to cross compile a 32 bits ocaml from an Ubuntu 64. /configure -cc "gcc -m32" -as "as --32" -aspp "gcc -m32 -c" -host i386-linux -partialld "ld -r -melf_i386" Then I have to run make world.opt twice as the first run ends up with../ocamlcomp.sh -pack -g camlp4/Camlp4Top/Top.cmo camlp4/Camlp4Top/Rprint.cmo -o camlp4/Camlp4Top.cmo
|
Comment author: hectorpal Hi. The problem still carry on on OCaml 4.00.1. The offending recommendation is in INSTALL. So, at least change the INSTALL. |
Comment author: @xavierleroy INSTALL file updated as suggested in 4.01 release branch (commit r13781) and in SVN trunk (commit r13782). |
Original bug ID: 5178
Reporter: nobelius
Status: closed (set by @xavierleroy on 2015-12-11T18:19:45Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.12.0
Target version: 4.00.2+dev
Fixed in version: 4.01.0+dev
Category: ~DO NOT USE (was: OCaml general)
Monitored by: brendan mehdi "Pascal Cuoq"
Bug description
I tried to compile a 32-bit version of OCaml because I suspect a performance loss with the 64-bit version.
I used the command line given as example in INSTALL file:
./configure -cc "gcc -m32" -as "as --32" -aspp "gcc -m32 -c"
and then "make world"
but I obtained the following error:
make[2]: Entering directory
/local/vmonfort/Downloads/ocaml-3.11.2/otherlibs/num' gcc -m32 -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -I../../byterun -O -fPIC -DBNG_ARCH_amd64 -DBNG_ASM_LEVEL=1 -c bng.c In file included from bng.c:24: bng_amd64.c: In function ‘bng_amd64_mult_add_digit’: bng_amd64.c:113: error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’ bng_amd64.c:113: error: ‘asm’ operand has impossible constraints make[2]: *** [bng.o] Error 1 make[2]: Leaving directory
/local/vmonfort/Downloads/ocaml-3.11.2/otherlibs/num'the configure script (with above-mentioned option line) was indicating the following information:
Configuration for the bytecode compiler:
C compiler used........... gcc -m32
options for compiling..... -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT
options for linking....... -Wl,-E -lm -ldl -lpthread
shared libraries are supported
options for compiling..... -fPIC -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT
command for building...... gcc -m32 -shared -o lib.so -Wl,-rpath,/a/path objs
Configuration for the native-code compiler:
hardware architecture..... amd64
OS variant................ linux
C compiler used........... gcc -m32
options for compiling..... -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT
options for linking....... -lm
assembler ................ as --32
preprocessed assembler ... gcc -m32 -c
native dynlink ........... true
profiling with gprof ..... supported
Source-level replay debugger: supported
Additional libraries supported:
unix str num dynlink bigarray systhreads threads graph
Configuration for the "num" library:
target architecture ...... amd64 (asm level 1)
Configuration for the "graph" library:
options for compiling ....
options for linking ...... -lX11
The "labltk" library: not supported
The text was updated successfully, but these errors were encountered: