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
Do not install native-code executables when cross-compiling #6861
Comments
Comment author: @damiendoligez
I'm not sure I understand this. It makes a lot of sense to build them so the user can install them on the target, right? |
Comment author: @whitequark ocamlyacc, no. It is a tool designed to run alongside ocamlc, and ocamlc is not built to be installed on target in the case of a cross-compiler. ocamlrun{,d}, well, theoretically maybe yes. I don't ever envision building anything without -custom, but I can see why you'd want this for completeness. You could put the target-ocamlrun into lib/ocaml, next to libcamlrun.so. |
Still an issue. |
Still an issue. |
I think that @dra27 and @shindere and @EduardoRFS have been interested in cross-compilation. Personally I consider our build system unpalatable right now, so I avoid working on it when I can. |
When cross-compiling using make the build system it essentially is cross compiling the compiler to be executed in the target, so it's more like bootstrapping the compiler to a platform.
I also have this problem at |
Eduardo Rafael (2021/06/16 10:09 -0700):
When cross-compiling using make the build system it essentially is
cross compiling the compiler to be executed in the target,
I would have said on the host, no?
The compiler never runs on the target. Only the compiled programs and,
of course, the runtime.
Maybe a short term solution would be introducing a
`CROSS_COMPILE=true` flag on make, this would also allow to work
around the `checkstack` problem at
https://github.com/ocaml/ocaml/blob/trunk/Makefile#L982
I have a plan to integrate checkstack to configure. At some point the
build ysstme will probably have to know whether it is building a
cross-compiler or not, which is different from cross-compiling the
compiler in autoconf's terminology.
|
Original bug ID: 6861
Reporter: @whitequark
Assigned to: @shindere
Status: assigned (set by @damiendoligez on 2015-05-08T21:15:11Z)
Resolution: open
Priority: normal
Severity: minor
Version: 4.02.2+dev / +rc1
Category: configure and build/install
Tags: cross-compilation
Child of: #6266
Monitored by: @gasche
Bug description
The buildsystem builds a few executables, namely ocamlrun{,d} and ocamlyacc, which cannot be executed since they are built for the target, not host, architecture.
Since ocamlrun and ocamlyacc are a hard dependency for building a cross-compiler, they can be simply symlinked to whatever was used to build the cross-compiler.
ocamlrund may not be present and it is also not a dependency of anything in OCaml ecosystem, so it can be just not installed. It probably makes sense to not build these when cross-compiling as well.
The text was updated successfully, but these errors were encountered: