libzmq: ZeroMQ does not build for QNX 6.3 with CMake
Issue description
I am evaluating ZeroMQ for use with our embedded product, but we are constrained to running on QNX 6.3 (ancient) and building with GCC 3.3.5. I am cross-compiling the library on Windows using CMake within Qt Creator/MinGW. CMake generation succeeds, but compilation fails.
For example, ZeroMQ expects malloc() to be declared in <stdlib.h> but QNX declares it in <malloc.h>. This could be fixed with something like:
#ifdef __QNXNTO__
#include <malloc.h>
#endif
A similar conditional would correct the problem that QNX has <sys/poll.h> instead of <poll.h>.
Environment
- libzmq version: 4.3.1
- OS: Windows 7 x64 SP1
- QNX Momentics IDE 6.3.0 + Service Pack 2 provides the toolchain - GCC 3.3.5
- CMake 3.9.4
- Qt Creator 3.6.1 - kit: Desktop Qt 5.6.0 MinGW 32bit
Minimal test code / Steps to reproduce the issue
- It’s complicated since it requires custom CMake files that include setup for cross-compiling for QNX.
What’s the actual result? (include assertion message & call stack if applicable)
15:01:46: Running steps for project 3rdPartyResearch… 15:01:46: Starting: “C:\Projects\Qt\5.6.0\MingW\Tools\mingw492_32\bin\mingw32-make.exe” [ 0%] Building C object libzmq/CMakeFiles/objects.dir/src/tweetnacl.c.o [ 1%] Building CXX object libzmq/CMakeFiles/objects.dir/src/precompiled.cpp.o [ 1%] Building CXX object libzmq/CMakeFiles/objects.dir/src/address.cpp.o [ 1%] Building CXX object libzmq/CMakeFiles/objects.dir/src/client.cpp.o In file included from C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/socket_base.hpp:39, from C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/client.hpp:33, from C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/client.cpp:32: C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/blob.hpp: In constructor zmq::blob_t::blob_t(unsigned int): C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/blob.hpp:79: error: malloc undeclared (first use this function) C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/blob.hpp:79: error: (Each undeclared identifier is reported only once for each function it appears in.) C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/blob.hpp: In constructor zmq::blob_t::blob_t(const unsigned char*, unsigned int): C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/blob.hpp:89: error: malloc undeclared (first use this function) C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/blob.hpp: In member function void zmq::blob_t::set_deep_copy(const zmq::blob_t&): C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/blob.hpp:129: error: malloc undeclared (first use this function) C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/blob.hpp: In member function void zmq::blob_t::set(const unsigned char*, unsigned int): C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/blob.hpp:140: error: malloc undeclared (first use this function) C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/blob.hpp: In member function void zmq::blob_t::clear(): C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/blob.hpp:151: error: free undeclared (first use this function) C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/blob.hpp: In destructor zmq::blob_t::~blob_t(): C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/blob.hpp:160: error: free undeclared (first use this function) In file included from C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/poller.hpp:52, from C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/socket_base.hpp:41, from C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/client.hpp:33, from C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/client.cpp:32: C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/poll.hpp:43:18: poll.h: No such file or directory In file included from C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/poller.hpp:52, from C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/socket_base.hpp:41, from C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/client.hpp:33, from C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/client.cpp:32: C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/poll.hpp: At global scope: C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/poll.hpp:96: error: pollfd was not declared in this scope C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/poll.hpp:96: error: template argument 1 is invalid C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/poll.hpp:96: error: template argument 2 is invalid C:/Data/Workspaces/3rdPartyResearch/source/zeromq-4.3.1/src/poll.hpp:96: error: ISO C++ forbids declaration of pollset_t with no type cc: C:/QNX630/host/win32/x86/usr/lib/gcc-lib/i386-pc-nto-qnx6.3.0/3.3.5/cc1plus caught signal 1 libzmq\CMakeFiles\objects.dir\build.make:133: recipe for target ‘libzmq/CMakeFiles/objects.dir/src/client.cpp.o’ failed mingw32-make[2]: [libzmq/CMakeFiles/objects.dir/src/client.cpp.o] Error 1 CMakeFiles\Makefile2:128: recipe for target ‘libzmq/CMakeFiles/objects.dir/all’ failed mingw32-make[1]: [libzmq/CMakeFiles/objects.dir/all] Error 2 makefile:128: recipe for target ‘all’ failed mingw32-make: [all] Error 2 15:01:51: The process “C:\Projects\Qt\5.6.0\MingW\Tools\mingw492_32\bin\mingw32-make.exe” exited with code 2. Error while building/deploying project 3rdPartyResearch (kit: Desktop Qt 5.6.0 MinGW 32bit) When executing step “Make” 15:01:51: Elapsed time: 00:04.
What’s the expected result?
Code compiles without errors for QNX 6.3.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 54 (26 by maintainers)
Success! I now have 84 test executables returning a zero exit code (although many do that but don’t output any message indicating pass/fail or anything else). The final change was to ignore SIGPIPE just like MVS to prevent
test_spec_pushpull_tcp_push_multipart_atomic_drop_block()from terminating abnormally.