Skip to content

Commit 5a97cce

Browse files
committed
bugfix: ensured the 'pcre_version' symbol is preserved as 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.
1 parent 1667036 commit 5a97cce

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

config

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,5 +450,23 @@ ngx_feature_test='struct sigaction act;
450450

451451
. auto/feature
452452

453+
if [ $PCRE != NO -a $PCRE != YES ]; then
454+
# force pcre_version symbol to be undefined when PCRE is statically linked
455+
456+
ngx_feature="force undefined symbols (--undefined)"
457+
ngx_feature_libs="-Wl,--undefined=printf"
458+
ngx_feature_name=
459+
ngx_feature_run=no
460+
ngx_feature_incs="#include <stdio.h>"
461+
ngx_feature_path=
462+
ngx_feature_test='printf("hello");'
463+
464+
. auto/feature
465+
466+
if [ $ngx_found = yes ]; then
467+
CORE_LIBS="$CORE_LIBS -Wl,--undefined=pcre_version"
468+
fi
469+
fi
470+
453471
#CFLAGS=$"$CFLAGS -DLUA_DEFAULT_PATH='\"/usr/local/openresty/lualib/?.lua\"'"
454472
#CFLAGS=$"$CFLAGS -DLUA_DEFAULT_CPATH='\"/usr/local/openresty/lualib/?.so\"'"

0 commit comments

Comments
 (0)