I actually hacked up one of those borderline-insane py
scripts to mangle our C
code into big-endian-reversed structs.
See
https://gerrit.osmocom.org/#/c/libosmocore/+/11786 for the script and
https://gerrit.osmocom.org/#/c/libosmocore/+/11787 for what it did to libosmocore
The script implementation itself is mad and convoluted, of course. How could it
be different when handling and mangling C code.
Awesome, Neels! This can become a very useful tool.
After all structs are fixed, we also have a few places with "ntohs"
and its friends to fix.
I've gotten quite a lot of test suites to pass now for several of the
packages. See here:
https://buildd.debian.org/status/package.php?p=Debian-mobcom-maintainers%40…
However, in some cases I am unsure if I have fixed the problem or if I
have just hidden the problem...
For instance, this one:
-
https://sources.debian.org/patches/libosmocore/0.12.1-2/0006-Fix-some-byte-…
It makes the test pass.
Even more hacky, and probably wrong is this one:
-
https://browse.dgit.debian.org/osmo-bsc.git/commit/?id=656937f42ab08ee206dd…
(it also makes the test pass)
Could you please have a look at these two patches and see if they just
hide the problem, and if they do, what the correct fix is?
Best regards
Ruben