Comments (3)
So...
in stdlib/sys.mlp
, Sys.win32 is defined as external win32 : unit -> bool = "%ostype_win32"
.
As far as I understand, the compiler recognize %ostype_win32
and turns it into Primitive ((Pctconst Ostype_win32), 1)
(in bytecomp/translprim.ml
???? But why is it done in native compilation too then?) Anyway...
Then,
- the bytecode compiler translates this primitive back into calling the c function
caml_sys_const_ostype_win32(value unit)
which isVal_bool(0 == strcmp(OCAML_OS_TYPE,"Win32"))
as we want BUT - the native compiler optimizes this out (I'm not sure where of middle_end/simplify_primitives.ml, asmcomp/closure.ml or asmcomp/cmmgen.ml) into
const_of_bool (Sys.os_type = "Win32")
(or equivalent) and, as I already explained in several places including #122, because of the way cross compilation is achieve (we do basicallylinux-pc-ocamlrun mingw-w64-ocamlc
to call the compiler),Sys.os_type
"of the compiler" is the host os_type and not the target one!
Now the question becomes, why does it work in 64bits? :-D
from opam-cross-windows.
The plot thickens! Thanks for investigating.. Could this have to do with the fact that the 32 bit compiler is actually a 32 bit compiler inside a 64 bit host?
from opam-cross-windows.
I'm having the same problem with a recent build of ocaml-windows on 64 bit now.. I think I'll have to revert back to the old patches.
from opam-cross-windows.
Related Issues (20)
- Support for cross-compilation on x86 platform with target systems as 32-bit and 64-bit arm linux
- expat-windows no longer building HOT 2
- Include fileutils
- Cross-compiler has `ocamlc -config-var os_type` = `"%%OCAML_OS_TYPE%%"`
- Can not resolve symbols for libcamlrun.a(floats_b.o) HOT 4
- Building fails due to fno-common being the default in recent versions of gcc HOT 3
- `opam install ocaml-windows` fails with compilation error for `ocaml-windows64` HOT 4
- Supporting ocaml 4.12 HOT 11
- Graphics HOT 4
- Error on building ocaml-windows HOT 5
- Error while compiling HOT 4
- ocamlfind: [WARNING] Undefined toolchain: windows
- ppx_tools_versioned-windows is broken with 4.12.0 HOT 7
- adding repository to opam HOT 1
- flexdll.h not found error when running "ocaml install ocaml-windows" HOT 13
- OCaml-windows 4.12.0 no longer builds HOT 2
- Ocaml 5 support HOT 4
- uutf-windows
- Packaging library with 3rd party dependencies HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opam-cross-windows.