Required changes to support QNX8 for aarch64le - #1602
Conversation
…functions. Signed-off-by: Erlend Ese <erlendese@gmail.com>
|
@eresgit Just tried this and it doesn't build for me. What are the required build commands? |
|
I could get it to build using only these changes diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a4854c2..4e52956 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -80,6 +80,7 @@ elseif(UNIX)
set(LIBS_SYSTEM compat pthread)
elseif(CMAKE_SYSTEM_NAME MATCHES "QNX")
set(LIBS_SYSTEM c socket)
+ add_definitions(-D_QNX_SOURCE)
else()
set(LIBS_SYSTEM c pthread)
endif()
diff --git a/src/SHA1.c b/src/SHA1.c
index 5c4c349..c0928dd 100644
--- a/src/SHA1.c
+++ b/src/SHA1.c
@@ -16,6 +16,12 @@
#include "SHA1.h"
+#if defined(__QNXNTO__)
+#include <gulliver.h>
+#define be32toh(x) ENDIAN_BE32(x)
+#define htobe32(x) ENDIAN_BE32(x)
+#endif
+
#if !defined(OPENSSL)
#if defined(_WIN32)
#pragma comment(lib, "crypt32.lib")
diff --git a/src/Socket.h b/src/Socket.h
index 396b2a6..f1d7128 100644
--- a/src/Socket.h
+++ b/src/Socket.h
@@ -62,8 +62,10 @@
#include <arpa/inet.h>
#include <netdb.h>
#ifdef __QNXNTO__
+#ifndef AI_ADDRCONFIG
#define AI_ADDRCONFIG 0
#endif
+#endif
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 32ccbf8..c08f431 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -15,6 +15,10 @@ elseif(UNIX)
set(LIBS_SYSTEM c dl pthread)
elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
set(LIBS_SYSTEM compat pthread)
+
+ elseif(CMAKE_SYSTEM_NAME MATCHES "QNX")
+ set(LIBS_SYSTEM c socket)
+ add_definitions(-D_QNX_SOURCE)
else()
set(LIBS_SYSTEM c pthread)
endif() |
@jclsn I used cmake to cross compile in windows for aarch64le by setting up a qnx-toolchain.cmake file: I used a batch script that sets up environment variables and then calls qnxsdp-env.bat provided by QNX, and then a cmake batch script: Hope that helps! |
Looks like your CMakeLists.txt is not updated, it's missing -DGULLIVER |
Yeah, but it built for me anyway. Not sure why the cmake -DCMAKE_SYSTEM_NAME=QNX -B build -S .
cmake --build buildI do have a custom setup script though that directly builds with gcc instead of using qcc, because qcc isn't able to generate a |
We should make sure that the patch builds with the standard Makefile or CMake approach instead of relying on custom toolchains. |
The toolchain is from QNX and hardly custom: |
Make sure to call the QNX environment scripts in your system before building