nasa / SBN

38 stars 23 forks source link

error when building for VxWorks #10

Closed mogar closed 4 years ago

mogar commented 4 years ago

Line 339 of sbn_tcp_if.c references MSG_NOSIGNAL, which doesn't seem to exist for VxWorks. I'm using the VxWorks target cmake file from here: https://github.com/nasa/cFE/blob/master/cmake/sample_defs/toolchain-ppc-vxworks6.9.cmake

SBN version 1.9, cloned from master.

[ 72%] Building C object apps/sbn/CMakeFiles/sbn_tcp.dir/modules/tcp/fsw/src/sbn_tcp_if.c.obj
In file included from /cfs/apps/sbn/modules/tcp/fsw/src/sbn_tcp_if.c:2:
/cfs/apps/sbn/modules/tcp/fsw/src/sbn_tcp_if.h:56: warning: initialization from incompatible pointer type
/cfs/apps/sbn/modules/tcp/fsw/src/sbn_tcp_if.h:57: warning: initialization from incompatible pointer type
/cfs/apps/sbn/modules/tcp/fsw/src/sbn_tcp_if.h:59: warning: excess elements in struct initializer
/cfs/apps/sbn/modules/tcp/fsw/src/sbn_tcp_if.h:59: warning: (near initialization for 'SBN_TCP_Ops')
/cfs/apps/sbn/modules/tcp/fsw/src/sbn_tcp_if.c: In function 'SBN_TCP_Send':
/cfs/apps/sbn/modules/tcp/fsw/src/sbn_tcp_if.c:339: error: 'MSG_NOSIGNAL' undeclared (first use in this function)
/cfs/apps/sbn/modules/tcp/fsw/src/sbn_tcp_if.c:339: error: (Each undeclared identifier is reported only once
/cfs/apps/sbn/modules/tcp/fsw/src/sbn_tcp_if.c:339: error: for each function it appears in.)
make[7]: *** [apps/sbn/CMakeFiles/sbn_tcp.dir/modules/tcp/fsw/src/sbn_tcp_if.c.obj] Error 1
make[6]: *** [apps/sbn/CMakeFiles/sbn_tcp.dir/all] Error 2
make[5]: *** [all] Error 2
make[4]: *** [CMakeFiles/cpu1-all] Error 2
make[3]: *** [CMakeFiles/cpu1-all.dir/all] Error 2
make[2]: *** [CMakeFiles/mission-all.dir/rule] Error 2
make[1]: *** [mission-all] Error 2
make: *** [all] Error 2
CDKnightNASA commented 4 years ago

Understood, as a workaround you can probably just send "0" for the send() flags parameter. I can try removing it from the codebase but I am guessing SIGPIPE will cause issues with the signal handling in cFE. (Hard to test, too.)

Longer-term, OSAL will have a network interface that supports TCP and UDP and will hopefully abstract away platform-specific issues.

skliper commented 4 years ago

Would the current OSAL Socket API's work? See osal/src/os/inc/osapi-os-net.h (supports DATAGRAM and STREAM).

jphickey commented 4 years ago

Indeed, the current OSAL APIs are abstracting the TCP and UDP. This should work for SBN.

That being said, the current OSAL is also by default blocking all signals except INT/ABRT and the errors, so PIPE would be blocked by default too.

CDKnightNASA commented 4 years ago

Indeed, the current OSAL APIs are abstracting the TCP and UDP. This should work for SBN.

That being said, the current OSAL is also by default blocking all signals except INT/ABRT and the errors, so PIPE would be blocked by default too.

Copy, I'll create a separate ticket to move to using OSAL and, for now, just remove the MSG_NOSIGNAL flag.

CDKnightNASA commented 4 years ago

See ticket #13 for the OSAL implementation ticket.

CDKnightNASA commented 4 years ago

Changes have been pushed to close #13, I would appreciate a re-test against VxWorks if you get a chance, @mogar . Thanks!

mogar commented 4 years ago

Won't be able to test until the new year. Hope you can wait :)

mogar commented 4 years ago

Confirm that this is working for me. Thanks!