Skip to content
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

build libiceoryx_platform.so error for QNX #1013

Closed
qclzdh opened this issue Jan 11, 2022 · 4 comments · Fixed by #1019
Closed

build libiceoryx_platform.so error for QNX #1013

qclzdh opened this issue Jan 11, 2022 · 4 comments · Fixed by #1019
Assignees
Labels
bug Something isn't working

Comments

@qclzdh
Copy link

qclzdh commented Jan 11, 2022

Required information

Operating system:
E.g. Ubuntu 20.04 LTS

Compiler version:
aarch64-unknown-nto-qnx7.0.0-g++

Observed result or behaviour:

CMakeFiles/iceoryx_platform.dir/platform/qnx/source/socket.cpp.o: In function iox_bind(int, sockaddr const*, unsigned int)': socket.cpp:(.text+0x0): undefined reference to bind'
CMakeFiles/iceoryx_platform.dir/platform/qnx/source/socket.cpp.o: In function iox_socket(int, int, int)': socket.cpp:(.text+0x8): undefined reference to socket'
CMakeFiles/iceoryx_platform.dir/platform/qnx/source/socket.cpp.o: In function iox_setsockopt(int, int, int, void const*, unsigned int)': socket.cpp:(.text+0x10): undefined reference to setsockopt'
CMakeFiles/iceoryx_platform.dir/platform/qnx/source/socket.cpp.o: In function iox_sendto(int, void const*, unsigned long, int, sockaddr const*, unsigned int)': socket.cpp:(.text+0x18): undefined reference to sendto'
CMakeFiles/iceoryx_platform.dir/platform/qnx/source/socket.cpp.o: In function iox_recvfrom(int, void*, unsigned long, int, sockaddr*, unsigned int*)': socket.cpp:(.text+0x20): undefined reference to recvfrom'
CMakeFiles/iceoryx_platform.dir/platform/qnx/source/socket.cpp.o: In function iox_connect(int, sockaddr const*, unsigned int)': socket.cpp:(.text+0x28): undefined reference to connect'
collect2: error: ld returned 1 exit status
hoofs/CMakeFiles/iceoryx_platform.dir/build.make:173: recipe for target 'hoofs/libiceoryx_platform.so' failed
make[3]: *** [hoofs/libiceoryx_platform.so] Error 1
make[3]: Leaving directory '/home/qianchunlei/project/iceoryx/build'
CMakeFiles/Makefile2:165: recipe for target 'hoofs/CMakeFiles/iceoryx_platform.dir/all' failed
make[2]: *** [hoofs/CMakeFiles/iceoryx_platform.dir/all] Error 2
make[2]: Leaving directory '/home/qianchunlei/project/iceoryx/build'
CMakeFiles/Makefile2:172: recipe for target 'hoofs/CMakeFiles/iceoryx_platform.dir/rule' failed
make[1]: *** [hoofs/CMakeFiles/iceoryx_platform.dir/rule] Error 2
make[1]: Leaving directory '/home/qianchunlei/project/iceoryx/build'
Makefile:186: recipe for target 'iceoryx_platform' failed
make: *** [iceoryx_platform] Error 2

Expected result or behaviour:
no error

Conditions where it occurred / Performed steps:
build libiceoryx_platform.so on QNX

it looks like, link to libsocket is necessary under line https://github.com/eclipse-iceoryx/iceoryx/blob/master/iceoryx_hoofs/CMakeLists.txt#L233
target_link_libraries(iceoryx_platform
PRIVATE
socket
${ICEORYX_SANITIZER_FLAGS})

@qclzdh qclzdh changed the title QNX build libiceoryx_platform.so build libiceoryx_platform.so error on QNX Jan 11, 2022
@qclzdh qclzdh changed the title build libiceoryx_platform.so error on QNX build libiceoryx_platform.so error for QNX Jan 11, 2022
@elBoberido
Copy link
Member

Currently we do not have a QNX CI build so it might easily break on QNX. I think we have to rework the cmake code for the platform a bit and also add a CI for QNX.

Could you try to add the following line after https://github.com/eclipse-iceoryx/iceoryx/blob/master/iceoryx_hoofs/CMakeLists.txt#L234

    target_link_libraries(iceoryx_platform PRIVATE socket)

@qclzdh
Copy link
Author

qclzdh commented Jan 12, 2022

Yes, it works well, this code can fix that link error

target_link_libraries(iceoryx_platform PRIVATE socket)

@elBoberido
Copy link
Member

@qclzdh I'll create a PR but need to clean things up a bit. Can I ping you to build that PR on QNX before we merge?

@qclzdh
Copy link
Author

qclzdh commented Jan 12, 2022

@elBoberido Yes, you can.

@elBoberido elBoberido self-assigned this Jan 13, 2022
@elBoberido elBoberido added the bug Something isn't working label Jan 13, 2022
elBoberido added a commit to ApexAI/iceoryx that referenced this issue Jan 13, 2022
elBoberido added a commit that referenced this issue Jan 18, 2022
iox-#1013 Split iceoryx_platform cmake code into own file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants