cross armhf tangle

Gary E. Miller gem at rellim.com
Tue Feb 4 04:11:03 UTC 2025


Yo Hal!

On Mon, 03 Feb 2025 19:59:41 -0800
Hal Murray <halmurray at sonic.net> wrote:

> The current code in wafhelpers/check_sizeof.py seems to work.
> 
> There are 2 reasons I would like to keep and understand it.  One is 
> general curiousity.  It was commited by ESR and he is usually very
> good about fixing crappy code.  My best guess is that it was part of
> a large chunk  that was copied from somewhere.  The cross build path
> has never been high on our list.  On the other hand, maybe there
> really is something interesting going on in there that I/we could
> learn from.

The more I look at that code, the more broken I see that it is.  Unless
the compile host and cross target are the exact same distro, this will
fail.  That is the case for the cross compile CI, but is very rare in
practice.

For example, gpsd often gets cross-compiled on Debian amd64 targeting
arm8a on Android.  The current code will fail on that.

Gntoo has excellent cross compile doc, but you don't use Gentoo.

    https://wiki.gentoo.org/wiki/Crossdev

> The other reason is to have a handy way of recording the size of a
> few things.  I've spent just enough time wondering about the sizes of
> things like struct timespec that having hard truth for a specific
> system handy is useful.  Did you know that timespec is 16 bytes?  The
> ns slot that fits into 32 bits gets rounded up to 64,

I much prefer to code in such a way that things like that do not need
to matter.  Then, if I still care, output it as a startup log message.

> I have no objections to cleaning up the code so that the NTP_SIZEOF
> stuff isn't needed.  I like your LAST_time_t example.

Do you want me to fix the other similar case and make it an MR?

> But please leave that NTP_SIZEOF stuff around as long as it is still 
> working.

Your definition of "working" and mine do not match.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin


More information about the devel mailing list