Open utterances-bot opened 1 year ago
Hello again! This is a common problem when porting to ARM caused by signed vs. unsigned behavior of char
. On x86, it is signed but on ARM it is unsigned, so the comparison to -1 never succeeds. The best fix is to use int c = getopt(...)
because that's how getopt
and getopt_long
are defined anyhow.
Since this signed-char assumption may be present elsewhere in the codebase, CFLAGS=-fsigned-char
should force x86-like behavior.
Check out this tech note for more details.
A few things... I'm tickled that someone (e.g. you) has returned to read another post. Thanks! My default audience that I'm writing for is myself so having someone else engaged enough to comment (more than once!) is great.
Thanks for pointing out the signed vs. unsigned. I would have never thought of that; this was actually my first time taking something that, according to the authors, was never designed or tested on an architecture other than x86. It has me wondering if there are any other such things in the rest of polycube's code base.
Polycube on Arm-based SBC: Follow-up #2 (WIP) | TinyComputers.io
Update on the progress to get polycube running and functional on Arm-base systems
https://tinycomputers.io/posts/polycube-on-arm-based-sbc-follow-up-2-wip.html