[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Request for review] aeskulap



Hi Nilesh,

On Tue, Mar 09, 2021 at 08:29:47PM +0530, Nilesh Patra wrote:
> I was working on making src:aeskulap cross-buildable. The problem with cross-building IMO was the AC_CHECK_FILE([/proc/self/maps]) in acinclude.m4

I do not think that this is a problem of src:aeskulap. Doing
AC_CHECK_FILE is perfectly legitimate during cross builds. However, you
should only do it for host files, not for build files. So the use
mentioned above clearly wants to determine whether /proc/self/maps
exists on the host. When you check for a header file, you should not use
AC_CHECK_FILE, but a simple test -e or better still AC_CHECK_HEADER
instead.

Given the "host" nature of this check, it always fails for cross builds
by default. In order for it to work, the check result must be seeded
into the build. There are more checks like this (e.g. whether malloc(0)
returns NULL or something else). Debian currently provides them via the
cross-config binary package, which is a little undermaintained. I'm not
convinced that it is the final solution to the problem of check results,
but that's what we currently have. cross-config is automatically enabled
by sbuild, but not by pbuilder. It lacks a few checks such this one. If
you set ac_cv_file__proc_self_maps=yes in the environment of the build,
it'll cross build just fine.

The way cross-config is organized does not help here. It groups the
checks by architecture, but some checks are dependent on the C library
(such as the malloc check above) and some are dependen on the kernel
(such as the one from your mail). cross-config does not support such
grouping.

> This is because, binreloc is enabled by default for non-mingw compiler (which means it is definitely default for Debian's use-case). On disabling it during cross-building, it seems to work well

It tests for the value of "no". I think we really need this.

> I'm attaching the patch for the same. Since I do not know much of autotools ecosystem admittedly, I'd really appreciate any review/help.

For the reasons given above, I don't think this is the right approach.
Given that you can just export a variable, I think there is no problem
to solve on the src:aeskulap side.

> +if test $build = $host ; then

A better way usually is: test "$cross_compiling" = yes

Thanks for asking

Helmut


Reply to: