cross armhf tangle
Hal Murray
halmurray at sonic.net
Mon Feb 3 05:35:02 UTC 2025
>> That was my first try. It didn't work on BSD.
> Care to share what the failure was?
It didn't know what a struct timeval was.
> Where can I find that man page?
man timeval on this Linux box says:
SYNOPSIS
#include <sys/time.h>
Without the sys, it worked on Linux but not on BSD.
With the sys it works on everything I've tried so I moved on to other
things.
> Oh, now I have context. The only extra code for cross builds would be
> the --march. When you use --march then /usr/include/sys may not be used
> for <sys/time.h>. cc swaps sys directory to one approriate to the
> target.
Are you sure of that? I don't understand this area. That's what I was
expecting, but look in .gitlab-ci.yml in the cross-armhf area. There are
a couple of runs that include:
--cross-cflags "-I/usr/include/ -I/usr/include/python${pyver}"
Isn't that using the same headers?
My guess is that the same kernel header files work for all architectures
and they are conditioned on #defines that the compiler provides.
/usr/include/bits/timex.h has stuff like this
# if defined __USE_TIME64_REDIRECTS || (__TIMESIZE == 64 && __WORDSIZE
== 32)
Where do they come from?
"gcc -dM -E -" tells you the compiler predefines. 397 of them on this box. But no __TIMESIZE or __WORDSIZE
[After more grepping...]
/usr/include/bits/wordsize.h says
/* Determine the wordsize from the preprocessor defines. */
#if defined __x86_64__ && !defined __ILP32__
# define __WORDSIZE 64
#else
# define __WORDSIZE 32
...
Similar stuff in /usr/include/bits/timesize.h
--
These are my opinions. I hate spam.
More information about the devel
mailing list