[OT] lighttpd 1.4.71 cross-build issue. Error: ./conftest: cannot execute binary file: exec format error
Added by bharatb 10 months ago
Hello,
We have working code with lighttpd 1.4.64. However we required to update version to 1.4.71. While updating lighttpd 1.4.71, code building start breaking with following config.log message. I have tried lot to fix/search but not able to do so. For you ready reference I have written message by compiler as below.
configure:6298: checking whether we are cross compiling
configure:6306: gcc -std=gnu11 -o conftest -g -O2 conftest.c >&5
configure:6310: $? = 0
configure:6317: ./conftest
./configure: line 6319: ./conftest: cannot execute binary file: Exec format error
configure:6321: $? = 126
configure:6328: error: in `/home_dir/ltib-mpcxxxxerdb_revx-xxxxxxxx/rpm/BUILD/lighttpd-1.4.71':
configure:6330: error: cannot run C compiled programs.
If you meant to cross compile, use `--build'.
See `config.log' for more details
Can you help me out please.
Note: I have tried with lighttpd 1.4.70 also but same result.
Replies (5)
RE: lighttpd 1.4.71 build issue. Error: ./conftest: cannot execute binary file: exec format error - Added by gstrauss 10 months ago
Latest stable lighttpd release is lighttpd 1.4.73. If you are updating, you should update to lighttpd 1.4.73
git diff lighttpd-1.4.64..lighttpd-1.4.71 configure.ac
does not show a lot of changes, nor anything remotely relevant to your error.
./configure: line 6319: ./conftest: cannot execute binary file: Exec format error
Fix your build environment.
If you haven't yet, perform a build in a clean build environment.
If you haven't yet, make sure to run ./autogen.sh
for autoreconf -fi
Make sure you've actually configured your cross compilation environment correctly.
Sorry, none of that is a lighttpd build issue. You need to fix your cross compilation environment.
RE: [OT] lighttpd 1.4.71 cross-build issue. Error: ./conftest: cannot execute binary file: exec format error - Added by gstrauss 10 months ago
If you're building an RPM, then see InstallFromSource and look at the Fedora build and .spec file
RE: [OT] lighttpd 1.4.71 cross-build issue. Error: ./conftest: cannot execute binary file: exec format error - Added by bharatb 10 months ago
Hello,
Thank you for sharing information. My build environment is perfectly work with lighttpd 1.4.64 but not with lighttpd 1.4.73 (initially I was using 1.4.71 but now as per your suggestion I am using lighttpd 1.4.73). Do I need to change build environment according to lighttpd 1.4.73? Please can you help me that how I can know that what parameter need to change in build environment?
Meanwhile, I want to share one obervation. I have found difference between lighttpd1.4.64 and lightpd1.4.73 in serial messages during build. lighttpd 1.4.64 compiled with -std=gnu99 while lighttpd 1.4.73 compiled with -std=gnu11. So, should I compile with gnu99? How I can change this setting?
RE: [OT] lighttpd 1.4.71 cross-build issue. Error: ./conftest: cannot execute binary file: exec format error - Added by gstrauss 10 months ago
lighttpd configure.ac stopped specifying --std=gnu99
in lighttpd 1.4.46 back in 2017
https://git.lighttpd.net/lighttpd/lighttpd1.4/commit/6f75cddddaa8848b729569daab4059e180ce0eb1
lighttpd cross-compiles just fine and builds on many different OS and versions.
lighttpd builds using autotools, CMake, SCONS, and meson.
Sorry, this web site is a lighttpd forum, not free support for your company's custom build environment or how to configure your compiler.
RE: [OT] lighttpd 1.4.71 cross-build issue. Error: ./conftest: cannot execute binary file: exec format error - Added by bharatb 9 months ago
Hi Sir,
I checked my cross compilation environment but not able to find any abnormality. I also agreed that this is not lighttpd issue but any how I can not able to resolved issue. My issue is only related to conftest.c compilation as specified in above post. I can resolve issue by disabling conftest from configuration file. I have looked into lighttpd configuration file and tried to understand it. Now, I want to disable conftest option so that this file not compiled and I will not get error message. So, can you please help me that how can I disable conftest feature so that it will not compile. I believe that this will resolve my issue.