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

2.1.11 fails to build on RHEL 7.8 #104

Closed
johnphamngc opened this issue Jun 17, 2020 · 2 comments · Fixed by #106 or #107
Closed

2.1.11 fails to build on RHEL 7.8 #104

johnphamngc opened this issue Jun 17, 2020 · 2 comments · Fixed by #106 or #107
Assignees
Labels
bug Something isn't working
Milestone

Comments

@johnphamngc
Copy link

Describe the bug
2.1.11 fails to build on RHEL 7.8, due to endianness macros, as part of cFS build, with or without devtoolset-9:

[ 14%] Building C object tools/cFS-GroundSystem/Subsystems/cmdUtil/CMakeFiles/cmdUtil.dir/cmdUtil.c.o
cd /tmp/cFS/build/tools/cFS-GroundSystem/Subsystems/cmdUtil && /opt/rh/devtoolset-9/root/usr/bin/cc -D_XOPEN_SOURCE=600  -g   -std=c99 -pedantic -Wall -Wstrict-prototypes -Wwrite-strings -Wpointer-arith -Wcast-align -Werror -o CMakeFiles/cmdUtil.dir/cmdUtil.c.o   -c /tmp/cFS/tools/cFS-GroundSystem/Subsystems/cmdUtil/cmdUtil.c
/tmp/cFS/tools/cFS-GroundSystem/Subsystems/cmdUtil/cmdUtil.c: In function ‘ProcessField’:
/tmp/cFS/tools/cFS-GroundSystem/Subsystems/cmdUtil/cmdUtil.c:370:13: error: implicit declaration of function ‘htobe16’ [-Werror=implicit-function-declaration]
  370 |     *orig = htobe16((be16toh(*orig) & ~mask) | (templong & mask));
      |             ^~~~~~~
/tmp/cFS/tools/cFS-GroundSystem/Subsystems/cmdUtil/cmdUtil.c:370:22: error: implicit declaration of function ‘be16toh’ [-Werror=implicit-function-declaration]
  370 |     *orig = htobe16((be16toh(*orig) & ~mask) | (templong & mask));
      |                      ^~~~~~~
/tmp/cFS/tools/cFS-GroundSystem/Subsystems/cmdUtil/cmdUtil.c: In function ‘main’:
/tmp/cFS/tools/cFS-GroundSystem/Subsystems/cmdUtil/cmdUtil.c:666:33: error: implicit declaration of function ‘htole16’ [-Werror=implicit-function-declaration]
  666 |                     tempint16 = htole16(tempint16);
      |                                 ^~~~~~~
/tmp/cFS/tools/cFS-GroundSystem/Subsystems/cmdUtil/cmdUtil.c:708:33: error: implicit declaration of function ‘htobe32’ [-Werror=implicit-function-declaration]
  708 |                     tempint32 = htobe32(tempint32);
      |                                 ^~~~~~~
/tmp/cFS/tools/cFS-GroundSystem/Subsystems/cmdUtil/cmdUtil.c:710:33: error: implicit declaration of function ‘htole32’ [-Werror=implicit-function-declaration]
  710 |                     tempint32 = htole32(tempint32);
      |                                 ^~~~~~~
/tmp/cFS/tools/cFS-GroundSystem/Subsystems/cmdUtil/cmdUtil.c:752:33: error: implicit declaration of function ‘htobe64’ [-Werror=implicit-function-declaration]
  752 |                     tempint64 = htobe64(tempint64);
      |                                 ^~~~~~~
/tmp/cFS/tools/cFS-GroundSystem/Subsystems/cmdUtil/cmdUtil.c:754:33: error: implicit declaration of function ‘htole64’ [-Werror=implicit-function-declaration]
  754 |                     tempint64 = htole64(tempint64);
      |                                 ^~~~~~~
cc1: all warnings being treated as errors

To Reproduce
Build CFS GroundSystem on RHEL 7.8 as part of the cFS build. However, using the cmdUtil makefile works fine.

Expected behavior
Build completes correctly as part of cFS makefile build

System observed on:

  • OS: RHEL 7.8
  • Versions : cFS-GroundSystem 2.1.11

Additional context
This is apparently fixed by changing the macro defined at the top of cmdUtil.c from #define _BSD_SOURCE_ to #define _BSD_SOURCE

Reporter Info
John N Pham, Northrop Grumman

@skliper
Copy link
Contributor

skliper commented Jun 17, 2020

Related to #95. Trade is add the _BSD_SOURCE define, use -std=gnu99 (if this works), or re-implement the functions.

@jphickey
Copy link
Contributor

Note, -std=gnu99 does not work for this platform. It is not a GNU extension, and is not enabled by gnu99.

For this to build on RHEL you currently have to add _BSD_SOURCE to mission_build_custom.cmake, in addition to the _XOPEN_SOURCE which may be already there from the example, e.g.:

add_definitions(
    -D_XOPEN_SOURCE=600
    -D_BSD_SOURCE
)

My preference would still be to implement #95 which wouldn't require this extension on some platforms.

skliper added a commit to skliper/cFS-GroundSystem that referenced this issue Jun 23, 2020
skliper added a commit to skliper/cFS-GroundSystem that referenced this issue Jun 23, 2020
@skliper skliper self-assigned this Jun 23, 2020
@skliper skliper added the bug Something isn't working label Jun 23, 2020
@skliper skliper added this to the 2.2.0 milestone Jun 23, 2020
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
3 participants