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
OCaml fails to build in 32 bits mode in a 64 bit system. #7679
Comments
Comment author: @dra27 For OCaml's Travis build, we just use |
Comment author: vlaviron I have a git worktree configured with exactly the same options, that I use for testing, and could compile 4.06 without errors. However, looking at the Makefiles and the doc for the ar command, it looks like you may have launched the compilation while a libasmrun.a from a 64-bit compilation was still present, which would be consistent with the error you get (the command used to create libasmrun.a adds and replaces objects, but does not remove the ones not replaced). |
Comment author: @ejgallego I'm gonna try again, thanks. But I originally found this error when creating an OPAM switch so the compilation state should have been clean. @dra, in fact I had looked at what travis does and I tried with |
Comment author: @ejgallego Waaah, so for some reason my OPAM used some stale compiler information :embarrased: in fact the original build seems to work now. Sorry for the noise, closing the issue. WRT to with ./configure -host i686-pc-linux-gnu : |
Comment author: @ejgallego Ummm, I can't modify the issue status it seems. Please, resolve as INVALID. |
Comment author: @xavierleroy Indeed, leftover files from an earlier (64-bit) compile explains the error. Still, we should erase ".a" files before reconstructing them with "ar rc". I'll look into this. Concerning "./configure -host i686-pc-linux-gnu", I'm pretty sure this is not enough to build a 32-bit version on a 64-bit host. Maybe it should be enough, but in the meantime please stick to the incantation given in INSTALL.adoc. |
Comment author: @dra27 Indeed - Travis replaces all the compiler packages with their 32-bit counterparts, which is why it works there. |
Comment author: @xavierleroy Pull request here: #1494 |
Comment author: @xavierleroy Pull request merged, will be in 4.07 |
Original bug ID: 7679
Reporter: @ejgallego
Assigned to: @gasche
Status: resolved (set by @gasche on 2017-11-28T17:23:49Z)
Resolution: not a bug
Priority: normal
Severity: major
Platform: Linux
OS: Ubuntu
OS Version: 17.04
Version: 4.06.0
Category: configure and build/install
Monitored by: @gasche
Bug description
Dear Ocaml devs,
trying to compile 4.06.0 in 32bit mode [so it can be used by js_of_ocaml] I hit this compilation problem:
./configure -with-debug-runtime -cc "gcc -m32" -as "as --32" -aspp "gcc -m32 -c" -host "i386-linux" -partialld "ld -r -melf_i386"
....
boot/ocamlrun ./ocamlopt -g -nostdlib -I stdlib -I otherlibs/dynlink -o ocamlc.opt compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlbytecomp.cmxa driver/main.cmx -cclib "-lm -ldl -lpthread "
stdlib/libasmrun.a(i386.o): In function
caml_system__code_begin': (.text+0x0): multiple definition of
caml_system__code_begin'stdlib/libasmrun.a(amd64.o):(.text+0x0): first defined here
....
/usr/bin/ld: i386:x86-64 architecture of input file `stdlib/libasmrun.a(amd64.o)' is incompatible with i386 output
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking
Makefile:883: recipe for target 'ocamlc.opt' failed
It could be well the case that I am doing something wrong, as I am using the configure line that worked for 4.05.0. 4.05.0 in 32 bits mode works ok in my system.
Steps to reproduce
The text was updated successfully, but these errors were encountered: