Hi, I want to compile sqlite3mc's amalgamation source on qnx-700, with different build configurations include aarch64, armv7a.
The toolchain of qnx-700 runs on a x86_64 Linux host.
If I run it with the provided C compiler:
sqlite3mc_amalgamation.c:250248:20: fatal error: endian.h: No such file or directory
#include <endian.h>
Although there is: /opt/qnx700/target/qnx7/usr/include/io-pkt/machine/endian.h, I'm not sure whether it's the needed one.
In the end I just commented this #include <endian.h> line.
Then there is error about platform-specific entropy function.
The cross-compiler defines feature macro __QNX__, if I run it with command "/opt/qnx700/host/linux/x86_64/usr/bin/qcc", it has also __unix__ defined. If I run it with the command /opt/qnx700/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-gcc-5.4.0, no __unix__ is defined.
So I copied the following two functions from __unix__ section:
static size_t read_urandom(void* buf, size_t n)
static size_t entropy(void* buf, size_t n)
And put them to a new __QNX__ conditional compiling section, the compilation and linking of a simplistic main() function seemed OK, and the output program could be run on target board and call sqlite3_libversion(), version string is printed.
My question is:
is this entropy() function the only platform specific stuff to deal with?
If I don't care about the encryption strength, can I just call C standard rand() and fill the data in the buffer for entropy?
Some doc on the qnx-700:
https://www.qnx.com/developers/docs/7.0.0/#com.qnx.doc.neutrino.lib_ref/topic/manifests.html
Though the toolchain seems not freely available.
Hi, I want to compile sqlite3mc's amalgamation source on qnx-700, with different build configurations include
aarch64,armv7a.The toolchain of qnx-700 runs on a x86_64 Linux host.
If I run it with the provided C compiler:
Although there is:
/opt/qnx700/target/qnx7/usr/include/io-pkt/machine/endian.h, I'm not sure whether it's the needed one.In the end I just commented this
#include <endian.h>line.Then there is error about platform-specific
entropyfunction.The cross-compiler defines feature macro
__QNX__, if I run it with command "/opt/qnx700/host/linux/x86_64/usr/bin/qcc", it has also__unix__defined. If I run it with the command/opt/qnx700/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-gcc-5.4.0, no__unix__is defined.So I copied the following two functions from
__unix__section:static size_t read_urandom(void* buf, size_t n)static size_t entropy(void* buf, size_t n)And put them to a new
__QNX__conditional compiling section, the compilation and linking of a simplisticmain()function seemed OK, and the output program could be run on target board and callsqlite3_libversion(), version string is printed.My question is:
is this
entropy()function the only platform specific stuff to deal with?If I don't care about the encryption strength, can I just call C standard
rand()and fill the data in the buffer forentropy?Some doc on the qnx-700:
https://www.qnx.com/developers/docs/7.0.0/#com.qnx.doc.neutrino.lib_ref/topic/manifests.html
Though the toolchain seems not freely available.