Compilación cruzada de Nginx desde cero

Cadena de herramientas de compilación cruzada: arm-poky-linux-gnueabi-gcc 

 

./configure --prefix = / home / chad / Documents / nginx_cr --with-cc = arm-poky-linux-gnueabi-gcc

Ocurren los siguientes problemas

root@ubuntu:/home/chad/Downloads/nginx-1.18.0# ./configure --prefix=/home/chad/Documents/nginx_cr  --with-cc=arm-poky-linux-gnueabi-gcc
checking for OS
 + Linux 4.15.0-101-generic x86_64
checking for C compiler ... not found

./configure: error: C compiler arm-poky-linux-gnueabi-gcc is not found

 

src/core/ngx_rwlock.c:125:2: error: #error ngx_atomic_cmp_set() is not defined!
 #error ngx_atomic_cmp_set() is not defined!
  ^
objs/Makefile:547: recipe for target 'objs/src/core/ngx_rwlock.o' failed
make[1]: *** [objs/src/core/ngx_rwlock.o] Error 1
make[1]: Leaving directory '/home/chad/Downloads/nginx-1.18.0'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2

La solución es agregar --without-http_upstream_zone_module en configure

src/os/unix/ngx_errno.c: In function 'ngx_strerror':
src/os/unix/ngx_errno.c:37:31: error: 'NGX_SYS_NERR' undeclared (first use in this function)
     msg = ((ngx_uint_t) err < NGX_SYS_NERR) ? &ngx_sys_errlist[err]:
                               ^
src/os/unix/ngx_errno.c:37:31: note: each undeclared identifier is reported only once for each function it appears in
src/os/unix/ngx_errno.c: In function 'ngx_strerror_init':
src/os/unix/ngx_errno.c:58:11: error: 'NGX_SYS_NERR' undeclared (first use in this function)
     len = NGX_SYS_NERR * sizeof(ngx_str_t);
           ^
objs/Makefile:664: recipe for target 'objs/src/os/unix/ngx_errno.o' failed
make[1]: *** [objs/src/os/unix/ngx_errno.o] Error 1
make[1]: Leaving directory '/home/chad/Downloads/nginx-1.18.0'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2

El motivo del error sigue siendo que el compilador cruzado no se puede ejecutar localmente, lo que provoca que no se asigne la macro NGX_SYS_NERR. La solución es editar manualmente objs / ngx_auto_config.hy agregar

#ifndef NGX_SYS_NERR
#define NGX_SYS_NERR  132
#endif

 

Supongo que te gusta

Origin blog.csdn.net/qingzhuyuxian/article/details/106354827
Recomendado
Clasificación