[Buildroot] Newbie: configure: error: cannot run test program while cross compiling

Williams Jr., Ernest L. ernesto at slac.stanford.edu
Fri Jan 2 16:25:42 UTC 2015


Hi Yann,
________________________________________
From: Yann E. MORIN [yann.morin.1998 at gmail.com] on behalf of Yann E. MORIN [yann.morin.1998 at free.fr]
Sent: Friday, January 2, 2015 1:33 AM
To: Williams Jr., Ernest L.
Cc: buildroot at busybox.net
Subject: Re: [Buildroot] Newbie: configure: error: cannot run test program while cross compiling

Ernest, All,

On 2015-01-01 21:03 -0800, Ernest L Williams spake thusly:
> Hi
> I am working with the hdf5 package and having trouble getting past the
> configuration stage :(
> hdf5 builds fine for my host machine but fails configuration when i try to
> build for
> "x86_64-buildroot-linux-uclibc"
>
>
> Oops,
> package/pkg-generic.mk:172: recipe for target '/home/ernesto/packages/buildroot-2014.11/buildroot-uclibc-x86_64/output/build/hdf5-1.8.14/.stamp_configured'
> failed
>
> The hdf5 package uses autotools
>
> Any ideas on what I should pursue?
>
> By the way,  why does "package/pkg-generic.mk" show up in the output below?
> I am using auto-tools.
>
>
> checking if libtool needs -no-undefined flag to build shared libraries... no
> checking if configure should try to set up large file support... yes
> checking for special C compiler options needed for large files... no
> checking for _FILE_OFFSET_BITS value needed for large files... no
> checking if large (64-bit) files are supported on this system.... configure:
> error: in `/home/ernesto/packages/buildroot-2014.11/buildroot-uclibc-x86_64/output/build/hdf5-1.8.14':
> configure: error: cannot run test program while cross compiling

Damn, those pesky packagers that do not like cross-compilation! ;-)

What you can do is force the result of the test, by passing the
appropriate value on the command line when calling configure, something
like the following:

    HDF5_CONF_ENV = hdf5_cv_have_lfs=$(if $(BR2_LARGEFILE),yes,no)

This will tell configure not to run the test, and assume the result we
do provide.

Note-1: you can see what variable to preset by looking at configure.ac,
line 1455:

    1452   ## Now actually test to see if we can create large files after we've
    1453   ## checked for any needed defines.
    1454   AC_MSG_CHECKING([if large (64-bit) files are supported on this system.])
    1455   AC_CACHE_VAL([hdf5_cv_have_lfs],
    1456     [AC_TRY_RUN([
    [...]

Note-2: I used 'HDF5' as a prefix, assuming the package is named 'hdf5'
in Buildroot.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>  Yes, the package name is "hdf5"
>>>  This actually worked great :)
>>>  Can I continue with this technique?
>>> Next error is the following:

>>> checking for struct tm.tm_zone... yes
>>> checking for struct timezone... yes
>>> checking whether gettimeofday() gives timezone... configure: 
>>> error: in `/home/ernesto/packages/buildroot-2014.11/buildroot-uclibc-x86_64/output/build/hdf5-1.8.14':
>>> configure: error: cannot run test program while cross compiling
>>> See `config.log' for more details

>>> config.log does indeed reveal the variable name  "ac_cv_func_gettimeofday"
>>> But what buildroot string must I use  "HDF5_CONF_ENV = hdf5_cv_have_lfs=$(if $(BR2_XXXX),yes,no) ?
>>> Looks like I may bump into more of this ?

>>> Cheers,
Ernesto


Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'



More information about the buildroot mailing list