Skip to content

Pointer alignmnet issues on 32 bit ARM #93

@Jkillelea

Description

@Jkillelea

It looks like some struct has changed size and it no longer aligns nicely with 32 bit ARM. It's possible that this software simply shouldn't be compiled on this platform and instead it should be reserved for an x86/x86_64 based ground station.

Steps to reproduce the behavior:

  1. Clone cFS from https://github.com/nasa/cFS
  2. Compile

Expected behavior:
Structs sizes should align so that casts can be made on platforms that do not allow unaligned access (such as ARM).

Code snips:

Scanning dependencies of target mission-all
Scanning dependencies of target cmdUtil
[ 14%] Building C object tools/cFS-GroundSystem/Subsystems/cmdUtil/CMakeFiles/cmdUtil.dir/cmdUtil.c.o
[ 28%] Building C object tools/cFS-GroundSystem/Subsystems/cmdUtil/CMakeFiles/cmdUtil.dir/SendUdp.c.o
/home/pi/upstream-cfs/tools/cFS-GroundSystem/Subsystems/cmdUtil/SendUdp.c: In function ‘SendUdp’:
/home/pi/upstream-cfs/tools/cFS-GroundSystem/Subsystems/cmdUtil/SendUdp.c:90:20: error: cast increases required alignment of target type [-Werror=cast-align]
         inet_ntoa(((struct sockaddr_in*)result->ai_addr)->sin_addr), port);
                    ^
cc1: all warnings being treated as errors
tools/cFS-GroundSystem/Subsystems/cmdUtil/CMakeFiles/cmdUtil.dir/build.make:86: recipe for target 'tools/cFS-GroundSystem/Subsystems/cmdUtil/CMakeFiles/cmdUtil.dir/SendUdp.c.o' failed
make[7]: *** [tools/cFS-GroundSystem/Subsystems/cmdUtil/CMakeFiles/cmdUtil.dir/SendUdp.c.o] Error 1
CMakeFiles/Makefile2:462: recipe for target 'tools/cFS-GroundSystem/Subsystems/cmdUtil/CMakeFiles/cmdUtil.dir/all' failed
make[6]: *** [tools/cFS-GroundSystem/Subsystems/cmdUtil/CMakeFiles/cmdUtil.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make[5]: *** [all] Error 2
CMakeFiles/mission-all.dir/build.make:57: recipe for target 'CMakeFiles/mission-all' failed
make[4]: *** [CMakeFiles/mission-all] Error 2
CMakeFiles/Makefile2:164: recipe for target 'CMakeFiles/mission-all.dir/all' failed
make[3]: *** [CMakeFiles/mission-all.dir/all] Error 2
CMakeFiles/Makefile2:171: recipe for target 'CMakeFiles/mission-all.dir/rule' failed
make[2]: *** [CMakeFiles/mission-all.dir/rule] Error 2
Makefile:212: recipe for target 'mission-all' failed
make[1]: *** [mission-all] Error 2
Makefile:120: recipe for target 'all' failed
make: *** [all] Error 2
pi@raspberrypi:~/upstream-cfs $ uname -a
Linux raspberrypi 4.19.66+ #1253 Thu Aug 15 11:37:30 BST 2019 armv6l GNU/Linux

System observed on:

  • Raspberry Pi Zero
  • OS: Linux 4.19
  • cFS git commit a4345d87c01b1818bdb217ffd4dcce8bf86e33fe, cFS-GroundSystem git commit 1c31f94f3b63d3ff9c5da35ca9f8825a89ef3258

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions