[alibaba/tengine]编译安装时出错error: use of undeclared identifier 'NGX_SETPROCTITLE_PAD'

2024-07-10 654 views
8

环境: FreeBSD nginx-1 10.3-RELEASE-p20 root@nginx-1:~/tengine-2.2.1 # pkg info | egrep -e "gcc|openssl|pcre" gcc-6 Meta-port for the default version of the GNU Compiler Collection gcc-ecj-4.5 Eclipse Java Compiler used to build GCC Java gcc5-5.4.0_2 GNU Compiler Collection 5 gcc6-6.4.0_2 GNU Compiler Collection 6 openssl-1.0.2l,1 SSL and crypto library pcre-8.40_1 Perl Compatible Regular Expressions library

编译安装时出现错误: root@nginx-1:~/tengine-2.2.1 # make make -f objs/Makefile cc -c -pipe -O -Wall -Wextra -Wpointer-arith -Wconditional-uninitialized -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I src/proc -I /usr/local/include -I objs -o objs/src/os/unix/ngx_pipe.o src/os/unix/ngx_pipe.c src/os/unix/ngx_pipe.c:597:43: error: use of undeclared identifier 'NGX_SETPROCTITLE_PAD' ngx_memset((u_char *) ngx_os_argv[0], NGX_SETPROCTITLE_PAD, title_len); ^ src/core/ngx_string.h:87:54: note: expanded from macro 'ngx_memset'

define ngx_memset(buf, c, n) (void) memset(buf, c, n)
                                                 ^

1 error generated. *** Error code 1

Stop. make[1]: stopped in /root/tengine-2.2.1 *** Error code 1

Stop.

回答

6

请贴一下编译选项

8
#if (NGX_SOLARIS)
#else
   ngx_memset((u_char *) ngx_os_argv[0], NGX_SETPROCTITLE_PAD, title_len);
   ngx_cpystrn((u_char *) ngx_os_argv[0], op->cmd, title_len);
#endif

@MengqiWu 看看这个问题, 是不是 FreeBSD的环境没有判断。

4

没有编译选项。默认的./configure。 看源代码是这样:

if (NGX_SOLARIS) else

ngx_memset((u_char ) ngx_os_argv[0], NGX_SETPROCTITLE_PAD, title_len); ngx_cpystrn((u_char ) ngx_os_argv[0], op->cmd, title_len);

endif

NGX_SOLARIS是FreeBSD系统的判断吗?如果是那把注释去掉就可以可吧。

4

可以用最新的master试试, 还有问题可以打开issue。