Project

General

Profile

[Solved] lighttpd-1.4.56 build issue: ../src/lemon cannot execute binary file

Added by kthaore 23 days ago

I am trying to build the lighttpd-1.4.56 source on my build machine (Ubuntu i686 32 bit).
I get the following error:
...
...
gcc -g -O2 -o lemon ./lemon.c
rm -f configparser.h
../src/lemon -q ./configparser.y ./lempar.c
../src/lemon: ../src/lemon: cannot execute binary file
make2: *** [configparser.c] Error 126
...
...

I also tried building newer versions lighttpd-1.4.57 and lighttpd-1.4.59 but got the same error for the build step.
When I tried building lighttpd-1.4.55 it got build successfully.

I see that "lemon" executable is present in /src folder and it can be executed by "anyone".

Request help to get over this issue.


Replies (8)

RE: lighttpd-1.4.56 build issue: ../src/lemon cannot execute binary file - Added by gstrauss 23 days ago

If you are doing a cross-compilation, lemon must be properly compiled with the native compiler for the platform on which you are building. This is normally handled by the build system unless you have overridden it with environment or command line variables.

While there are not detailed cross-compilation instructions here, please refer to lighttpd source code and build instructions and attempt to build natively before attempting to do a cross-compilation build.

RE: lighttpd-1.4.56 build issue: ../src/lemon cannot execute binary file - Added by kthaore 23 days ago

So, is it the case that whole package is being built to run on target platform and this also includes "lemon" executable ... but "lemon" executable must run on the build machine which is different from the target platform ?

If so, then is there a setting in Makefile which I can alter to build the "lemon" executable correctly for my build machine?

RE: lighttpd-1.4.56 build issue: ../src/lemon cannot execute binary file - Added by gstrauss 23 days ago

please refer to lighttpd source code and build instructions and attempt to build natively before attempting to do a cross-compilation build.

RE: lighttpd-1.4.56 build issue: ../src/lemon cannot execute binary file - Added by kthaore 19 days ago

Thanks for your vital responses sir.

I manually compiled the lemon executable on my build machine and then copied it into /src folder. With this I am able to build lighttpd-1.4.56 to lighttpd-1.4.58. I tried modifying the lemon executable command in makefile.in from

lemon$(BUILD_EXEEXT): lemon.c
$(AM_V_CC)$(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ $(srcdir)/lemon.c

to

lemon$(BUILD_EXEEXT): lemon.c
/usr/bin/gcc --with-gnu-as $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ $(srcdir)/lemon.c

but this change didn't work.

Currently our project is using lighttpd-1.4.55 but since we face the issue [[https://redmine.lighttpd.net/boards/2/topics/9273?r=9306#message-9306]] hence we must update to a lighttpd-1.4.56 or later.

RE: lighttpd-1.4.56 build issue: ../src/lemon cannot execute binary file - Added by gstrauss 19 days ago

In the meantime, you could use the two-line patch in https://redmine.lighttpd.net/boards/2/topics/9273?r=9287#message-9287 with lighttpd 1.4.55

In your current build environment, you can download the latest ax_prog_cc_for_build.m4 and try to build with lighttpd 1.4.59.
See https://redmine.lighttpd.net/boards/2/topics/9888
ax_prog_cc_for_build.m4 is updated in my dev branch and will be part of lighttpd 1.4.60 when lighttpd 1.4.60 is released.

RE: lighttpd-1.4.56 build issue: ../src/lemon cannot execute binary file - Added by kthaore 18 days ago

Thanks for your directives Sir.

We will include the 2 line patch in lighttpd-1.4.55 to fix the issue with file uploads less than 64k.
We shall then update to lighttpd-1.4.60 once available so that our existing issue of lemon executable is resolved.

RE: lighttpd-1.4.56 build issue: ../src/lemon cannot execute binary file - Added by gstrauss 18 days ago

We shall then update to lighttpd-1.4.60 once available so that our existing issue of lemon executable is resolved.

Did you test that? Or are you assuming? You should test that assumption.
If it works, then you should consider using that with lighttpd 1.4.59 until lighttpd 1.4.60 is released.

RE: lighttpd-1.4.56 build issue: ../src/lemon cannot execute binary file - Added by kthaore 18 days ago

Re. Did you test that? Or are you assuming? You should test that assumption.
Yes sir, I will test this right away and share outcome.

    (1-8/8)