From 8c4352f2dc1a6c43cdfd585106107bb7f73b6dda Mon Sep 17 00:00:00 2001 From: Thibault Charbonnier Date: Wed, 10 Jul 2019 23:43:23 -0700 Subject: [PATCH 1/3] api: bumped API version to 0.0.8. --- src/api/ngx_stream_lua_api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/ngx_stream_lua_api.h b/src/api/ngx_stream_lua_api.h index 98713c96..7437728d 100644 --- a/src/api/ngx_stream_lua_api.h +++ b/src/api/ngx_stream_lua_api.h @@ -29,7 +29,7 @@ /* Public API for other Nginx modules */ -#define ngx_stream_lua_version 7 +#define ngx_stream_lua_version 8 typedef struct { From 5941306e2ea246f813c304c6e8f6b0c05bd33cc3 Mon Sep 17 00:00:00 2001 From: Thibault Charbonnier Date: Wed, 10 Jul 2019 23:47:56 -0700 Subject: [PATCH 2/3] bugfix: ensured the 'pcre_version()' symbol is preserved and undefined when PCRE is statically linked. When using `--with-pcre=...`, NGINX is statically linked against libpcre.a. Since `pcre_version()` is unused, its symbol is stripped by the linker. Because lua-resty-core's `resty.core.regex` module needs it, we here ensure that the symbol is entered as undefined in our final binary. This should not be an issue for win32 builds since `--export-all-symbols` is already set. --- config | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/config b/config index 20f5450d..74b5366d 100644 --- a/config +++ b/config @@ -450,5 +450,23 @@ ngx_feature_test='struct sigaction act; . auto/feature +if [ $PCRE != NO -a $PCRE != YES ]; then + # force pcre_version symbol to be undefined when PCRE is statically linked + + ngx_feature="force undefined symbols (--undefined)" + ngx_feature_libs="-Wl,--undefined=printf" + ngx_feature_name= + ngx_feature_run=no + ngx_feature_incs="#include " + ngx_feature_path= + ngx_feature_test='printf("hello");' + + . auto/feature + + if [ $ngx_found = yes ]; then + CORE_LIBS="$CORE_LIBS -Wl,--undefined=pcre_version" + fi +fi + #CFLAGS=$"$CFLAGS -DLUA_DEFAULT_PATH='\"/usr/local/openresty/lualib/?.lua\"'" #CFLAGS=$"$CFLAGS -DLUA_DEFAULT_CPATH='\"/usr/local/openresty/lualib/?.so\"'" From 36d164fb281f9cf35d1262152b9f2284a79b7295 Mon Sep 17 00:00:00 2001 From: Thibault Charbonnier Date: Wed, 10 Jul 2019 23:53:09 -0700 Subject: [PATCH 3/3] [removeme] travis-ci: switched to the contributor's branch of lua-resty-core and ngx_lua. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ef2008a5..35153f3d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,12 +55,12 @@ install: - git clone https://github.com/openresty/mockeagain.git - git clone https://github.com/openresty/test-nginx.git - git clone -b v2.1-agentzh https://github.com/openresty/luajit2.git - - git clone https://github.com/openresty/lua-nginx-module.git ../lua-nginx-module + - git clone -b fix/static-libpcre https://github.com/thibaultcha/lua-nginx-module.git ../lua-nginx-module - git clone https://github.com/openresty/echo-nginx-module.git ../echo-nginx-module - git clone https://github.com/openresty/memc-nginx-module.git ../memc-nginx-module - git clone https://github.com/openresty/headers-more-nginx-module.git ../headers-more-nginx-module - git clone https://github.com/openresty/lua-resty-lrucache.git ../lua-resty-lrucache - - git clone https://github.com/openresty/lua-resty-core.git ../lua-resty-core + - git clone -b chore/bump-api https://github.com/thibaultcha/lua-resty-core.git ../lua-resty-core script: - sudo iptables -I OUTPUT 1 -p udp --dport 10086 -j REJECT