Skip to content

Commit 73eca25

Browse files
author
styree
committed
bugfix(kong-1.3) Linking workaround for openresty-1.15.8.1/libpcre
libpcre, if built statically using openresty, for openresty 1.15.8.1, fails to link properly, leading to errors when using ngx.re. Upstream versions of openresty don't have this issue, but Kong Enterprise 1.3 depends on openresty 1.15.8.1, so adding a workaround descibed in: openresty/lua-resty-core#258
1 parent fe0f08a commit 73eca25

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

kong-env.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,19 @@ def download_and_extract_openresty(environment_directory, tmp_directory, config,
261261
'--with-http_ssl_module', '--with-http_realip_module',
262262
'--with-http_stub_status_module', '--with-http_v2_module',
263263
'--with-cc-opt="-I' + path.join(environment_directory, 'include') + '"',
264-
'--with-ld-opt="-L' + path.join(environment_directory, 'lib') + '"',
265264
'--with-luajit-xcflags="-DLUAJIT_NUMMODE=2"', '-j8',
266265
'--with-stream_ssl_preread_module', '--with-stream_realip_module']
267266
if lua_kong_nginx_module_config is not None:
268267
shell_command.append('--add-module=' + path.join(tmp_directory, 'lua-kong-nginx-module'))
269268

269+
ld_opt_prefix = '--with-ld-opt="-L' + path.join(environment_directory, 'lib')
270+
if config['version'] == '1.15.8.1':
271+
# This openresty version builds a static libpcre poorly, so we need a workaround
272+
# See - https://github.com/openresty/lua-resty-core/issues/258
273+
shell_command.append(ld_opt_prefix + ' -Wl,-u,pcre_version"')
274+
else:
275+
shell_command.append(ld_opt_prefix + '"')
276+
270277
if not run_command(['sh', '-c', ' '.join(shell_command)], verbose):
271278
logger.error('unable to configure openresty package, exiting: package=%s' % (config['package']))
272279
return False

0 commit comments

Comments
 (0)