vouillon / opam-android-repository Goto Github PK
View Code? Open in Web Editor NEWAndroid cross-compiler: package descriptions for OPAM
Android cross-compiler: package descriptions for OPAM
Hello,
I'm derived arm-lwt from your repository, but I trying to cross-compile it by other suite (Yocto's arm-oe-linux-gnueabi).
I see the following error:
- + /mnt/opam/4.02.1/bin/arm-oe-linux-gnueabi-ocamlfind ocamlc -ccopt -I/usr/include -ccopt -I/usr/include -ccopt -Isrc/unix -c src/unix/lwt_unix_stubs.c
- cc1: warning: include location "/usr/include" is unsafe for cross-compilation [-Wpoison-system-directories]
- In file included from /usr/include/netdb.h:27:0,
- from src/unix/lwt_unix_stubs.c:70:
- /usr/include/netinet/in.h:536:21: error: field 'ipi6_addr' has incomplete type
- struct in6_addr ipi6_addr; /* src/dst IPv6 address */
- ^~~~~~~~~
- /usr/include/netinet/in.h:543:25: error: field 'ip6m_addr' has incomplete type
- struct sockaddr_in6 ip6m_addr; /* dst address including zone ID */
- ^~~~~~~~~
- In file included from src/unix/lwt_unix_stubs.c:97:0:
- src/unix/lwt_unix_unix.c:192:23: error: field 's_inet6' has incomplete type
- struct sockaddr_in6 s_inet6;
- ^~~~~~~
- In file included from src/unix/lwt_unix_stubs.c:97:0:
- src/unix/lwt_unix_unix.c: In function 'alloc_one_addr6':
- src/unix/lwt_unix_unix.c:1727:19: error: storage size of 'addr' isn't known
- struct in6_addr addr;
- ^~~~
- src/unix/lwt_unix_unix.c:1727:19: warning: unused variable 'addr' [-Wunused-variable]
- src/unix/lwt_unix_unix.c:1730:1: warning: control reaches end of non-void function [-Wreturn-type]
- }
- ^
- Command exited with code 2.
Setting environment variables CC,LD and CPP to point to correct programs with "--sysroot=..." has ho effect for setup.ml.
How can I set something like "--sysroot=..."option for gcc in opam file (i.e. sa setup.ml's command line argument) or maybe in ocamlfind arguments?
Also, setting environment variables CC,LD and CPP to point to correct programs with added "--sysroot=..." has ho effect for arm-lwt's setup.ml.
I.e. I see in config output:
- bytecomp_c_compiler: ................................. gcc -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -fPIC
- native_c_compiler: ................................... gcc -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT
Is it right, that in your environment with NDK, gcc uses "--sysroot=..." to correctly cross compile stubs?
Can you point me to some way how you solved such problems with stubs?
I recommend putting in the Readme that installing ia32-libs can help with installing some of the OPAM packages in this repository on 64-bit Ubuntu installations. The compilation was failing with a "libz.so.1 not found" error before I installed ia32-libs.
Seems like base-threads is missing in the repository. Is it intended?
I was able to build shared objects for ARM architecture. I use the following commands (sort of):
ocamlfind -toolchain android ocamlopt -c prog.ml
ocamlfind -toolchain android ocamlopt -o libprog-jni.so -shared prog.o prog-jni.c
I pack libprog-jni.so in *.apk and Dalvik loads it and everything is fine.
However, I can't build the object for x86 CPU because my system is AMD64.
Is it possible to do using your tool?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.