我正在尝试使用以下脚本使用自定义 openssl »libressl« 编译 nginx:https://gist.github.com/Belphemur/3c022598919e6a1788fc

使用 libressl 2.1.1 一切正常。
问题是 libressl 2.1.1 存在一些安全问题,这些问题已由较新的版本解决。
但是,我无法使构建与 libressl 2.1.2 或 libressl 2.1.3(最新版本)一起使用。

我得到的问题:

..
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /tmp/build/pcre-8.36 -I /tmp/build/libressl-2.1.2/.openssl/include -I objs \
        -o objs/src/core/nginx.o \
        src/core/nginx.c
In file included from /usr/include/string.h:635:0,
                 from /tmp/build/libressl-2.1.2/.openssl/include/string.h:6,
                 from src/os/unix/ngx_linux_config.h:27,
                 from src/core/ngx_config.h:26,
                 from src/core/nginx.c:8:
/tmp/build/libressl-2.1.2/.openssl/include/string.h:29:8: error: expected identifier or ‘(’ before ‘__extension__’
 char * strndup(const char *str, size_t maxlen);
        ^
make[1]: *** [objs/src/core/nginx.o] Error 1
make[1]: Leaving directory `/tmp/build/nginx-1.7.9'
make: *** [build] Error 2
All done.
..

有什么问题以及如何解决?
谢谢你的帮助。

最佳答案

我是您用来使用 LibreSSL 构建 Nginx 的脚本的创建者。

现在更正了,以前构建和使用 libressl 的方法不适用于以前版本的脚本。 (只需复制所有包含并剥离库)

该脚本现在将 libressl 安装在设置目录中并将其提供给 nginx,这样,所有不需要使用库的包含(如这个 string.h)都不是 nginx 构建过程的一部分。

关于ssl - string.h :29:8: error: expected identifier,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/28753021/

10-12 19:00