Getting cross compilation to work.
Per Buer
per.buer at varnish-software.com
Tue Apr 21 13:49:11 UTC 2026
On Tue, Apr 21, 2026 at 3:22 PM Poul-Henning Kamp <phk at phk.freebsd.dk>
wrote:
> --------
> Per Buer writes:
>
>
> > Fifteen places are affected by this. 14 of them are clean and easy to
> > address. The last one is params.First, this requires significant work and
> > complexity, and tackling it in Python will likely produce something quite
> > fragile.
>
> Can you elaborate a bit on params.First and the resulting fragility ?
>
All the RST generation is quite easy to do in Python, except "params.rst",
which leverages a lot of vinyl code like:
#if defined(HAVE_ACCEPT_FILTERS)
which will determine the final content of params.rst. Replicating this in
Python sounds complex and fragile, likely requiring the replication of most
of the C preprocessor.
There is sysconf(_SC_THREAD_STACK_MIN) and MCF_ParamConf("thread_pools",
"%d", MAX_THREAD_POOLS) which will affect params.rst will end up looking.
So, autoconf has CC_FOR_BUILD, which allows us to use one compiler for the
target and another for intermediate host tasks. This is a much smaller and
simpler change than my original python suggestion, but it fails when you
try to go FreeBSD <--> Linux or 64bit <--> 32bit, because the defaults
change and the resulting params.rst will end up being somewhat off.
Now, this is also possible to address by checking that the target OS is
identical to the host OS and that the pointer size is the same in both
places.
So, I think, this is doable and will end up quite clean. If we want to
support 64b->32b, we might have to add a "--disable-docs" for that to work.
But personally, I would just deprecate 32b. It was a second class citizen i
2006 and is a bit of a joke today.
--
Per Buer
Varnish Software
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vinyl-cache.org/lists/pipermail/vinyl-dev/attachments/20260421/475a2e8f/attachment.html>
More information about the vinyl-dev
mailing list