0

I am trying to cross-compile Nginx for Armv7l. See the followings steps already done (following this tutorial mainly Nginx for arm)

Step 1

./configure --without-pcre --without-http_rewrite_module --without-http_gzip_module

Step 2

make

Step 3

vi objs/Makefile

Replace CC = cc to CC = arm-linux-gcc

Step 4

find . -name "*.o" | xargs rm -f

Step 5

make

Step 6

My binary file "nginx" is available in objs/nginx. Command file gives the following result

objs/nginx: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.28, not stripped

Step 7

Copy this binary nginx inside /sbin on my arm machine and use the command sh /sbin/nginx

nginx: line 1: syntax error: word unexpected (expecting ")")

I cannot find any help on internet. What does that error mean ? Is my file corrupted ? Should I copy the whole objs folder or only the binary as I did ?

Is there an already compiled version of nginx for armv7l (I did not find one) ?

0

It is either:

sh -c /sbin/nginx

Or:

/sbin/nginx

And if you have Qemu correctly installed on your host, you can enjoy your ARM-version of Nginx (easier with a static one).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.