Discussion:
cross compilation fails
Gilles Pion
2013-06-15 09:34:52 UTC
Permalink
Hello all,

I'm unable to cross compile latest lftp for an arm target,

configure fails with the following error

checking whether posix_fallocate() works... configure: error: in
`/home/gilles/dev/lftp/lftp-4.4.8':
configure: error: cannot run test program while cross compiling
See `config.log' for more details.

Looking for help or advice
--
Gilles Pion
Tony Eva
2013-08-16 17:17:27 UTC
Permalink
I had the same issue cross-compiling for a MIPS64 target, though of course
it will happen for any cross-compilation where the compiled test programs
cannot be run on the host.

I got round it by hacking the configure script to disable the fallocate()
test, using this sed command in the package's root directory:

sed -i -e
'/${i_cv_posix_fallocate_works+:}/ii_cv_posix_fallocate_works=no'
./configure

Basically it just disables the posix_fallocate test by hard-coding the
indicator that it's not available (the safe option), so configure doesn't
bother to run the test program. Not perfect but it worked for me.

Hope this helps.
--
Tony
Post by Gilles Pion
Hello all,
I'm unable to cross compile latest lftp for an arm target,
configure fails with the following error
checking whether posix_fallocate() works... configure: error: in
configure: error: cannot run test program while cross compiling
See `config.log' for more details.
Looking for help or advice
--
Gilles Pion
_______________________________________________
lftp mailing list
http://univ.uniyar.ac.ru/mailman/listinfo/lftp
Gilles Pion
2013-08-17 07:14:31 UTC
Permalink
Ref: <CAFK9Kvff6s_u+nm1c=iHMF5+_V4m2En1R1+***@mail.gmail.com> de
Tony Eva
Post by Tony Eva
I had the same issue cross-compiling for a MIPS64 target, though of course
it will happen for any cross-compilation where the compiled test programs
cannot be run on the host.
I got round it by hacking the configure script to disable the fallocate()
sed -i -e
'/${i_cv_posix_fallocate_works+:}/ii_cv_posix_fallocate_works=no'
./configure
Basically it just disables the posix_fallocate test by hard-coding the
indicator that it's not available (the safe option), so configure doesn't
bother to run the test program. Not perfect but it worked for me.
Hope this helps.
Thanks, I had finally also used a similar approach, (just been more optimistic
by choosing "yes"): just added the line "i_cv_posix_fallocate_works=yes" at the
very beginning of "configure" script. (BTW I prefer your solution, since a
scripted hack is better than a manual edit)
--
Gilles Pion
Loading...