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

RPI4 compile error #50

Closed
mkressel opened this issue Jun 12, 2021 · 5 comments · Fixed by #51 or #52
Closed

RPI4 compile error #50

mkressel opened this issue Jun 12, 2021 · 5 comments · Fixed by #51 or #52
Assignees

Comments

@mkressel
Copy link

Hi, I'm trying to compile the cFS on a Raspberry PI 4. I've followed the instructions here, to modify the system processor from i686 to arm for cmake. (The other edits seemed deprecated).

When compiling, I get the following error:

[ 85%] Building C object tools/tblCRCTool/CMakeFiles/cfe_ts_crc.dir/cfe_ts_crc.c.o
/home/pi/src/cFS/tools/tblCRCTool/cfe_ts_crc.c: In function ‘main’:
/home/pi/src/cFS/tools/tblCRCTool/cfe_ts_crc.c:156:77: error: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘ssize_t’ {aka ‘int’} [-Werror=format=]
     printf("\nTable File Name:            %s\nTable Size:                 %ld Bytes\nExpected TS Validation CRC: "
                                                                           ~~^
                                                                           %d
/home/pi/src/cFS/tools/tblCRCTool/cfe_ts_crc.c:158:21:
            argv[1], fileSize, fileCRC);
                     ~~~~~~~~
cc1: all warnings being treated as errors
make[7]: *** [tools/tblCRCTool/CMakeFiles/cfe_ts_crc.dir/build.make:63: tools/tblCRCTool/CMakeFiles/cfe_ts_crc.dir/cfe_ts_crc.c.o] Error 1
make[6]: *** [CMakeFiles/Makefile2:622: tools/tblCRCTool/CMakeFiles/cfe_ts_crc.dir/all] Error 2
make[5]: *** [Makefile:141: all] Error 2
make[4]: *** [CMakeFiles/mission-install.dir/build.make:57: CMakeFiles/mission-install] Error 2
make[3]: *** [CMakeFiles/Makefile2:297: CMakeFiles/mission-install.dir/all] Error 2
make[2]: *** [CMakeFiles/Makefile2:304: CMakeFiles/mission-install.dir/rule] Error 2
make[1]: *** [Makefile:227: mission-install] Error 2
make: *** [Makefile:122: install] Error 2

Are there other edit(s) I need to make to a cmake file to get cFS to compile on the RPI4? Thanks!

@mkressel
Copy link
Author

FYI, I was able to get it to compile on the RPI4 by changing the "%ld" to "%d" on line 156 of tools/tblCRCTool/cfe_ts_crc.c. The cFS now compiles and runs successfully.

@jphickey
Copy link
Contributor

This is an issue in the tblCRCTool, it needs a cast here. Recommend to transfer this issue to that repo so a patch can be done.

@jphickey jphickey transferred this issue from nasa/cFS Jun 14, 2021
@ghost
Copy link

ghost commented Jun 14, 2021

We should be using %z for size_t (standard) but I know that the gcc 4.9 for sparc/vxworks doesn't support it.

@jphickey
Copy link
Contributor

Yeah, this is ssize_t though .... not sure if there is a standardized conversion for that? Nonetheless, forcing to long is probably the most portable.

jphickey added a commit to jphickey/tblCRCTool that referenced this issue Jun 14, 2021
Cast ssize_t to long and uint32 to unsigned long for printf.
This matches the %d and %lX conversions, respectively.
@jphickey jphickey self-assigned this Jun 14, 2021
@ghost
Copy link

ghost commented Jun 14, 2021

According to printf man page (3) %z is size_t or ssize_t. Maybe not standard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants