searchusermenu
  • 发布文章
  • 消息中心
点赞
收藏
评论
分享
原创

【nginx】asan版本编译

2024-11-27 09:37:37
15
0

本地编译

0)执行scl enable devtoolset-7 bash,sudo yum install libasan4
1)Makefile LINK 添加-lasan
2)在CFLAGS添加
-fsanitize=address  -fno-omit-frame-pointer,去掉-O -O2编译优化;
3) sed 's/-O2//g' /root/nginx-rtsp/openresty-1.19.3.2/build/nginx-1.19.3/objs/Makefile | sed 's/-O//g' >xxx; mv -f xxx /root/nginx-rtsp/openresty-1.19.3.2/build/nginx-1.19.3/objs/Makefile

 

Dockerfile版本

RUN cd /root/nginx-rtsp/openresty-1.19.3.2 && ASAN_OPTIONS=detect_leaks=0 ./configure --prefix=/opt/nginx            \
                   --with-pcre-jit                                                \
                   --with-http_ssl_module                                  \
                   --with-http_v2_module                                   \
                   --add-module=xxx                                         \
                   --with-cc-opt="-Werror -W -g -O0 -fno-omit-frame-pointer -fsanitize=address -fsanitize-recover=address" \
                   --with-ld-opt="-fsanitize=address -fsanitize-recover=address -lpthread"
 
ENV ASAN_OPTIONS=halt_on_error=0:detect_container_overflow=0

 

0条评论
作者已关闭评论
ling
5文章数
0粉丝数
ling
5 文章 | 0 粉丝
ling
5文章数
0粉丝数
ling
5 文章 | 0 粉丝
原创

【nginx】asan版本编译

2024-11-27 09:37:37
15
0

本地编译

0)执行scl enable devtoolset-7 bash,sudo yum install libasan4
1)Makefile LINK 添加-lasan
2)在CFLAGS添加
-fsanitize=address  -fno-omit-frame-pointer,去掉-O -O2编译优化;
3) sed 's/-O2//g' /root/nginx-rtsp/openresty-1.19.3.2/build/nginx-1.19.3/objs/Makefile | sed 's/-O//g' >xxx; mv -f xxx /root/nginx-rtsp/openresty-1.19.3.2/build/nginx-1.19.3/objs/Makefile

 

Dockerfile版本

RUN cd /root/nginx-rtsp/openresty-1.19.3.2 && ASAN_OPTIONS=detect_leaks=0 ./configure --prefix=/opt/nginx            \
                   --with-pcre-jit                                                \
                   --with-http_ssl_module                                  \
                   --with-http_v2_module                                   \
                   --add-module=xxx                                         \
                   --with-cc-opt="-Werror -W -g -O0 -fno-omit-frame-pointer -fsanitize=address -fsanitize-recover=address" \
                   --with-ld-opt="-fsanitize=address -fsanitize-recover=address -lpthread"
 
ENV ASAN_OPTIONS=halt_on_error=0:detect_container_overflow=0

 

文章来自个人专栏
文章 | 订阅
0条评论
作者已关闭评论
作者已关闭评论
0
0