Re: buildroot-s6: s6 Supervision for Embedded Devices

From: Eric Le Bihan <eric.le.bihan.dev_at_free.fr>
Date: Mon, 5 Oct 2015 22:48:04 +0200

Hi!

On Mon, Oct 05, 2015 at 02:09:41PM +0200, Laurent Bercot wrote:
> On 05/10/2015 11:52, Eric Le Bihan wrote:

> >- To cross-compile skalibs the documentation of skalibs recommends generating
> > the sysdeps offline. This is a problem for Buildroot, as many architectures
> > are supported and providing sysdeps for them is a no-go. I provide a patch for
> > skalibs which replaces the run time tests for some type sizes and endianness
> > with some compile time tests. This removes the need for offline sysdeps.
>
> I don't understand: if you cross-compile, compile-time tests will always
> give the wrong results. How do other systems handle cross-compilation, for
> instance wrt endianness? There has to be a database of sysdeps somewhere,
> that lists the functionalities of various archs. How does Buildroot handle it?
> It's certainly possible to make skalibs tap into that database to extract its
> own sysdeps; please tell me if I can help.

Buildroot does not have a database of sysdeps. It relies on two things:

1. a description of the supported platforms: name and endianness (see
   buildroot/arch/Config.in*)
2. the tests provided by the packages themselves (via the autotools or cmake),
   most of them of the try-compile form.

The aforementionned patch is available in the buildroot/package/skalibs [1].
It patches the ./configure of skalibs as follow:

1. replace the src/sysdeps/trysize*.c with generated code to try all the
   possible sizes of each desired type. When the cross-compiler builds one
   code successfully then the size of the type has been found.
2. replace the src/sysdeps/tryendianness.c with one for testing little
   endian and the other for big endian, using the predefined macros from
   GCC and clang.

Hunk 1 does not rely on cross-compiler features, whereas hunk 2 does, so I
think I will modify the patch as follow:

- keep hunk 1
- remove the tryendianness part and dump the value of Buildroot BR2_ENDIAN
  variable in the generated sysdeps.h instead.

The parts where ./configure tries to link with a library are OK.

[1] buildroot/package/skalibs/skalibs-0001-No-runtime-tests-for-type-sizes-nor-endianness.patch

--
ELB
Received on Mon Oct 05 2015 - 20:48:04 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC