-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Compile on qnx-700 platform #54
Comments
I don't have access to QNX. It can well be that adjustments to SQLite3MC's code are necessary to support QNX.
Maybe this is a QNX version issue. According to the QNX 7.1 documentation the header file
No idea, whether the mentioned header file is the right one. If the header file is not available in QNX in the default search path of the compiler, but the code compiles without it, we should probably simply add #ifndef __QNX__
#include <endian.h>
#endif
Could you please try the following: Replace the line #elif defined(__linux__) || defined(__unix__) || defined(__APPLE__) by #elif defined(__linux__) || defined(__unix__) || defined(__APPLE__) || defined(__QNX__) I'm pretty sure that that should work.
Yes.
In principle, you could do that. However, you could also use the SQLite function void sqlite3_randomness(int N, void *P); At least on Unix-like platforms this function uses the same method as SQLite3MC uses as a fallback method. |
Commit 11a7462 applies the modifications I proposed. This should fix the issue. Closing ... reopen if necessary. |
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
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 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.
The text was updated successfully, but these errors were encountered: